Bug 68611

Summary: No analog speaker output
Product: Drivers Reporter: Javier Castro (javier.alejandro.castro)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: superquad.vortex2
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.12.5 Subsystem:
Regression: No Bisected commit-id:
Attachments: force primary digital and secondary digital as SPDIF

Description Javier Castro 2014-01-12 16:27:36 UTC
I'm reporting here by advice from freedesktop comment.

The original report is here:

https://bugs.freedesktop.org/show_bug.cgi?id=70419#c17

Diagnostic: My analog output is listed as "unplugged", so i dont have any sound output.
Comment 1 Raymond 2014-01-13 02:54:44 UTC
what do mean when you say "i have the pink jack plugged in" ? 

	control.31 {
		iface CARD
		name 'Rear Mic Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.32 {
		iface CARD
		name 'Front Mic Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.33 {
		iface CARD
		name 'Line Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}

	control.34 {
		iface CARD
		name 'Line Out Front Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.35 {
		iface CARD
		name 'Line Out Surround Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.36 {
		iface CARD
		name 'Line Out CLFE Jack'
		value true
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.37 {
		iface CARD
		name 'Line Out Side Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}
	control.38 {
		iface CARD
		name 'Front Headphone Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}


[   13.947928] ALSA sound/pci/hda/hda_auto_parser.c:393 autoconfig: line_outs=4 (0x1c/0x19/0x22/0x23/0x0) type:line
[   13.947932] ALSA sound/pci/hda/hda_auto_parser.c:397    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   13.947934] ALSA sound/pci/hda/hda_auto_parser.c:401    hp_outs=1 (0x1d/0x0/0x0/0x0/0x0)
[   13.947936] ALSA sound/pci/hda/hda_auto_parser.c:402    mono: mono_out=0x0
[   13.947940] ALSA sound/pci/hda/hda_auto_parser.c:405    dig-out=0x20/0x21
[   13.947941] ALSA sound/pci/hda/hda_auto_parser.c:406    inputs:
[   13.947943] ALSA sound/pci/hda/hda_auto_parser.c:410      Rear Mic=0x1a
[   13.947945] ALSA sound/pci/hda/hda_auto_parser.c:410      Front Mic=0x1e
[   13.947946] ALSA sound/pci/hda/hda_auto_parser.c:410      Line=0x1b


the major problem is multiple digital pins 

 dig-out=0x20/0x21

seem you lost the digital device 1 for spdif 


card 1: Generic_1 [HD-Audio Generic], device 0: VT1708S Analog [VT1708S Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 3: VT1708S Digital [VT1708S Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

why do driver create hdmi device for VT1708S when it has two indepedent S/PDIF 

http://www.via.com.tw/en/products/audio/codecs/vt1708s/

2 independent 16/20/24-bit S/PDIF TX Outputs supporting 48K/96K/44.1K/88.2 KHz sample rate
Comment 2 Raymond 2014-01-13 04:32:00 UTC
Node 0x12 [Audio Output] wcaps 0x611: Stereo Digital
  Control: name="IEC958 Playback Con Mask", index=0, device=0
  Control: name="IEC958 Playback Pro Mask", index=0, device=0
  Control: name="IEC958 Playback Default", index=0, device=0
  Control: name="IEC958 Playback Switch", index=0, device=0
  Control: name="IEC958 Default PCM Playback Switch", index=0, device=0
  Device: name="VT1708S Digital", type="HDMI", device=3

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/?id=9a08160bdbe3148a405f72798f76e2a5d30bd243

iec958 Default PCM Playback Switch is used to enable/disable the sharing of the default PCM stream with analog and SPDIF outputs  but not HDMI device

this mean that the driver should create spdif instead of hdmi even when primary and secondary digital pins are different
Comment 3 Javier Castro 2014-01-13 14:42:53 UTC
I have no idea, i just followed advice on freedesktop bugzilla for reporting here instead. I'm not a kernel dev, just a developer using Linux.
Comment 4 Raymond 2014-01-14 03:33:38 UTC
http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/mixer/paths/analog-output-lineout.conf?id=ecf3ab2b5788c85c237eeb6429bd1d525b9ac0cc

control.34 {
		iface CARD
		name 'Line Out Front Jack'
		value false
		comment {
			access read
			type BOOLEAN
			count 1
		}
	}

how did you test ?

speaker-test -c2 -Dhw:0,0 -t -wav

pulseaudio check the status of green jack only if you plugged speaker into orange jack


Node 0x20 [Pin Complex] wcaps 0x400701: Stereo Digital
  Control: name="HDMI Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x185600f0: [Jack] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0xf, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Power states:  D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x12
Node 0x21 [Pin Complex] wcaps 0x400701: Stereo Digital
  Control: name="SPDIF Phantom Jack", index=0, device=0
  Pincap 0x00000010: OUT
  Pin Default 0x074521f0: [Jack] SPDIF Out at Ext Rear Panel
    Conn = Optical, Color = Grey
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Power states:  D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x15

try hda-jack-retask to change the hdmi pin complex node  node 0x20 as [N/A] 


or hda/hda-generic.c

static void parse_digital(struct hda_codec *codec)
{

		print_nid_path("digout", path);
		path->active = true;
		spec->digout_paths[i] = snd_hda_get_path_idx(codec, path);
		set_pin_target(codec, pin, PIN_OUT, false);
		if (!nums) {
			spec->multiout.dig_out_nid = dig_nid;
-			spec->dig_out_type = spec->autocfg.dig_out_type[0];
+			spec->dig_out_type = HDA_PCM_TYPE_SPDIF;
		} else {
			spec->multiout.slave_dig_outs = spec->slave_dig_outs;
			if (nums >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
			break;
			spec->slave_dig_outs[nums - 1] = dig_nid;
Comment 5 Raymond 2014-01-14 06:49:48 UTC
Created attachment 121951 [details]
force primary digital and secondary digital as SPDIF

the current driver create HDMI device when pin default of two independent SPDIF are set up as SPDIF and HDMI if the first pin complex is hdmi, this patch force the driver to create SPDIF device