No Sound through docking station headphone jack

nickednamed

Active Member

Reaction score: 30
Messages: 186

Hi all.

I have a laptop (Lenovo X220) plugged into a docking station and I would like to have sound played through the speakers which are plugged into the headphone port at the back of the docking station. At the moment, when I plug my speakers into the dock, I get nothing.

Generally the sound works well (as do all other functions of the dock). When my laptop is not in the dock, sound plays normally through the laptop speakers, and when I plug the speakers into the laptop (not dock) it plays normally through the speakers, over HDMI, etc...

But when the laptop is in the dock, I can use only either the built-in laptop speakers or my external speakers (if plugged into the headphone port on the laptop).

I'd really like to just plug my speakers into the dock, and not have to keep messing around with the cables.

Can anyone point me in the right direction?

When I plug the speakers into the laptop headphone port:
dmesg
Code:
hdaa0: Pin sense: nid=25 sense=0xffffffff (connected)
pcm0: Redirect output to: headphones
pcm0: Playback channel set is: Front Left, Front Right,
pcm0: Playback channel matrix is: 2.0 (connected)
When I plug into the headphones port at the back of the dock:
dmesg
Code:
pcm0: Redirect output to: main
pcm0: Playback channel set is: Front Left, Front Right,
pcm0: Playback channel matrix is: 2.0 (unknown)
sysctl dev.hdac.0.pindump=1 && dmesg
Code:
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 25 0421101f 1  15 Headphones    Jack  1/8     Right      Black   0
hdaa0:     Caps:    OUT HP           Sense: 0xffffffff (connected)
hdaa0: 26 61a19050 5  0  Mic           None  1/8     Ext-Rear   Pink    0 DISA
hdaa0:     Caps: IN             VREF Sense: 0x7fffffff (disconnected)
hdaa0: 27 04a1102f 2  15 Mic           Jack  1/8     Right      Black   0
hdaa0:     Caps: IN OUT    EAPD VREF Sense: 0x7fffffff (disconnected)
hdaa0: 28 6121401f 1  15 Headphones    None  1/8     Ext-Rear   Green   0 DISA
hdaa0:     Caps:    OUT              Sense: 0x7fffffff (disconnected)
hdaa0: 29 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0:     Caps: IN OUT    EAPD      Sense: 0xffffffff (connected)
hdaa0: 30 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0:     Caps: IN                  Sense: 0xffffffff (connected)
hdaa0: 31 90170110 1  0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa0:     Caps:    OUT             
hdaa0: 32 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0:     Caps:    OUT             
hdaa0: 34 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0:     Caps:    OUT             
hdaa0: 35 90a60120 2  0  Mic           Fixed Digital Internal   Unknown 1
hdaa0:     Caps: IN                 
hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled
hdaa0:  GPIO3: disabled
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1:  5 18560010 1  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x40000000 (disconnected, ELD valid)
hdaa1:  6 18560020 2  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x40000000 (disconnected, ELD valid)
hdaa1:  7 18560030 3  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x40000000 (disconnected, ELD valid)
hdaa1: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0

cat /dev/sndstat
Code:
Installed devices:
pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) default
pcm1: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm2: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm3: <Intel Cougar Point (HDMI/DP 8ch)> (play)
No devices installed from userspace.
ls /dev/dsp*
Code:
/dev/dsp0.0
 

aragats

Daemon

Reaction score: 470
Messages: 1,131

Have you tried changing the default unit?
Code:
sysctl hw.snd.default_unit
E.g. I have 4 of them in my T430.
 
OP
OP
N

nickednamed

Active Member

Reaction score: 30
Messages: 186

To be honest, I haven't tried since updating to FreeBSD 11-RELEASE.

I tried with FreeBSD 10.3 but it didn't make any difference. I'm not at home now, so I'll try when I get back and update this thread.

EDIT:

The command sysctl hw.snd.default_unit=X doesn't work (with or without acpi_dock() loaded).

I'm guessing the dock headphone jack is not one of the following devices:
cat /dev/sndstat
Code:
Installed devices:
pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) default
pcm1: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm2: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm3: <Intel Cougar Point (HDMI/DP 8ch)> (play)
Plugging and unplugging the speakers seems to make no difference. There is no change in dmesg, for example.
 

akripo

Member

Reaction score: 8
Messages: 22

Same issue here with no sound from the docking station port, no matter what sysctl tunables I tried..

