[alsa-devel] spdif/iec958 outputs at VT1708S not recognized
Hi,
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
Alas, the code in pci/hda/patch_via.c did not recognize the 3 existing iec958/spdif outputs, and presented only the analog devices.
I had to short circuit the pin definition in vt1708S_parse_auto_config() to get the digital outputs to work:
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + // test fails for Asus M4N78 if (spec->autocfg.dig_out_pin) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID;
spec->extra_dig_out_nid = 0x15;
The digital sound output works just fine for me with this change, but I guess there should be a cleaner way to make this work?
Several people in forums on the InterNet reported similar problems with getting their digital outputs on VT1708S to work under Linux.
Regards,
Peter Niemayer
At Wed, 29 Apr 2009 14:25:28 +0200, Peter Niemayer wrote:
Hi,
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
Alas, the code in pci/hda/patch_via.c did not recognize the 3 existing iec958/spdif outputs, and presented only the analog devices.
Could you run alsa-info.sh with --no-upload option, and attach the generated file?
I had to short circuit the pin definition in vt1708S_parse_auto_config() to get the digital outputs to work:
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
if (spec->autocfg.dig_out_pin)
// test fails for Asus M4N78 if (spec->autocfg.dig_out_pin) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; spec->extra_dig_out_nid = 0x15;
The digital sound output works just fine for me with this change, but I guess there should be a cleaner way to make this work?
Fix your BIOS :)
Or, having a static quirk table in the driver would be another and more reasonable option. Usually we check PCI SSID to identify the model.
BTW, the pin configuration can be overridden via hwdep sysfs files in the latest version, too. Check Documentation/sound/alsa/HD-Audio.txt.
thanks,
Takashi
Takashi Iwai wrote:
Peter Niemayer wrote:
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
Alas, the code in pci/hda/patch_via.c did not recognize the 3 existing iec958/spdif outputs, and presented only the analog devices.
Could you run alsa-info.sh with --no-upload option, and attach the generated file?
Yes, find attached the output. Please notice that this output was generated while my patch...
I had to short circuit the pin definition in vt1708S_parse_auto_config() to get the digital outputs to work:
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
if (spec->autocfg.dig_out_pin)
// test fails for Asus M4N78 if (spec->autocfg.dig_out_pin) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; spec->extra_dig_out_nid = 0x15;
... was in place and thus the digital outputs were available (and working). (Otherwise, no digital outputs would have been reported)
Fix your BIOS :)
Last time I asked Asus to fix a BIOS (regarding ACPI tables of a notebook) the effort was futile :-(
Or, having a static quirk table in the driver would be another and more reasonable option. Usually we check PCI SSID to identify the model.
That would be much appreciated.
BTW, the pin configuration can be overridden via hwdep sysfs files in the latest version, too. Check Documentation/sound/alsa/HD-Audio.txt.
I must admit that after reading the section "HD-Audio Reconfiguration" in this file, it is not quite clear to me how this could be done.
Changing the abovementioned single source line was much easier for me... ;-)
Regards,
Peter Niemayer
!!################################ !!ALSA Information Script v 0.4.56 !!################################
!!Script ran on: Mon May 4 21:59:07 UTC 2009
!!Linux Distribution !!------------------
Fedora release 8 (Werewolf) Fedora release 8 (Werewolf) Fedora release 8 (Werewolf) Fedora release 8 (Werewolf)
!!Kernel Information !!------------------
Kernel release: 2.6.29 Operating System: GNU/Linux Architecture: x86_64 Processor: x86_64 SMP Enabled: Yes
!!ALSA Version !!------------
Driver version: 1.0.18a Library version: 1.0.15 Utilities version: 1.0.15
!!Loaded ALSA modules !!-------------------
snd_hda_intel
!!Sound Servers on this system !!----------------------------
aRts: Installed - Yes (/usr/bin/artsd) Running - No
Jack: Installed - Yes (/usr/bin/jackd) Running - No
!!Soundcards recognised by ALSA !!-----------------------------
0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xfad78000 irq 21
!!PCI Soundcards installed in the system !!--------------------------------------
00:07.0 Audio device: nVidia Corporation Unknown device 0774 (rev a1)
!!Advanced information - PCI Vendor/Device/Susbsystem ID's !!--------------------------------------------------------
00:07.0 0403: 10de:0774 (rev a1) Subsystem: 1043:836c
!!Loaded sound module options !!--------------------------
!!Module: snd_hda_intel bdl_pos_adj : 32,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 enable : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y enable_msi : 0 id : <NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL> index : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 model : <NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL> position_fix : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 probe_mask : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 probe_only : N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N single_cmd : N
!!HDA-Intel Codec information !!--------------------------- --startcollapse--
Codec: VIA VT1708S Address: 0 Vendor Id: 0x11060397 Subsystem Id: 0x1043836c Revision Id: 0x100000 No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=1, o=0, i=0, unsolicited=1, wake=0 IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 Node 0x10 [Audio Output] wcaps 0x41d: Stereo Amp-Out Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0 Amp-Out vals: [0x1f 0x1f] Converter: stream=0, channel=0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x11 [Audio Output] wcaps 0x41d: Stereo Amp-Out Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0 Amp-Out vals: [0x20 0x20] Converter: stream=0, channel=0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x12 [Audio Output] wcaps 0x611: Stereo Digital Converter: stream=0, channel=0 Digital: Enabled Digital category: 0x0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x13 [Audio Input] wcaps 0x10051b: Stereo Amp-In Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1 Amp-In vals: [0x00 0x00] Converter: stream=0, channel=0 SDI-Select: 0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Connection: 1 0x17 Node 0x14 [Audio Input] wcaps 0x10051b: Stereo Amp-In Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1 Amp-In vals: [0x00 0x00] Converter: stream=0, channel=0 SDI-Select: 0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Connection: 1 0x1e Node 0x15 [Audio Output] wcaps 0x611: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x16 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-In vals: [0x17 0x17] [0x17 0x17] [0x80 0x80] [0x00 0x00] [0x80 0x80] [0x97 0x97] [0x97 0x97] Power: setting=D0, actual=D0 Connection: 7 0x10 0x1f 0x1a 0x1b 0x1e 0x1d 0x25 Node 0x17 [Audio Selector] wcaps 0x300501: Stereo Power: setting=D0, actual=D0 Connection: 6 0x1f 0x1a* 0x1b 0x1e 0x1d 0x16 Node 0x18 [Audio Selector] wcaps 0x30050d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Power: setting=D0, actual=D0 Connection: 1 0x11 Node 0x19 [Pin Complex] wcaps 0x400581: Stereo Pincap 0x00000014: OUT Detect Pin Default 0x01011012: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Black DefAssociation = 0x1, Sequence = 0x2 Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x18 Node 0x1a [Pin Complex] wcaps 0x400581: Stereo Pincap 0x00002334: IN OUT Detect Vref caps: HIZ 50 100 Pin Default 0x01a19036: [Jack] Mic at Ext Rear Conn = 1/8, Color = Pink DefAssociation = 0x3, Sequence = 0x6 Pin-ctls: 0x21: IN VREF_50 Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x26 Node 0x1b [Pin Complex] wcaps 0x400581: Stereo Pincap 0x00002334: IN OUT Detect Vref caps: HIZ 50 100 Pin Default 0x0181303e: [Jack] Line In at Ext Rear Conn = 1/8, Color = Blue DefAssociation = 0x3, Sequence = 0xe Pin-ctls: 0x20: IN VREF_HIZ Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x18 Node 0x1c [Pin Complex] wcaps 0x40058d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x0001001c: OUT HP EAPD Detect EAPD 0x0: Pin Default 0x01014010: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Green DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x16 Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x0000233c: IN OUT HP Detect Vref caps: HIZ 50 100 Pin Default 0x0221411f: [Jack] HP Out at Ext Front Conn = 1/8, Color = Green DefAssociation = 0x1, Sequence = 0xf Misc = NO_PRESENCE Pin-ctls: 0xc0: OUT HP VREF_HIZ Unsolicited: tag=01, enabled=1 Power: setting=D0, actual=D0 Connection: 2 0x16* 0x25 Node 0x1e [Pin Complex] wcaps 0x40058d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000233c: IN OUT HP Detect Vref caps: HIZ 50 100 Pin Default 0x02a19138: [Jack] Mic at Ext Front Conn = 1/8, Color = Pink DefAssociation = 0x3, Sequence = 0x8 Misc = NO_PRESENCE Pin-ctls: 0x21: IN VREF_50 Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 2 0x16* 0x25 Node 0x1f [Pin Complex] wcaps 0x400401: Stereo Pincap 0x00000020: IN Pin Default 0x90370137: [Fixed] CD at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x3, Sequence = 0x7 Misc = NO_PRESENCE Pin-ctls: 0x20: IN Power: setting=D0, actual=D0 Node 0x20 [Pin Complex] wcaps 0x400701: Stereo Digital Pincap 0x00000010: OUT Pin Default 0x985601f0: [Fixed] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x40: OUT Power: setting=D0, actual=D0 Connection: 1 0x12 Node 0x21 [Pin Complex] wcaps 0x400701: Stereo Digital Pincap 0x00000010: OUT Pin Default 0x074411f0: [Jack] SPDIF Out at Ext Rear Panel Conn = RCA, Color = Black DefAssociation = 0xf, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x40: OUT Power: setting=D0, actual=D0 Connection: 1 0x15 Node 0x22 [Pin Complex] wcaps 0x400581: Stereo Pincap 0x00000014: OUT Detect Pin Default 0x01016011: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Orange DefAssociation = 0x1, Sequence = 0x1 Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x26 Node 0x23 [Pin Complex] wcaps 0x400581: Stereo Pincap 0x00000014: OUT Detect Pin Default 0x01012014: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Grey DefAssociation = 0x1, Sequence = 0x4 Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Power: setting=D0, actual=D0 Connection: 1 0x27 Node 0x24 [Audio Output] wcaps 0x41d: Stereo Amp-Out Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0 Amp-Out vals: [0x1f 0x20] Converter: stream=0, channel=0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x25 [Audio Output] wcaps 0x41d: Stereo Amp-Out Amp-Out caps: ofs=0x2a, nsteps=0x2a, stepsize=0x05, mute=0 Amp-Out vals: [0x1f 0x1f] Converter: stream=0, channel=0 PCM: rates [0x5e0]: 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power: setting=D0, actual=D0 Node 0x26 [Audio Selector] wcaps 0x30050d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Power: setting=D0, actual=D0 Connection: 1 0x24 Node 0x27 [Audio Selector] wcaps 0x30050d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Power: setting=D0, actual=D0 Connection: 1 0x25 Codec: Nvidia MCP78 HDMI Address: 3 Vendor Id: 0x10de0002 Subsystem Id: 0x10de0101 Revision Id: 0x100000 No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=0, o=0, i=0, unsolicited=0, wake=0 Node 0x04 [Audio Output] wcaps 0x211: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0xc0]: 48000 88200 bits [0xf]: 8 16 20 24 formats [0x1]: PCM Node 0x05 [Pin Complex] wcaps 0x400381: Stereo Digital Pincap 0x00000014: OUT Detect Pin Default 0x18560110: [Jack] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Connection: 1 0x04 Node 0x06 [Audio Output] wcaps 0x211: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0xc0]: 48000 88200 bits [0xf]: 8 16 20 24 formats [0x1]: PCM Node 0x07 [Pin Complex] wcaps 0x400381: Stereo Digital Pincap 0x00000014: OUT Detect Pin Default 0x58560121: [N/A] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x2, Sequence = 0x1 Misc = NO_PRESENCE Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Connection: 1 0x06 Node 0x08 [Audio Output] wcaps 0x211: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0xc0]: 48000 88200 bits [0xf]: 8 16 20 24 formats [0x1]: PCM Node 0x09 [Pin Complex] wcaps 0x400381: Stereo Digital Pincap 0x00000014: OUT Detect Pin Default 0x58560122: [N/A] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x2, Sequence = 0x2 Misc = NO_PRESENCE Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Connection: 1 0x08 Node 0x0a [Audio Output] wcaps 0x211: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0xc0]: 48000 88200 bits [0xf]: 8 16 20 24 formats [0x1]: PCM Node 0x0b [Pin Complex] wcaps 0x400381: Stereo Digital Pincap 0x00000014: OUT Detect Pin Default 0x58560123: [N/A] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x2, Sequence = 0x3 Misc = NO_PRESENCE Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Connection: 1 0x0a Node 0x0c [Audio Output] wcaps 0x211: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0xc0]: 48000 88200 bits [0xf]: 8 16 20 24 formats [0x1]: PCM Node 0x0d [Pin Complex] wcaps 0x400381: Stereo Digital Pincap 0x00000014: OUT Detect Pin Default 0x58560124: [N/A] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x2, Sequence = 0x4 Misc = NO_PRESENCE Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Connection: 1 0x0c --endcollapse--
!!ALSA Device nodes !!-----------------
crw-rw-rw- 1 root root 116, 10 Apr 29 23:15 /dev/snd/controlC0 crw-rw-rw- 1 root root 116, 9 Apr 29 23:15 /dev/snd/hwC0D0 crw-rw-rw- 1 root root 116, 8 Apr 29 23:15 /dev/snd/hwC0D3 crw-rw-rw- 1 root root 116, 7 Apr 29 23:15 /dev/snd/pcmC0D0c crw-rw-rw- 1 root root 116, 6 Apr 29 23:15 /dev/snd/pcmC0D0p crw-rw-rw- 1 root root 116, 5 May 4 00:41 /dev/snd/pcmC0D1p crw-rw-rw- 1 root root 116, 4 Apr 29 23:15 /dev/snd/pcmC0D3p crw-rw-rw- 1 root root 116, 3 Apr 29 23:15 /dev/snd/seq crw-rw-rw- 1 root root 116, 2 Apr 29 23:15 /dev/snd/timer
!!ALSA configuration files !!------------------------
!!System wide config file (/etc/asound.conf)
#Generated by system-config-soundcard #If you edit this file, don't run system-config-soundcard, #all your changes here could be lost. #SWCONF #DEV 1 defaults.pcm.card 0 defaults.pcm.device 1 defaults.ctl.card 0
!!Aplay/Arecord output !!------------
APLAY
**** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 card 0: NVidia [HDA NVidia], device 1: VT1708S Digital [VT1708S Digital] 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
ARECORD
**** List of CAPTURE Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1
!!Amixer output !!-------------
!!-------Mixer controls for card 0 [NVidia]
Card hw:0 'NVidia'/'HDA NVidia at 0xfad78000 irq 21' Mixer name : 'Nvidia MCP78 HDMI' Components : 'HDA:11060397,1043836c,00100000 HDA:10de0002,10de0101,00100000' Controls : 44 Simple ctrls : 22 Simple mixer control 'Master Front',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Front Left: Playback 23 [74%] [0.00dB] [on] Front Right: Playback 23 [74%] [0.00dB] [on] Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 42 Mono: Front Left: Playback 31 [74%] [-16.50dB] [on] Front Right: Playback 31 [74%] [-16.50dB] [on] Simple mixer control 'PCM',0 Capabilities: pvolume Playback channels: Front Left - Front Right Limits: Playback 0 - 255 Mono: Front Left: Playback 255 [100%] [0.00dB] Front Right: Playback 255 [100%] [0.00dB] Simple mixer control 'Front',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 42 Mono: Front Left: Playback 31 [74%] [-16.50dB] [on] Front Right: Playback 31 [74%] [-16.50dB] [on] Simple mixer control 'Front Mic',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Front Left: Playback 0 [0%] [-34.50dB] [off] Front Right: Playback 0 [0%] [-34.50dB] [off] Simple mixer control 'Front Mic Boost',0 Capabilities: cvolume Capture channels: Front Left - Front Right Limits: Capture 0 - 3 Front Left: Capture 0 [0%] [0.00dB] Front Right: Capture 0 [0%] [0.00dB] Simple mixer control 'Surround',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 42 Mono: Front Left: Playback 32 [76%] [-15.00dB] [on] Front Right: Playback 32 [76%] [-15.00dB] [on] Simple mixer control 'Center',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 42 Mono: Playback 31 [74%] [-16.50dB] [on] Simple mixer control 'LFE',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 42 Mono: Playback 32 [76%] [-15.00dB] [on] Simple mixer control 'Side',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 42 Mono: Front Left: Playback 31 [74%] [-16.50dB] [on] Front Right: Playback 31 [74%] [-16.50dB] [on] Simple mixer control 'Line',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Front Left: Playback 0 [0%] [-34.50dB] [on] Front Right: Playback 0 [0%] [-34.50dB] [on] Simple mixer control 'CD',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Front Left: Playback 23 [74%] [0.00dB] [on] Front Right: Playback 23 [74%] [0.00dB] [on] Simple mixer control 'Mic',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Front Left: Playback 0 [0%] [-34.50dB] [off] Front Right: Playback 0 [0%] [-34.50dB] [off] Simple mixer control 'Mic Boost',0 Capabilities: cvolume Capture channels: Front Left - Front Right Limits: Capture 0 - 3 Front Left: Capture 0 [0%] [0.00dB] Front Right: Capture 0 [0%] [0.00dB] Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'IEC958 Default PCM',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'IEC958',1 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'IEC958',2 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch Capture channels: Front Left - Front Right Limits: Capture 0 - 31 Front Left: Capture 0 [0%] [-16.50dB] [on] Front Right: Capture 0 [0%] [-16.50dB] [on] Simple mixer control 'Capture',1 Capabilities: cvolume cswitch Capture channels: Front Left - Front Right Limits: Capture 0 - 31 Front Left: Capture 0 [0%] [-16.50dB] [on] Front Right: Capture 0 [0%] [-16.50dB] [on] Simple mixer control 'Independent HP',0 Capabilities: enum Items: 'OFF' 'ON' Item0: 'OFF' Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Stereo Mixer' 'Mic' 'Front Mic' 'Line' 'CD' Item0: 'Stereo Mixer'
!!Alsactl output !!-------------
--startcollapse-- state.NVidia { control.1 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Master Front Playback Volume' value.0 23 value.1 23 } control.2 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Master Front Playback Switch' value.0 true value.1 true } control.3 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 42' iface MIXER name 'Front Playback Volume' value.0 31 value.1 31 } control.4 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Front Playback Switch' value.0 true value.1 true } control.5 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 42' iface MIXER name 'Surround Playback Volume' value.0 32 value.1 32 } control.6 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Surround Playback Switch' value.0 true value.1 true } control.7 { comment.access 'read write' comment.type INTEGER comment.count 1 comment.range '0 - 42' iface MIXER name 'Center Playback Volume' value 31 } control.8 { comment.access 'read write' comment.type INTEGER comment.count 1 comment.range '0 - 42' iface MIXER name 'LFE Playback Volume' value 32 } control.9 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'Center Playback Switch' value true } control.10 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'LFE Playback Switch' value true } control.11 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 42' iface MIXER name 'Side Playback Volume' value.0 31 value.1 31 } control.12 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Side Playback Switch' value.0 true value.1 true } control.13 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 42' iface MIXER name 'Headphone Playback Volume' value.0 31 value.1 31 } control.14 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Headphone Playback Switch' value.0 true value.1 true } control.15 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Mic Playback Volume' value.0 0 value.1 0 } control.16 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Mic Playback Switch' value.0 false value.1 false } control.17 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Front Mic Playback Volume' value.0 0 value.1 0 } control.18 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Front Mic Playback Switch' value.0 false value.1 false } control.19 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Line Playback Volume' value.0 0 value.1 0 } control.20 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Line Playback Switch' value.0 true value.1 true } control.21 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'CD Playback Volume' value.0 23 value.1 23 } control.22 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'CD Playback Switch' value.0 true value.1 true } control.23 { comment.access 'read write' comment.type ENUMERATED comment.count 1 comment.item.0 OFF comment.item.1 ON iface MIXER name 'Independent HP' value OFF } control.24 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Capture Volume' value.0 0 value.1 0 } control.25 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Capture Switch' value.0 true value.1 true } control.26 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 31' iface MIXER name 'Capture Volume' index 1 value.0 0 value.1 0 } control.27 { comment.access 'read write' comment.type BOOLEAN comment.count 2 iface MIXER name 'Capture Switch' index 1 value.0 true value.1 true } control.28 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 3' iface MIXER name 'Mic Boost Capture Volume' value.0 0 value.1 0 } control.29 { comment.access 'read write' comment.type INTEGER comment.count 2 comment.range '0 - 3' iface MIXER name 'Front Mic Boost Capture Volume' value.0 0 value.1 0 } control.30 { comment.access 'read write' comment.type ENUMERATED comment.count 1 comment.item.0 'Stereo Mixer' comment.item.1 Mic comment.item.2 'Front Mic' comment.item.3 Line comment.item.4 CD iface MIXER name 'Input Source' value 'Stereo Mixer' } control.31 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Con Mask' value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.32 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Pro Mask' value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.33 { comment.access 'read write' comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Default' value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.34 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'IEC958 Playback Switch' value true } control.35 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'IEC958 Default PCM Playback Switch' value true } control.36 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Con Mask' index 1 value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.37 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Pro Mask' index 1 value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.38 { comment.access 'read write' comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Default' index 1 value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.39 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'IEC958 Playback Switch' index 1 value true } control.40 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Con Mask' index 2 value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.41 { comment.access read comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Pro Mask' index 2 value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.42 { comment.access 'read write' comment.type IEC958 comment.count 1 iface MIXER name 'IEC958 Playback Default' index 2 value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' } control.43 { comment.access 'read write' comment.type BOOLEAN comment.count 1 iface MIXER name 'IEC958 Playback Switch' index 2 value false } control.44 { comment.access 'read write user' comment.type INTEGER comment.count 2 comment.range '0 - 255' comment.tlv '0000000100000008ffffec1400000014' iface MIXER name 'PCM Playback Volume' value.0 255 value.1 255 } } --endcollapse--
!!All Loaded Modules !!------------------
Module cpufreq_powersave nvidia ppp_deflate zlib_deflate ppp_async crc_ccitt ppp_generic slhc cdc_acm usb_storage nls_utf8 lockd reiserfs loop ipt_LOG iptable_mangle iptable_filter ip_tables ip6table_filter ip6_tables x_tables ipv6 dm_mirror dm_region_hash dm_log dm_multipath dm_mod snd_hda_codec_nvhdmi snd_hda_codec_via nxt6000 snd_hda_intel sp887x snd_hda_codec dst_ca snd_hwdep snd_via82xx dst gameport tuner_simple tuner_types snd_ac97_codec ac97_bus or51211 zl10353 snd_mpu401_uart snd_rawmidi lgdt330x snd_seq_dummy cx24110 snd_seq_oss snd_seq_midi_event snd_seq ir_common i2c_algo_bit snd_seq_device snd_pcm_oss snd_mixer_oss videobuf_dma_sg snd_pcm arc4 snd_timer ecb k8temp hwmon shpchp snd floppy forcedeth ahci pcspkr soundcore snd_page_alloc i2c_core rtc_cmos rtc_core rtc_lib button libata sd_mod scsi_mod uhci_hcd ohci_hcd ehci_hcd
At Tue, 05 May 2009 12:48:17 +0200, Peter Niemayer wrote:
Takashi Iwai wrote:
Peter Niemayer wrote:
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
Alas, the code in pci/hda/patch_via.c did not recognize the 3 existing iec958/spdif outputs, and presented only the analog devices.
Could you run alsa-info.sh with --no-upload option, and attach the generated file?
Yes, find attached the output. Please notice that this output was generated while my patch...
Thanks. It looks like actually a bug in the driver side. It doesn't handle multiple SPDIF properly.
Could you try the patch below? It's against the latest sound git tree, but likely applicable to a bit older one, too.
Takashi
--- diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index b25a5cc..1a756a3 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -205,7 +205,7 @@ struct via_spec {
/* playback */ struct hda_multi_out multiout; - hda_nid_t extra_dig_out_nid; + hda_nid_t slave_dig_outs[2];
/* capture */ unsigned int num_adc_nids; @@ -731,21 +731,6 @@ static int via_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, return snd_hda_multi_out_dig_close(codec, &spec->multiout); }
-/* setup SPDIF output stream */ -static void setup_dig_playback_stream(struct hda_codec *codec, hda_nid_t nid, - unsigned int stream_tag, unsigned int format) -{ - /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ - if (codec->spdif_ctls & AC_DIG1_ENABLE) - snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, - codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff); - snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); - /* turn on again (if needed) */ - if (codec->spdif_ctls & AC_DIG1_ENABLE) - snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, - codec->spdif_ctls & 0xff); -} - static int via_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, @@ -753,19 +738,16 @@ static int via_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct snd_pcm_substream *substream) { struct via_spec *spec = codec->spec; - hda_nid_t nid; - - /* 1st or 2nd S/PDIF */ - if (substream->number == 0) - nid = spec->multiout.dig_out_nid; - else if (substream->number == 1) - nid = spec->extra_dig_out_nid; - else - return -1; + return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, + stream_tag, format, substream); +}
- mutex_lock(&codec->spdif_mutex); - setup_dig_playback_stream(codec, nid, stream_tag, format); - mutex_unlock(&codec->spdif_mutex); +static int via_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, + struct hda_codec *codec, + struct snd_pcm_substream *substream) +{ + struct via_spec *spec = codec->spec; + snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); return 0; }
@@ -842,7 +824,8 @@ static struct hda_pcm_stream vt1708_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -874,13 +857,6 @@ static int via_build_controls(struct hda_codec *codec) if (err < 0) return err; spec->multiout.share_spdif = 1; - - if (spec->extra_dig_out_nid) { - err = snd_hda_create_spdif_out_ctls(codec, - spec->extra_dig_out_nid); - if (err < 0) - return err; - } } if (spec->dig_in_nid) { err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid); @@ -1013,10 +989,6 @@ static void via_unsol_event(struct hda_codec *codec, via_gpio_control(codec); }
-static hda_nid_t slave_dig_outs[] = { - 0, -}; - static int via_init(struct hda_codec *codec) { struct via_spec *spec = codec->spec; @@ -1051,8 +1023,9 @@ static int via_init(struct hda_codec *codec) snd_hda_codec_write(codec, spec->autocfg.dig_in_pin, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN);
- /* no slave outs */ - codec->slave_dig_outs = slave_dig_outs; + /* assign slave outs */ + if (spec->slave_dig_outs[0]) + codec->slave_dig_outs = spec->slave_dig_outs;
return 0; } @@ -2134,7 +2107,8 @@ static struct hda_pcm_stream vt1708B_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -2589,14 +2563,15 @@ static struct hda_pcm_stream vt1708S_pcm_analog_capture = { };
static struct hda_pcm_stream vt1708S_pcm_digital_playback = { - .substreams = 2, + .substreams = 1, .channels_min = 2, .channels_max = 2, /* NID is set in via_build_pcms */ .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -2805,14 +2780,37 @@ static int vt1708S_auto_create_analog_input_ctls(struct via_spec *spec, return 0; }
+/* fill out digital output widgets; one for master and one for slave outputs */ +static void fill_dig_outs(struct hda_codec *codec) +{ + struct via_spec *spec = codec->spec; + int i; + + for (i = 0; i < spec->autocfg.dig_outs; i++) { + hda_nid_t nid; + int conn; + + nid = spec->autocfg.dig_out_pins[i]; + if (!nid) + continue; + conn = snd_hda_get_connections(codec, nid, &nid, 1); + if (conn < 1) + continue; + if (!spec->multiout.dig_out_nid) + spec->multiout.dig_out_nid = nid; + else { + spec->slave_dig_outs[0] = nid; + break; /* at most two dig outs */ + } + } +} + static int vt1708S_parse_auto_config(struct hda_codec *codec) { struct via_spec *spec = codec->spec; int err; - static hda_nid_t vt1708s_ignore[] = {0x21, 0};
- err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, - vt1708s_ignore); + err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); if (err < 0) return err; err = vt1708S_auto_fill_dac_nids(spec, &spec->autocfg); @@ -2833,10 +2831,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_outs) - spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; - - spec->extra_dig_out_nid = 0x15; + fill_dig_outs(codec);
if (spec->kctls.list) spec->mixers[spec->num_mixers++] = spec->kctls.list; @@ -3000,7 +2995,8 @@ static struct hda_pcm_stream vt1702_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -3152,10 +3148,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_outs) - spec->multiout.dig_out_nid = VT1702_DIGOUT_NID; - - spec->extra_dig_out_nid = 0x1B; + fill_dig_outs(codec);
if (spec->kctls.list) spec->mixers[spec->num_mixers++] = spec->kctls.list;
At Tue, 05 May 2009 12:48:17 +0200, Peter Niemayer wrote:
Takashi Iwai wrote:
Peter Niemayer wrote:
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
Alas, the code in pci/hda/patch_via.c did not recognize the 3 existing iec958/spdif outputs, and presented only the analog devices.
Could you run alsa-info.sh with --no-upload option, and attach the generated file?
Yes, find attached the output. Please notice that this output was generated while my patch...
Thanks. It looks like actually a bug in the driver side. It doesn't handle multiple SPDIF properly.
Could you try the patch below? It's against the latest sound git tree, but likely applicable to a bit older one, too.
Takashi
--- diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index b25a5cc..1a756a3 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -205,7 +205,7 @@ struct via_spec {
/* playback */ struct hda_multi_out multiout; - hda_nid_t extra_dig_out_nid; + hda_nid_t slave_dig_outs[2];
/* capture */ unsigned int num_adc_nids; @@ -731,21 +731,6 @@ static int via_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, return snd_hda_multi_out_dig_close(codec, &spec->multiout); }
-/* setup SPDIF output stream */ -static void setup_dig_playback_stream(struct hda_codec *codec, hda_nid_t nid, - unsigned int stream_tag, unsigned int format) -{ - /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ - if (codec->spdif_ctls & AC_DIG1_ENABLE) - snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, - codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff); - snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); - /* turn on again (if needed) */ - if (codec->spdif_ctls & AC_DIG1_ENABLE) - snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1, - codec->spdif_ctls & 0xff); -} - static int via_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, @@ -753,19 +738,16 @@ static int via_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct snd_pcm_substream *substream) { struct via_spec *spec = codec->spec; - hda_nid_t nid; - - /* 1st or 2nd S/PDIF */ - if (substream->number == 0) - nid = spec->multiout.dig_out_nid; - else if (substream->number == 1) - nid = spec->extra_dig_out_nid; - else - return -1; + return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, + stream_tag, format, substream); +}
- mutex_lock(&codec->spdif_mutex); - setup_dig_playback_stream(codec, nid, stream_tag, format); - mutex_unlock(&codec->spdif_mutex); +static int via_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, + struct hda_codec *codec, + struct snd_pcm_substream *substream) +{ + struct via_spec *spec = codec->spec; + snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); return 0; }
@@ -842,7 +824,8 @@ static struct hda_pcm_stream vt1708_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -874,13 +857,6 @@ static int via_build_controls(struct hda_codec *codec) if (err < 0) return err; spec->multiout.share_spdif = 1; - - if (spec->extra_dig_out_nid) { - err = snd_hda_create_spdif_out_ctls(codec, - spec->extra_dig_out_nid); - if (err < 0) - return err; - } } if (spec->dig_in_nid) { err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid); @@ -1013,10 +989,6 @@ static void via_unsol_event(struct hda_codec *codec, via_gpio_control(codec); }
-static hda_nid_t slave_dig_outs[] = { - 0, -}; - static int via_init(struct hda_codec *codec) { struct via_spec *spec = codec->spec; @@ -1051,8 +1023,9 @@ static int via_init(struct hda_codec *codec) snd_hda_codec_write(codec, spec->autocfg.dig_in_pin, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN);
- /* no slave outs */ - codec->slave_dig_outs = slave_dig_outs; + /* assign slave outs */ + if (spec->slave_dig_outs[0]) + codec->slave_dig_outs = spec->slave_dig_outs;
return 0; } @@ -2134,7 +2107,8 @@ static struct hda_pcm_stream vt1708B_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -2589,14 +2563,15 @@ static struct hda_pcm_stream vt1708S_pcm_analog_capture = { };
static struct hda_pcm_stream vt1708S_pcm_digital_playback = { - .substreams = 2, + .substreams = 1, .channels_min = 2, .channels_max = 2, /* NID is set in via_build_pcms */ .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -2805,14 +2780,37 @@ static int vt1708S_auto_create_analog_input_ctls(struct via_spec *spec, return 0; }
+/* fill out digital output widgets; one for master and one for slave outputs */ +static void fill_dig_outs(struct hda_codec *codec) +{ + struct via_spec *spec = codec->spec; + int i; + + for (i = 0; i < spec->autocfg.dig_outs; i++) { + hda_nid_t nid; + int conn; + + nid = spec->autocfg.dig_out_pins[i]; + if (!nid) + continue; + conn = snd_hda_get_connections(codec, nid, &nid, 1); + if (conn < 1) + continue; + if (!spec->multiout.dig_out_nid) + spec->multiout.dig_out_nid = nid; + else { + spec->slave_dig_outs[0] = nid; + break; /* at most two dig outs */ + } + } +} + static int vt1708S_parse_auto_config(struct hda_codec *codec) { struct via_spec *spec = codec->spec; int err; - static hda_nid_t vt1708s_ignore[] = {0x21, 0};
- err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, - vt1708s_ignore); + err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); if (err < 0) return err; err = vt1708S_auto_fill_dac_nids(spec, &spec->autocfg); @@ -2833,10 +2831,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_outs) - spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; - - spec->extra_dig_out_nid = 0x15; + fill_dig_outs(codec);
if (spec->kctls.list) spec->mixers[spec->num_mixers++] = spec->kctls.list; @@ -3000,7 +2995,8 @@ static struct hda_pcm_stream vt1702_pcm_digital_playback = { .ops = { .open = via_dig_playback_pcm_open, .close = via_dig_playback_pcm_close, - .prepare = via_dig_playback_pcm_prepare + .prepare = via_dig_playback_pcm_prepare, + .cleanup = via_dig_playback_pcm_cleanup }, };
@@ -3152,10 +3148,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_outs) - spec->multiout.dig_out_nid = VT1702_DIGOUT_NID; - - spec->extra_dig_out_nid = 0x1B; + fill_dig_outs(codec);
if (spec->kctls.list) spec->mixers[spec->num_mixers++] = spec->kctls.list;
Takashi Iwai wrote:
Could you try the patch below? It's against the latest sound git tree, but likely applicable to a bit older one, too.
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
Your patch to patch_via.c was applicable (with a little manual help from my side) to the 2.6.29 sources, but it seems to depend on an earlier git commit of yours regarding multi-digital-out support, and that patch (which I found in a git browser on the web) is not applicable to the 2.6.29 sources, there are lots of rejections.
Is there a way to pull just the sound/pci/hda subdirectory from your repository (without cloning the whole 150MB repository)? Or can you just mail me a .tar.bz2 of the relevant kernel source subdirectory?
Thanks a lot for your efforts!
Regards,
Peter Niemayer
At Fri, 08 May 2009 11:21:54 +0200, Peter Niemayer wrote:
Takashi Iwai wrote:
Could you try the patch below? It's against the latest sound git tree, but likely applicable to a bit older one, too.
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
Your patch to patch_via.c was applicable (with a little manual help from my side) to the 2.6.29 sources, but it seems to depend on an earlier git commit of yours regarding multi-digital-out support, and that patch (which I found in a git browser on the web) is not applicable to the 2.6.29 sources, there are lots of rejections.
Is there a way to pull just the sound/pci/hda subdirectory from your repository (without cloning the whole 150MB repository)? Or can you just mail me a .tar.bz2 of the relevant kernel source subdirectory?
In that case, you can build ALSA modules externally from alsa-driver tarball. Grab the snapshot version from ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
Takashi
Takashi Iwai wrote:
In that case, you can build ALSA modules externally from alsa-driver tarball. Grab the snapshot version from ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
I did that - this version works well for me. Thanks for your efforts!
(There is a minor glitch persistent that wasn't existing with my older AC97 based hardware: When pausing an AC3 stream to the amplifier, then resuming the playback, there is a loud "click" in the beginning as if there was a broken data packet sent to the amplifier - but one with a correct checksum, that has to be, as otherwise, the amplifier would not have played it. Or maybe the amp is misinterpreting some AC3 data as being PCM, but that wasn't the case with the previous audio card, though the software and the amp were the same.)
Regards,
Peter Niemayer
Peter Niemayer <niemayer <at> isg.de> writes:
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
I had to short circuit the pin definition in vt1708S_parse_auto_config() to get the digital outputs to work:
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
if (spec->autocfg.dig_out_pin)
// test fails for Asus M4N78 if (spec->autocfg.dig_out_pin) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID; spec->extra_dig_out_nid = 0x15;
Hi Peter,
I'm a relative Linux newbie trying to get away from Windows. But longtime computer geek. I have an issue with my Asus M4A78 (same as yours but ATI graphics), that the LFE channel works in speaker-test but has no output from applications (even when they should output 5.1, like a DVD in VLC).
I believe that some layer, maybe even the hw, is remixing to 5 (minus the .1) without being asked, as even CD sound plays over all five speakers. And there is no gui configuration program I can find to specify such a remixing (which I am sure the soundcard is capable of).
Currently I am trying an upgrade (via script from ubuntu forums) to the latest Alsa, from .18 to .19. If that doesn't resolve (and I don't expect it to): I am curious if you got 5.1 working properly with your soundcard. Also the SPDIF would be an option for me, can I ask the location of that code you mentioned? (If it's a config file and you wouldn't mind posting yours, would be fantastic).
I have been under the impression that the 1708S is not explicitly supported by Alsa, because it's not yet listed in the Alsa-project homepage list :-/
Many thanks, Dave
On Wed, Apr 29, 2009 at 5:19 PM, David Douglas one51s@yahoo.com wrote:
Peter Niemayer <niemayer <at> isg.de> writes:
I recently installed an Asus M4N78 mainboard, that uses a nVidia GeForce 8300 chipset and a VT1708S soundchip.
I had to short circuit the pin definition in vt1708S_parse_auto_config() to get the digital outputs to work:
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- // test fails for Asus M4N78 if (spec->autocfg.dig_out_pin)
spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID;
spec->extra_dig_out_nid = 0x15;
Hi Peter,
I'm a relative Linux newbie trying to get away from Windows. But longtime computer geek. I have an issue with my Asus M4A78 (same as yours but ATI graphics), that the LFE channel works in speaker-test but has no output from applications (even when they should output 5.1, like a DVD in VLC).
I believe that some layer, maybe even the hw, is remixing to 5 (minus the .1) without being asked, as even CD sound plays over all five speakers. And there is no gui configuration program I can find to specify such a remixing (which I am sure the soundcard is capable of).
Currently I am trying an upgrade (via script from ubuntu forums) to the latest Alsa, from .18 to .19. If that doesn't resolve (and I don't expect it to): I am curious if you got 5.1 working properly with your soundcard. Also the SPDIF would be an option for me, can I ask the location of that code you mentioned? (If it's a config file and you wouldn't mind posting yours, would be fantastic).
I have been under the impression that the 1708S is not explicitly supported by Alsa, because it's not yet listed in the Alsa-project homepage list :-/
Many thanks, Dave
Wiki is extremely outdated and incomplete since nobody is actively maintaining it. VT1708S is supported, thanks to contributions from VIA. However, quirky boards might not be fully working.
Maybe reporting BIOS bug to ASUS would help, but I wouldn't bet on that.
Vedran Miletić
participants (4)
-
David Douglas
-
Peter Niemayer
-
Takashi Iwai
-
Vedran Miletić