How do I get ALSA digital sound output in Linux?

Posted on 2008-11-09
Last Modified: 2013-12-15
I'm running MythBuntu and I'm having no success getting the optical audio to work.
I can verify the hardware is all fine because it works in XP. In linux, I can get analog out from the stereo headphone jack but the optical audio doesn't even show up as a device and the cable doesn't light up.
The motherboard is an ASUS M3N78-VM with VT1708b for the audio
kernel: 2.6.24-21-generic
ALSA version: Advanced Linux Sound Architecture Driver Version 1.0.18

aplay -l:

**** List of PLAYBACK Hardware Devices ****

card 0: NVidia [HDA NVidia], device 0: VT1708B Analog [VT1708B Analog]

  Subdevices: 2/2

  Subdevice #0: subdevice #0

  Subdevice #1: subdevice #1

card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]

  Subdevices: 1/1

  Subdevice #0: subdevice #0


Module                  Size  Used by

af_packet              23812  2 

ipv6                  267780  27 

powernow_k8            16704  1 

cpufreq_powersave       2688  0 

cpufreq_conservative     8712  0 

cpufreq_stats           7104  0 

cpufreq_userspace       5284  0 

cpufreq_ondemand        9740  1 

freq_table              5536  3 powernow_k8,cpufreq_stats,cpufreq_ondemand

video                  19856  0 

output                  4736  1 video

container               5632  0 

dock                   11280  0 

sbs                    15112  0 

sbshc                   7680  1 sbs

battery                14212  0 

nls_cp437               6656  2 

cifs                  242292  2 

iptable_filter          3840  0 

ip_tables              14820  1 iptable_filter

x_tables               16132  1 ip_tables

ac                      6916  0 

lp                     12324  0 

parport                37832  1 lp

nvidia               7106468  0 

agpgart                34760  1 nvidia

lirc_mceusb2           14980  0 

snd_hda_intel         419220  0 

lirc_dev               15732  1 lirc_mceusb2

i2c_core               24832  1 nvidia

wmi_acer                9644  0 

snd_pcm_oss            42656  0 

snd_mixer_oss          18048  1 snd_pcm_oss

snd_pcm                78852  2 snd_hda_intel,snd_pcm_oss

snd_page_alloc         12552  2 snd_hda_intel,snd_pcm

snd_hwdep              10628  1 snd_hda_intel

snd_seq_oss            35456  0 

snd_seq_midi            9504  0 

snd_rawmidi            25760  1 snd_seq_midi

snd_seq_midi_event      8576  2 snd_seq_oss,snd_seq_midi

snd_seq                54224  5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event

snd_timer              24964  2 snd_pcm,snd_seq

snd_seq_device          9612  4 snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq

snd                    59812  10 snd_hda_intel,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_hwdep,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device

soundcore               8800  1 snd

button                  9232  0 

k8temp                  6656  0 

shpchp                 34452  0 

pci_hotplug            30880  1 shpchp

evdev                  13056  3 

pcspkr                  4224  0 

ext3                  136840  1 

jbd                    48404  1 ext3

mbcache                 9600  1 ext3

ata_generic             8324  0 

sg                     36880  0 

sd_mod                 30720  3 

sr_mod                 17956  0 

cdrom                  37408  1 sr_mod

pata_amd               14212  0 

usbhid                 32128  0 

hid                    38784  1 usbhid

floppy                 59588  0 

ehci_hcd               37900  0 

ahci                   28548  2 

pata_acpi               8320  0 

forcedeth              51980  0 

ohci_hcd               26640  0 

libata                159344  4 ata_generic,pata_amd,ahci,pata_acpi

scsi_mod              151436  4 sg,sd_mod,sr_mod,libata

usbcore               146412  5 lirc_mceusb2,usbhid,ehci_hcd,ohci_hcd

thermal                16796  0 

processor              37384  2 powernow_k8,thermal

fan                     5636  0 

fbcon                  42912  0 

tileblit                3456  1 fbcon

font                    9472  1 fbcon

bitblit                 6784  1 fbcon

softcursor              3072  1 bitblit

fuse                   50708  1

Open in new window