Laptop: Lenovo Thinkpad T410
Docking station: Lenovo Mini Dock Plus Series 3 (4338-10U)
OS: FreeBSD 12.0-CURRENT #3 r333874

Edit: Furthermore, the docking station does not work with the acpi_dock kernel module at all, e.g. none acpi event it is generated while docking / undocking laptop to it...
 

shepper

Aspiring Daemon

Reaction score: 263
Messages: 771

FreeBSD groups the pins (nid's in the pindump above) into associations (as=). Associations are either input or output - not both. PIns are assigned by interrogation during boot and usually grouped by location. Unless specified, pcm0 is the default and likely includes your laptop speaker jack (side location). The dock connections are likely in a different pcm assignment (back location). You can check by comparing the pin dumps between booting w/o dock vs booting w/ dock.

I suspect the above pin dump is w/o dock as a group of pins are disconnected.
 

Trihexagonal

Daemon

Reaction score: 835
Messages: 1,446

I don't dock my Thinkpads anymore.

The first T61 I acquired was in pristine condition. I loved that laptop... I had it docked compiling ports and unplugged the USB mouse from the docking station since it would not be needed for a while and I wanted to use it. When I unplugged it the screen froze. I waited patiently till it became appartent it wasn't going to pick back up and the only way I could reboot it was to do a hard shutdown by holding in the power button till it reset.

Bye bye, laptop. It went to Heaven before my eyes and there might have been tears in them when it did.
 

Partmedia

New Member

Reaction score: 1
Messages: 1

I've also had this issue with a ThinkPad T420 and a Mini-Dock 2 for several years. I finally fixed it, making the docking station port show up as an additional device:
Code:
$ cat /dev/sndstat
Installed devices:
pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) default
pcm1: <Conexant CX20590 (Ext-Rear Analog)> (play/rec)
I've only tried on T420, and you probably have to tweak this for your ThinkPad. In /boot/device.hints, add:

Code:
hint.hdaa.0.nid28.config="as=3 conn=Jack"
hint.hdaa.0.nid26.config="as=4 conn=Jack"
A brief intro to Intel High-Definition Audio (HDA), and in particular how snd_hda(4) implements it:

  • A chip (the audio codec) sits between the audio bus and your audio pins (headphone jacks, speakers, etc.)
  • The pins are exposed to the codec as widgets, each with its own nid. (Not all widgets are pins, because there are also hardware mixers, muxes, volume controls, etc.)
  • Pins are grouped with an association number (as). Each as must have all input devices, or all output devices. When as=0, it is disabled, and when as=15, it is unassociated.
  • Pins that have a connection type (conn) set to None will also be disabled. The other important types are Jack (thing you can plug something into) and Fixed (for a built-in laptop speaker that you cannot remove).
  • Every pair of enabled input/output as' become a pcm device that shows up in /dev/sndstat.
The problem is that the conn for the docking station ports are set to none by default, so they do not show up. After setting the conn, you still might need to set the as to something other than the default to get an audio device for it. Briefly:

  1. Identify the nids for your pins. Use sysctl dev.hdaa.0.
  2. Set their conn to Jack. You can test your new setting with sysctl dev.hda.0.nidXX_config="conn=Jack" before editing device.hints.
  3. Find two free as to give to the dock. If they already have unique as, you don't need to do this.
  4. Ask the driver to reload the configuration with sysctl dev.hdaa.0.reconfig=1.
Note that for many machines (not just ThinkPads), the defaults will already have been patched over. For a complete list of kernel sound patches, see /usr/src/sys/dev/sound/pci/hda/hdaa_patches.c. You cannot override the configuration with the sysctl if a particular nid has been patched.

Also, on the T420, there seem to be some extra hardware shenanigans that seem to disable builtin speaker output when something is plugged into either the right jack or the dock port. This interacts with the automatic jack presence detection (PDC) that switch between the internal speaker and the right jack in an interesting way. I've found that making the dock show up as an extra pcm device made it act in the least surprising way.

No, you cannot make the internal, right jack, and dock jack three separate pcm devices, because the codec only supports two independent audio outputs (DACs from the bus to the codec interconnect). On the bright side, there is a hardware output monitor (records what's going to the speakers), only I can't figure out how to get snd_hda(4) to treat it as such (it disables everything not connected to an I/O pin).
 
Top