Sunday 26 April 2020

Poor sound with Dell onboard Conexant CX20641 / HDA intel soundcard

Some Dell machines have a soundcard that is essentially wired up differently to how some software expects. This can be evident when using the line-out of the machine to go into speakers and finding that there is very poor bass output but can manifest itself in other soundcard jacks not behaving as expected. This is observed during enforced homeschooling on an old Dell Optiplex 390 running Fedora 32.

Verifying the soundcard is using a similar troublesome chipset:
$ dmesg | grep snd_hda_codec_conexant [ 19.026492] snd_hda_codec_conexant hdaudioC0D2: CX20641: BIOS auto-probing. $ lspci -v -d 8086:1c20 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04) DeviceName: Onboard Audio Subsystem: Dell Device 04f5 Flags: bus master, fast devsel, latency 0, IRQ 36 Memory at e4c30000 (64-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel
The solution is detailed on a gentoo forum post but it's certainly not obvious - it involves using a tool, hda-jack-retask to generate a runtime patch to reassign pins.
https://forums.gentoo.org/viewtopic-p-7475926.html#7475926 using hdajackretask the following re-assignments give proper 2 channel audio to the rear line out:
  Green Headphone, Front side   Headphone
  Pink Mic, Rear side           Line In
  Green Line Out, Rear side     Internal Speaker
  Blue Line In, Rear side       Internal Mic 
The following commands solved it for this Optiplex:
$ echo "options snd-hda-intel patch=hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw" > /etc/modprobe.d/hda-jack-retask.conf $ cat > /lib/firmware/hda-jack-retask.fw << EOF [codec] 0x14f150a1 0x102804f5 2 [pincfg] 0x18 0x40f001f0 0x19 0x0321403f 0x1a 0x02a19020 0x1b 0x0181304f 0x1c 0x90170150 0x1d 0x90a60160 0x1e 0x40f001f0 0x1f 0x40f001f0 0x20 0x40f001f0 0x21 0x40f001f0 0x26 0x40f001ff EOF
On the next boot, looking at the snd_hda driver messages we can see the following and line out is now working as expected.
$ dmesg | grep snd_hda [ 16.599294] snd_hda_intel 0000:00:1b.0: Applying patch firmware 'hda-jack-retask.fw' [ 16.610893] snd_hda_intel 0000:01:00.1: Disabling MSI [ 16.621360] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client [ 16.631347] snd_hda_intel 0000:01:00.1: Applying patch firmware 'hda-jack-retask.fw' [ 17.654795] snd_hda_codec_conexant hdaudioC1D2: CX20641: BIOS auto-probing. [ 17.661994] snd_hda_codec_conexant hdaudioC1D2: autoconfig for CX20641: line_outs=1 (0x1c/0x0/0x0/0x0/0x0) type:speaker [ 17.668660] snd_hda_codec_conexant hdaudioC1D2: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) [ 17.675134] snd_hda_codec_conexant hdaudioC1D2: hp_outs=1 (0x19/0x0/0x0/0x0/0x0) [ 17.681382] snd_hda_codec_conexant hdaudioC1D2: mono: mono_out=0x0 [ 17.687498] snd_hda_codec_conexant hdaudioC1D2: inputs: [ 17.693397] snd_hda_codec_conexant hdaudioC1D2: Front Mic=0x1a [ 17.699094] snd_hda_codec_conexant hdaudioC1D2: Internal Mic=0x1d [ 17.704658] snd_hda_codec_conexant hdaudioC1D2: Line=0x1b

1 comment:

Cole Zelznak said...

Thanks so much for making this guide -- drastically improved my audio quality on an Inspiron 660 (with Conexant CX20641) running Ubuntu 20.04 LTS.

Post a Comment