Question by:jasonzx
    LVL 34

    Expert Comment

    by:Duncan Roe
    Is the optical audio a USB device? There may be a module to support it or there may not. Look around in "make xconfig". If you can't find anything, try 2.6.27-4 (i.e. try "make xconfig" of it).

    Author Comment

    No. It's not a USB device. It's on-board which supports analog, HDMI and optical outputs.
    Already tried compiling the newest ALSA from scratch but still only have access to analog output from the headphone jack.
    Also, downloaded newest vanilla kernel and added everything I could find for ALSA, VIA, NVidia and Intel audio with no success.
    LVL 34

    Expert Comment

    by:Duncan Roe
    Looks like you've done all the right things. You didn't post the output from lspci - does it show up there? Or in dmesg?
    /usr/src/linux/sound/pci/hda/patch_via.c claims to support the VT1708b codec. Is that it? or is the optical driver something else? do you know what it is in that case? Maybe Windows device manager will tell you.

    Author Comment

    The optical should fall under the VT1708b. On the card(as you can see above) the analog shows up as device #1. The HDMI shows up as #3. I assume the optical is #2 but it's not listed.

    I no longer have Windows installed on that machine so I couldn't say what XP says about it.
    00:00.0 RAM memory: nVidia Corporation Unknown device 0754 (rev a2)
    00:01.0 ISA bridge: nVidia Corporation Unknown device 075c (rev a2)
    00:01.1 SMBus: nVidia Corporation Unknown device 0752 (rev a1)
    00:01.2 RAM memory: nVidia Corporation Unknown device 0751 (rev a1)
    00:01.3 Co-processor: nVidia Corporation Unknown device 0753 (rev a2)
    00:01.4 RAM memory: nVidia Corporation Unknown device 0568 (rev a1)
    00:02.0 USB Controller: nVidia Corporation Unknown device 077b (rev a1)
    00:02.1 USB Controller: nVidia Corporation Unknown device 077c (rev a1)
    00:04.0 USB Controller: nVidia Corporation Unknown device 077d (rev a1)
    00:04.1 USB Controller: nVidia Corporation Unknown device 077e (rev a1)
    00:06.0 IDE interface: nVidia Corporation Unknown device 0759 (rev a1)
    00:07.0 Audio device: nVidia Corporation Unknown device 0774 (rev a1)
    00:08.0 PCI bridge: nVidia Corporation Unknown device 075a (rev a1)
    00:09.0 SATA controller: nVidia Corporation Unknown device 0ad4 (rev a2)
    00:0a.0 Ethernet controller: nVidia Corporation Unknown device 0760 (rev a2)
    00:0b.0 PCI bridge: nVidia Corporation Unknown device 0569 (rev a1)
    00:10.0 PCI bridge: nVidia Corporation Unknown device 0778 (rev a1)
    00:12.0 PCI bridge: nVidia Corporation Unknown device 075b (rev a1)
    00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTra    nsport Technology Configuration
    00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address     Map
    00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Con    troller
    00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscella    neous Control
    02:00.0 VGA compatible controller: nVidia Corporation GeForce 8200 (rev a2)

    Open in new window

    LVL 34

    Expert Comment

    by:Duncan Roe
    (bit of a rush this morning) Are you sure patch_via is loaded? You may hav - it may be loaded as a part of something else - can you confirm though.

    Author Comment

    No. I'm not sure if patch_via is loaded. How can I tell, and if it's not, where do I get it?
    LVL 34

    Expert Comment

    by:Duncan Roe
    Assuming you have linux source in /usr/src/linux, patch_via.c is found in /usr/src/linux/sound/pci/hda. If it has been built, there will be a patch_via.o in your linux build directory.
    In "make xconfig", verify that Intel HD Audio (SND_HDA_INTEL) is selected, and that Build VIA HD-audio codec support (SND_HDA_CODEC_VIA) is selected below that.
    LVL 34

    Expert Comment

    by:Duncan Roe
    Actually you have module snd_hda_intel loaded, so you may well find patch_via is loaded (all extensions are loaded by default). Worth checking though

    Author Comment

    I got the newest ALSA sources from the website and installed from that. There is a patch_via.o in the ALSA build directory so I'm assuming it's installed and running. Any way I can tell for sure?

    I checked out the patch_via.c file and it seems to reference my card here:
    #define IS_VT1708B_8CH_VENDORID(x)      ((x) >= 0x1106e720 && (x) <= 0x1106e723)

    as my card shows as:
    (cat /proc/asound/card0/codec#1)
    Codec: VIA VIA VT1708B 8-Ch
    Address: 0
    Vendor Id: 0x1106e721
    Subsystem Id: 0x10438345
    Revision Id: 0x100100

    cat /proc/asound/card0/codec#3:
    Codec: Generic 10de NVIDIA MCP78 HDMI
    Address: 3
    Vendor Id: 0x10de0002
    Subsystem Id: 0x10de0101
    Revision Id: 0x100000

    Is there any way to find out the vendor ID of the missing optical audio device without having to re-install XP? Maybe this is just a matter of ALSA not knowing how to recognize my card. I've done similar under Windows by modifying the driver .inf file.
    LVL 34

    Accepted Solution

    To check, grep for SND_HDA_CODEC_VIA in /usr/src/linux/.config. If equals "m" or "y" then you have it.
    Is there a mailing list associated with the ALSA web site? You might try to ask there.
    Are you saying there is no /proc/asound/card0/codec#2?
    I can't suggest anything else, other than XP

    Author Closing Comment

    Thanks for all the info and hopefully pointing me in the right direction.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now