Audio on Dell TB16 not recognised with kernel 4.18

Hi,

I have a XPS 15 (9550) with a TB16 dock station.

With the kernel 4.18 (and 4.18.5) the audio ports of the TB16 are not longer available in pulseaudio. It is working correctly if I boot with kernel 4.17.14.
With kernel 4.18 if I try to access the card directly with:


aplay -D plughw:CARD=1,DEV=0 /usr/share/sounds/speech-dispatcher/test.wav

It works (although at 100% volume) so the problem seems related to how ALSA identify the device and not a problem of the driver.

Looking at the logs the main differences I found between kernel 4.17.14 and 4.18.5 are:

  • lspci:

In 4.17.14 the module shpchp is used while in 4.18 is not mentioned, but this looks like is because it is not longer a module.
The Nvidia card is now not correctly recognised:

4.17.14:
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
    Subsystem: Dell Device 06e4
        ...
4.18.5:
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev ff) (prog-if ff)
    !!! Unknown header type 7f

But I do not think this problem is related to the Nvidia card.

  • lsusb: No relevant changes (just the kernel number)
  • aplay -l:

Here is the main difference:

With 4.17.14 kernel
...
card 1: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

With 4.18.5:
card 1: Dock [WD15 Dock], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Dock [WD15 Dock], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So seems like instead of a generic USB audio now thinks the device is the WD15 (it has the same audio HW as the TB16, usbid 0bda:4014) but for some reason now the ALSA profile /usr/share/pulseaudio/alsa-mixer/profile-sets/dell-dock-tb16-usb-audio.conf is not used.

From this point I am lost, I do not know why ALSA decided to not apply this profile or why the name of the card is now “WD15 Dock” instead of “USB Audio”.

I have also the output of alsa-info.sh for each kernel, but the output is too big (and I cannot create attachments)
The parts I think are relevant are:
-4.17.14:


!!Soundcards recognised by ALSA
!!-----------------------------


 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xdd128000 irq 144
 1 [Audio          ]: USB-Audio - USB Audio
                      Generic USB Audio at usb-0000:0e:00.0-1.5, high speed
...


!!-------Mixer controls for card 1 [Audio]


Card hw:1 'Audio'/'Generic USB Audio at usb-0000:0e:00.0-1.5, high speed'
  Mixer name    : 'USB Mixer'
  Components    : 'USB0bda:4014'
  Controls      : 6
  Simple ctrls  : 2
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 127
  Front Left: Capture 87 [69%] [10.00dB] [on]
  Front Right: Capture 87 [69%] [10.00dB] [on]
Simple mixer control 'Loudness',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
...
state.Audio {
    control.1 {
        iface PCM
        name 'Capture Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.2 {
        iface PCM
        name 'Playback Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.3 {
        iface PCM
        device 1
        name 'Playback Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.4 {
        iface MIXER
        name 'Mic Capture Switch'
        value true
        comment {
            access 'read write'
            type BOOLEAN
            count 1
        }
    }
    control.5 {
        iface MIXER
        name 'Mic Capture Volume'
        value.0 87
        value.1 87
        comment {
            access 'read write'
            type INTEGER
            count 2
            range '0 - 127'
            dbmin -3350
            dbmax 3000
            dbvalue.0 1000
            dbvalue.1 1000
        }
    }
    control.6 {
        iface MIXER
        name Loudness
        value true
        comment {
            access 'read write'
            type BOOLEAN
            count 1
        }
    }
}



And Kernel 4.18:


!!Soundcards recognised by ALSA
!!-----------------------------


 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xdd128000 irq 144
 1 [Dock           ]: USB-Audio - WD15 Dock
                      Dell-WD15-Dock
...
!!-------Mixer controls for card 1 [Dock]


Card hw:1 'Dock'/'Dell-WD15-Dock'
  Mixer name    : 'USB Mixer'
  Components    : 'USB0bda:4014'
  Controls      : 7
  Simple ctrls  : 2
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 127
  Front Left: Capture 87 [69%] [10.00dB] [on]
  Front Right: Capture 87 [69%] [10.00dB] [on]
Simple mixer control 'Loudness',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
...
state.Dock {
    control.1 {
        iface PCM
        name 'Capture Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.2 {
        iface PCM
        name 'Playback Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.3 {
        iface PCM
        device 1
        name 'Playback Channel Map'
        value.0 0
        value.1 0
        comment {
            access read
            type INTEGER
            count 2
            range '0 - 36'
        }
    }
    control.4 {
        iface MIXER
        name 'Mic Capture Switch'
        value true
        comment {
            access 'read write'
            type BOOLEAN
            count 1
        }
    }
    control.5 {
        iface MIXER
        name 'Mic Capture Volume'
        value.0 87
        value.1 87
        comment {
            access 'read write'
            type INTEGER
            count 2
            range '0 - 127'
            dbmin -3350
            dbmax 3000
            dbvalue.0 1000
            dbvalue.1 1000
        }
    }
    control.6 {
        iface MIXER
        name Loudness
        value true
        comment {
            access 'read write'
            type BOOLEAN
            count 1
        }
    }
    control.7 {
        iface CARD
        name 'Keep Interface'
        value false
        comment {
            access 'read write'
            type BOOLEAN
            count 1
        }
    }
}



Thanks!

I have found a partial solution, valid until I manage to found the real reason.

The origin of the problem is the addition in 4.18 of a quirk for WD15/TB16: For some reason this quirk makes the card not properly recognised by pulseaudio and in the system log there are some lines like:


[pulseaudio] module-alsa-card.c: Failed to find a working profile.
[pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="usb-Generic_USB_Audio_200901010001-00" card_name="alsa_card.usb-Generic_USB_Audio_200901010001-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.

It is not necessary to revert the full patch, compiling my own snd-usb-audio.ko commenting out the line 3385 of quirk-table.h:


/* Dell WD15 Dock */
{
    USB_DEVICE(0x0bda, 0x4014),
    .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
        .vendor_name = "Dell",
        .product_name = "WD15 Dock",
/*        .profile_name = "Dell-WD15-Dock",*/
        .ifnum = QUIRK_NO_INTERFACE
    }
},

is enough to have again the audio device recognised by pulseaudio.

The strange aspect is that this profile_name is only used to overwrite the cards long name, so it seems like it shall not have this impact.

I try to report the issue upstream to see if I manage to find a better solution.