# snd_hda: How to get sound on headphones and speakers at the same time?



## nileshgr (Jul 9, 2013)

Hi,

I have a sound card in my desktop compatible with snd_hda. After reading around, I got headphones working -- It will play via headphone if there is one connected, or go via speaker.

I have a rather weird need -- I want sound on both at the same time, i.e. speaker should not auto mute if I connect headphone.

Here's my pin dump -


```
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 20 01014410 1  0  Line-out      Jack  1/8     Rear       Green   4
hdaa0:     Caps: IN OUT HP           Sense: 0x80000000 (connected)
hdaa0: 21 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 22 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 24 01a19c40 4  0  Mic           Jack  1/8     Rear       Pink    12
hdaa0:     Caps: IN OUT HP      VREF Sense: 0x00000000 (disconnected)
hdaa0: 25 02a19c50 5  0  Mic           Jack  1/8     Front      Pink    12
hdaa0:     Caps: IN OUT HP      VREF Sense: 0x80000000 (connected)
hdaa0: 26 01813c4f 4  15 Line-in       Jack  1/8     Rear       Blue    12
hdaa0:     Caps: IN OUT HP      VREF Sense: 0x80000000 (connected)
hdaa0: 27 02214c1f 1  15 Headphones    Jack  1/8     Front      Green   12
hdaa0:     Caps: IN OUT HP      VREF Sense: 0x80000000 (connected)
hdaa0: 28 593301f0 15 0  CD            None  ATAPI   Onboard    Unknown 1 DISA
hdaa0:     Caps: IN                 
hdaa0: 30 014b6130 3  0  SPDIF-out     Jack  Combo   Rear       Orange  1
hdaa0:     Caps:    OUT             
hdaa0: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN                 
hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
```

And the relevant line in /boot/device.hints


```
hint.hdaa.0.nid27.config="as=1 seq=15"
```

On reading the manual, I found that sequence 15 for device headphone has the special feature of auto muting other one when headphone is connected. I tried setting another sequence, but it didn't work - either I got sound via speakers only or no sound anywhere.

How to fix this?


----------



## mav@ (Jul 15, 2013)

Using another sequence number you will just get quadro (4.0) playback. But there is an undocumented bug/feature in the driver: if auto-redirection is configured, but the headphones pin has misc=1 (no presence detection), sound should go both ways simultaneously.


----------



## nileshgr (Jul 16, 2013)

mav@ said:
			
		

> Using another sequence number you will just get quadro (4.0) playback. But there is an undocumented bug/feature in the driver: if auto-redirection is configured, but the headphones pin has misc=1 (no presence detection), sound should go both ways simultaneously.



So that means I add this to device.hints?


```
hint.hdaa.0.nid27.config="as=1 seq=15 misc=1"
```

instead of what I posted earlier?

I did try a variant of this, because I found it in the man page -


```
misc     Misc bits.  Can be specified as a number from 0 to 15.
                    Bit 0 has a special meaning.  When set it means that jack
                    detection is not implemented in hardware.
```

Pin dump says the current value of misc is 12, that means bit 0 is already set, no? Because 12 = 1100 in binary?


----------



## mav@ (Jul 16, 2013)

nileshgr said:
			
		

> So that means I add this to device.hints?
> 
> 
> ```
> ...


Yes.



			
				nileshgr said:
			
		

> Pin dump says the current value of misc is 12, that means bit 0 is already set, no? Because 12 = 1100 in binary?



12 is even number. It means that bit 0 is cleared there. Whether to use 1 or 13 is irrelevant, since other bits are not standardized and ignored by the driver,


----------



## nileshgr (Jul 17, 2013)

mav@ said:
			
		

> Yes.
> 
> 
> 
> 12 is even number. It means that bit 0 is cleared there. Whether to use 1 or 13 is irrelevant, since other bits are not standardized and ignored by the driver,



Right! It works now. I applied the binary thing the wrong way  I should have read it from the RHS. Thanks a lot!


----------

