Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] No sound on HP Spectre x360 13-aw2022ur (2020, Tiger Lake) #2700

Closed
aigilea opened this issue Jan 18, 2021 · 167 comments
Closed

[BUG] No sound on HP Spectre x360 13-aw2022ur (2020, Tiger Lake) #2700

aigilea opened this issue Jan 18, 2021 · 167 comments
Labels
BIOS Related to BIOS bug Something isn't working fix submitted Fix submitted but not merged yet P3 Low-impact bugs or features SDW Applies to SoundWire bus for codec connection TGL Applies to Tiger Lake platform

Comments

@aigilea
Copy link

aigilea commented Jan 18, 2021

Describe the bug
Both legacy driver and SOF driver only create devices for HDMI outputs, no speakers or headphones (or microphones). I've tried 5.8, 5.10 and 5.11 kernels with the latest 1.6.1 SOF distribution, the only difference is wording changed from dmic-related to soundwire-related around SOF initialization in dmesg.
PulseAudio refuses to init the card when SOF driver is enabled, playing sounds to /dev/snd/pcm* devices doesn't result in any output to speakers or headphones.
Laptop has the latest firmware (F.10 Rev.A) and there's no problem with sound in Windows obviously.
I'm running ubuntu, but according to the forum thread it's the same on Arch with the 13-aw2777ng laptop (it's basically the same hardware).

There's a wiki page on a similar 14-inch laptop describing some gpio trickery to enable the amplifier, but it assumes a functional pulseaudio with created sinks and so on. I've done that anyway to no avail -- pulseaudio still refuses to init and no sound is produced when playing to pcm devices.

lspci -v excerpt

0000:00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)
	Subsystem: Hewlett-Packard Company Tiger Lake-LP Smart Sound Technology Audio Controller
	Flags: bus master, fast devsel, latency 32, IRQ 195, IOMMU group 15
	Memory at 603f290000 (64-bit, non-prefetchable) [size=16K]
	Memory at 603f000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: [50] Power Management version 3
	Capabilities: [80] Vendor Specific Information: Len=14 <?>
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Kernel driver in use: sof-audio-pci
	Kernel modules: snd_hda_intel, snd_sof_pci

dmesg|egrep -i "(dsp|sof|snd)"

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.11.0-051100rc4-generic root=UUID=e74551eb-f911-4604-bf2e-48b2e3948180 ro quiet splash snd-intel-dspcfg.dsp_driver=0 vt.handoff=7
[    0.039932] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.11.0-051100rc4-generic root=UUID=e74551eb-f911-4604-bf2e-48b2e3948180 ro quiet splash snd-intel-dspcfg.dsp_driver=0 vt.handoff=7
[    0.640855] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.783036] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.783037] software IO TLB: mapped [mem 0x0000000047b2a000-0x000000004bb2a000] (64MB)
[    2.866672] integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
[    2.866684] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    4.454718] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.454740] snd_hda_intel 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[    4.468308] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.468321] sof-audio-pci 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[    4.468329] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.468498] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    6.216824] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    6.308478] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    6.323471] sof-audio-pci 0000:00:1f.3: No SoundWire machine driver found
[    6.323474] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 4
[    6.323476] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    6.323481] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    6.423642] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:6:1-53680
[    6.423645] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:17:0 Kernel ABI 3:18:0
[    6.429420] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:17:0 Kernel ABI 3:18:0
[    6.436996] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[    6.448089] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
[    6.448091] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4
[    6.448092] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5
[    6.448093] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 6
[    6.448094] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 7
[    6.448095] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 8
[    6.463302] input: sof-hda-dsp HDMI/DP,pcm=1 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input27
[    6.463415] input: sof-hda-dsp HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input28
[    6.463505] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input29

There's ABI mismatch currently but I don't know where to get ABI3:18 SOF and the problem was the same with matching ABIs for both fw and topology.

ls -la /dev/snd/

total 0
drwxr-xr-x   3 root root      240 янв 18 21:43 .
drwxr-xr-x  19 root root     4820 янв 18 21:43 ..
drwxr-xr-x   2 root root       60 янв 18 21:43 by-path
crw-rw----+  1 root audio 116,  8 янв 18 21:43 controlC0
crw-rw----+  1 root audio 116,  7 янв 18 21:43 hwC0D2
crw-rw----+  1 root audio 116,  4 янв 18 21:43 pcmC0D1p
crw-rw----+  1 root audio 116,  5 янв 18 21:43 pcmC0D2p
crw-rw----+  1 root audio 116,  6 янв 18 21:48 pcmC0D3p
crw-rw----+  1 root audio 116,  2 янв 18 21:43 pcmC0D6c
crw-rw----+  1 root audio 116,  3 янв 18 21:43 pcmC0D7c
crw-rw----+  1 root audio 116,  1 янв 18 21:43 seq
crw-rw----+  1 root audio 116, 33 янв 18 21:43 timer

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 1: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 2: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

uname -a

Linux x360 5.11.0-051100rc4-generic #202101180234 SMP Mon Jan 18 02:36:59 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

pulseaudio -v (pulseaudio daemon is stopped. I've tried to delete pulseaudio config with the same result)

I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 13.99.2
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is 8e166aaa463244aa82c417113114655e.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/test/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-13.99.2/modules.
I: [pulseaudio] main.c: Running in system mode: no
I: [pulseaudio] main.c: System supports high resolution timers
I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 
I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions.
I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers.
I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions.
I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers.
I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions.
I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions.
I: [pulseaudio] module-device-restore.c: Successfully opened database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-device-volumes'.
I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: "").
I: [pulseaudio] module-stream-restore.c: Successfully opened database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-stream-volumes'.
I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: thesofproject/sof#1; argument: "").
I: [pulseaudio] module-card-restore.c: Successfully opened database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-card-database'.
I: [pulseaudio] module.c: Loaded "module-card-restore" (index: thesofproject/sof#2; argument: "").
I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: thesofproject/sof#3; argument: "").
I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: thesofproject/sof#4; argument: "").
I: [pulseaudio] module.c: Loaded "module-switch-on-connect" (index: thesofproject/sof#5; argument: "").
I: [pulseaudio] alsa-ucm.c: UCM available for card hw:0
I: [pulseaudio] alsa-ucm.c: Set UCM verb to HiFi
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device HDMI1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic2, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Speaker, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Headphones, assuming stereo.
I: [pulseaudio] module-alsa-card.c: Found UCM profiles
I: [pulseaudio] alsa-ucm.c: Set ucm verb to HiFi
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,3 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:sofhdadsp: No such file or directory
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0 (alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic) failed to load module.
I: [pulseaudio] module-udev-detect.c: Found 1 cards.
I: [pulseaudio] module.c: Loaded "module-udev-detect" (index: thesofproject/sof#6; argument: "").
I: [pulseaudio] module.c: Loaded "module-bluetooth-policy" (index: thesofproject/sof#8; argument: "").
I: [pulseaudio] module.c: Loaded "module-bluez5-discover" (index: thesofproject/sof#10; argument: "").
I: [pulseaudio] module.c: Loaded "module-bluetooth-discover" (index: thesofproject/sof#9; argument: "").
I: [pulseaudio] module.c: Loaded "module-native-protocol-unix" (index: thesofproject/sof#11; argument: "").
I: [pulseaudio] module-default-device-restore.c: Restoring default sink 'auto_null'.
I: [pulseaudio] core.c: configured_default_sink: (unset) -> auto_null
I: [pulseaudio] module-default-device-restore.c: No previous default source setting, ignoring.
I: [pulseaudio] module.c: Loaded "module-default-device-restore" (index: thesofproject/sof#12; argument: "").
I: [pulseaudio] module-device-restore.c: Restoring volume for sink auto_null: front-left: 65536 / 100%,   front-right: 65536 / 100%
I: [pulseaudio] module-device-restore.c: Restoring mute state for sink auto_null: unmuted
I: [pulseaudio] sink.c: Created sink 0 "auto_null" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] sink.c:     device.description = "Dummy Output"
I: [pulseaudio] sink.c:     device.class = "abstract"
I: [pulseaudio] sink.c:     device.icon_name = "audio-card"
I: [pulseaudio] source.c: Created source 0 "auto_null.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c:     device.description = "Monitor of Dummy Output"
I: [pulseaudio] source.c:     device.class = "monitor"
I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
I: [null-sink] util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
I: [pulseaudio] core.c: default_source: (unset) -> auto_null.monitor
I: [pulseaudio] core.c: default_sink: (unset) -> auto_null
I: [pulseaudio] module.c: Loaded "module-null-sink" (index: thesofproject/sof#14; argument: "sink_name=auto_null sink_properties='device.description="Dummy Output"'").
I: [pulseaudio] module.c: Loaded "module-always-sink" (index: thesofproject/sof#13; argument: "").
I: [pulseaudio] module.c: Loaded "module-intended-roles" (index: thesofproject/sof#15; argument: "").
I: [pulseaudio] module.c: Loaded "module-suspend-on-idle" (index: thesofproject/sof#16; argument: "").
I: [pulseaudio] module.c: Loaded "module-console-kit" (index: thesofproject/sof#17; argument: "").
I: [pulseaudio] client.c: Created 0 "Login Session 2"
I: [pulseaudio] core.c: exit_idle_time: 20 -> 0
I: [pulseaudio] module.c: Loaded "module-systemd-login" (index: thesofproject/sof#18; argument: "").
I: [pulseaudio] module.c: Loaded "module-position-event-sounds" (index: thesofproject/sof#19; argument: "").
I: [pulseaudio] module.c: Loaded "module-role-cork" (index: thesofproject/sof#20; argument: "").
I: [snapd-glib] module-snap-policy.c: Starting GLib main loop
I: [pulseaudio] module.c: Loaded "module-snap-policy" (index: thesofproject/sof#21; argument: "").
I: [pulseaudio] module.c: Loaded "module-filter-heuristics" (index: thesofproject/sof#22; argument: "").
I: [pulseaudio] module.c: Loaded "module-filter-apply" (index: thesofproject/sof#23; argument: "").
I: [pulseaudio] main.c: Daemon startup complete.
I: [pulseaudio] alsa-ucm.c: UCM available for card hw:0
I: [pulseaudio] alsa-ucm.c: Set UCM verb to HiFi
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device HDMI1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic2, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Speaker, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Headphones, assuming stereo.
I: [pulseaudio] module-alsa-card.c: Found UCM profiles
I: [pulseaudio] alsa-ucm.c: Set ucm verb to HiFi
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,3 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:sofhdadsp: No such file or directory
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
(and that error repeats multiple times)

sof-logger -l ../../lib/firmware/intel/sof/v1.6.1/sof-tgl-v1.6.1.ldc (I guess this is expected)

         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
error: in logger_read(), fread(..., /sys/kernel/debug/sof/etrace) failed: Operation not permitted(-1)

fuser -v /dev/snd/* gives empty result. pactl list cards gives empty result as well when pulseaudio is running.

Can you please fix that or point me in the right direction if you think problem is elsewhere?

Update 19.01.2021
There were some UCM-related improvements in pulseaudio 14.x, so I've built it from the git to no avail.
pulseaudio -v (config files are removed)

I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 14.2
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is 8e166aaa463244aa82c417113114655e.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/test/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/local/lib/x86_64-linux-gnu/pulse-14.2/modules.
I: [pulseaudio] main.c: Running in system mode: no
I: [pulseaudio] main.c: System supports high resolution timers
I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 
I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions.
I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers.
I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions.
I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers.
I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions.
I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions.
I: [pulseaudio] database.c: Successfully opened 'device-volumes' database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-device-volumes.tdb'.
I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: "").
I: [pulseaudio] database.c: Successfully opened 'stream-volumes' database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-stream-volumes.tdb'.
I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: "").
I: [pulseaudio] database.c: Successfully opened 'card-database' database file '/home/test/.config/pulse/8e166aaa463244aa82c417113114655e-card-database.tdb'.
I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: "").
I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: "").
I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: "").
I: [pulseaudio] alsa-ucm.c: UCM available for card hw:0
I: [pulseaudio] alsa-ucm.c: Set UCM verb to HiFi
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device HDMI1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic2, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic1, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Speaker, assuming stereo.
I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device Headphones, assuming stereo.
I: [pulseaudio] module-alsa-card.c: Found UCM profiles
I: [pulseaudio] alsa-ucm.c: Set ucm verb to HiFi
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,3 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:sofhdadsp: No such file or directory
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0 (alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic) failed to load module.
I: [pulseaudio] module-udev-detect.c: Found 1 cards.
(the same error repeats a few times)

I've also tried it with the latest userspace alsa lib, tools, fw and UCM, the only difference is the missing pcm name in the log

I: [pulseaudio.off] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC0D5p' failed (-2)
I: [pulseaudio.off] alsa-util.c: Error opening PCM device hw:sofhdadsp,5: No such file or directory
@lgirdwood lgirdwood transferred this issue from thesofproject/sof Jan 18, 2021
@hirnschmalz
Copy link

I can confirm this, same issue here on my HP Spectre x360 13-aw2777ng

@juimonen
Copy link

@bardliao @libinyang this seems to be soundwire device... any idea why we don't have pcm devices?

@bardliao
Copy link
Collaborator

sof-audio-pci 0000:00:1f.3: No SoundWire machine driver found

The issue is that SOF driver can't find a suitable machine driver for this device. The driver will look up eg. snd_soc_acpi_intel_cml_sdw_machines[] to find a suitable machine driver.
So we have to add your device codec information to the corresponding acpi match table.
Please add below to /etc/modprobe.d/sof-dyndbg.conf and attach the whole dmesg output here. Create one if you don't have this file on your device.

options soundwire_bus dyndbg=+p
options soundwire_intel dyndbg=+p

And, please show me the result of lspci | grep '00:1f.3'

Thanks

@aigilea
Copy link
Author

aigilea commented Jan 19, 2021

Attaching full dmesg with dyndbg.

lspci | grep '00:1f.3'

0000:00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

@hirnschmalz
Copy link

Here's my output of lspci | grep '00:1f.3'

0000:00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

and my dmesg.

@bardliao
Copy link
Collaborator

Attaching full dmesg with dyndbg.

[    6.339077] soundwire sdw-master-0: Slave attached, programming device number
[    6.339280] soundwire sdw-master-0: SDW Slave Addr: 20025d071100
[    6.339281] soundwire sdw-master-0: SDW Slave class_id 0, part_id 711, mfg_id 25d, unique_id 0, version 2
[    6.339306] soundwire sdw-master-0: Slave Entry not found
[    6.339504] soundwire sdw-master-0: SDW Slave Addr: 20025d071100
[    6.339506] soundwire sdw-master-0: SDW Slave class_id 0, part_id 711, mfg_id 25d, unique_id 0, version 2
[    6.339583] soundwire sdw-master-1: Slave attached, programming device number
[    6.339795] soundwire sdw-master-0: No more devices to enumerate
[    6.339800] soundwire sdw-master-1: SDW Slave Addr: 20025d130800
[    6.339806] soundwire sdw-master-1: SDW Slave class_id 0, part_id 1308, mfg_id 25d, unique_id 0, version 2
[    6.339850] soundwire sdw-master-1: Slave Entry not found

From above, the codecs on your device is rt711 and rt1308.
But from below, your codec's information is not listed in the acpi table.

[    6.231331] soundwire sdw-master-0: SDW Slave Addr: 10025d070100
[    6.231334] soundwire sdw-master-0: SDW Slave class_id 0, part_id 701, mfg_id 25d, unique_id 0, version 1
[    6.231350] soundwire sdw-master-0: SDW Slave Addr: 10025d070000
[    6.231352] soundwire sdw-master-0: SDW Slave class_id 0, part_id 700, mfg_id 25d, unique_id 0, version 1
[    6.231401] soundwire sdw-master-0: SDW Slave Addr: 10025d070000
[    6.231402] soundwire sdw-master-0: SDW Slave class_id 0, part_id 700, mfg_id 25d, unique_id 0, version 1
[    6.231405] soundwire sdw-master-0: SDW Slave Addr: 10025d070100
[    6.231407] soundwire sdw-master-0: SDW Slave class_id 0, part_id 701, mfg_id 25d, unique_id 0, version 1
[    6.231507] soundwire sdw-master-1: SDW Slave Addr: 110025d070100
[    6.231508] soundwire sdw-master-1: SDW Slave class_id 0, part_id 701, mfg_id 25d, unique_id 0, version 1
[    6.231518] soundwire sdw-master-1: SDW Slave Addr: 110025d070000
[    6.231520] soundwire sdw-master-1: SDW Slave class_id 0, part_id 700, mfg_id 25d, unique_id 0, version 1
[    6.231575] soundwire sdw-master-1: SDW Slave Addr: 110025d070000
[    6.231577] soundwire sdw-master-1: SDW Slave class_id 0, part_id 700, mfg_id 25d, unique_id 0, version 1
[    6.231585] soundwire sdw-master-1: SDW Slave Addr: 110025d070100
[    6.231587] soundwire sdw-master-1: SDW Slave class_id 0, part_id 701, mfg_id 25d, unique_id 0, version 1

So, we have to add the codec information to BIOS at first. We need to figure out who can help on it. @mengdonglin

lspci | grep '00:1f.3'

0000:00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

It is a TGL device and the match table is snd_soc_acpi_intel_tgl_sdw_machines[].
Looking at the table, we don't have a matched table for your device (rt711 on link 0 and 1 rt1308 on link 1), but fortunately, we have a similar configuration tgl_rvp. We should be able to enable SoundWire on your device with slight modification.
Below patch may help, but I have no chance to test it.

diff --git a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
index e3ddbf05bf72..529f40868ae9 100644
--- a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
@@ -205,6 +205,20 @@ static const struct snd_soc_acpi_link_adr tgl_rvp[] = {
        {}
 };

+static const struct snd_soc_acpi_link_adr tgl_rt711_rt1308[] = {
+       {
+               .mask = BIT(0),
+               .num_adr = ARRAY_SIZE(rt711_0_adr),
+               .adr_d = rt711_0_adr,
+       },
+       {
+               .mask = BIT(1),
+               .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
+               .adr_d = rt1308_1_single_adr,
+       },
+       {}
+};
+
 static const struct snd_soc_acpi_link_adr tgl_chromebook_base[] = {
        {
                .mask = BIT(0),
@@ -401,6 +415,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
                .drv_name = "sof_sdw",
                .sof_tplg_filename = "sof-tgl-rt5682.tplg",
        },
+       {
+               .link_mask = 0x3, /* rt711 on link 0 and 1 rt1308s on link 1 */
+               .links = tgl_rt711_rt1308,
+               .drv_name = "sof_sdw",
+               .sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg",
+       },
        {},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_sdw_machines);

But, again, you have to fix the BIOS issue first. Alternative way is to add acpi table by yourself.
You can follow the guide to add additional acpi table.
A reference asl file is rtk_sdw_i2c.asl.
You don't need the I2C part. What you need is to add rt711 and rt1308 address into Scope (_SB.PC00.HDAS.SNDW)

Scope (_SB.PC00.HDAS.SNDW) {
	Device (RTK0) // RT711 on link0
        {
            Name (_ADR, 0x000020025D071100)  // _ADR: Address
        }
	Device (RTK1) // RT1308 on link1
        {
            Name (_ADR, 0x000120025D130800)  // _ADR: Address
        }
  

@aigilea
Copy link
Author

aigilea commented Jan 19, 2021

There's some progress.
Now it looks better in dmesg, SOF initializes without errors, but the result is even stranger:
ls /dev/snd

seq  timer

I'm attaching the new dmesg and just in case dsdt.

upd.
I've re-checked if maybe I've somehow messed the particular kernel build up, but no, removing just the acpi patch turns everything back to errors in dmesg and a few files in /dev/snd with the same patched kernel.

@plbossart
Copy link
Member

@aigilea thanks for testing. Can you try to add dynamic debug to sof_sdw ? when the probe remains silent, it's usually that the machine driver probe fails, and unfortunately we have no way to report this at a higher level.

@plbossart
Copy link
Member

@bardliao I am wondering if we shouldn't add a hack where we use the adr for 701 for either RT711 or RT1308. The BIOS is broken, and if we don't get a fix we should have an indirection to the 'right' devices.

@aigilea
Copy link
Author

aigilea commented Jan 19, 2021

@plbossart I've tried enabling dyndbg for sof_sdw.c, sof_sdw and sof_sdw* (but forgot to save that dmesg, I can redo this one if it may be useful). I haven't found any new information in dmesgs.
I've enabled dyndbg via kernel options, this morning it worked that way with atkdb.c so I guess it's ok. If it's not, I can redo any other way.

plbossart added a commit to plbossart/sound that referenced this issue Jan 19, 2021
On some HP devices, the BIOS does not advertise the presence of RT711
on link0 and RT1308 on link1. This has been a known issue on reference
platforms, but this problem was not expected to spill into commercial
devices.

Unfortunately the BIOS remained broken and we can't reasonably expect
every Linux user to override the DSDT.

This patch suggests the use of a workaround. Broken BIOS expose the
part 0x701 on all links, which does not correspond to a real device or
configurations. We can however use this information to make existing
codec drivers can probe on this device instead.

BugLink: thesofproject#2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member

@aigilea to be honest none of us on the Intel Linux team knew of the existence of HP devices with SoundWire, but that's indeed a real product. We can't expect everyone to override the DSDT, that's too invasive.

if you have spare cycles, can you try #2701 without the DSDT override? It should at least find the right devices but may fail later on.

I still need to confirm if there are one or two amplifiers on the link1, in the first case we are missing a topology configuration for mono amplifier.

plbossart added a commit to plbossart/sound that referenced this issue Jan 19, 2021
On some HP devices, the BIOS does not advertise the presence of RT711
on link0 and RT1308 on link1. This has been a known issue on reference
platforms, but this problem was not expected to spill into commercial
devices.

Unfortunately the BIOS remained broken and we can't reasonably expect
every Linux user to override the DSDT.

This patch suggests the use of a workaround. Broken BIOS expose the
part 0x701 on all links, which does not correspond to a real device or
configurations. We can however use this information to make existing
codec drivers probe on this device instead.

BugLink: thesofproject#2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member

I've enabled dyndbg via kernel options, this morning it worked that way with atkdb.c so I guess it's ok. If it's not, I can redo any other way.

You can enable dynamic debug by copying this file
ddebug.txt as /etc/modprobe.d/sof-dyndbg.conf (reboot required after adding the file)/

@aigilea
Copy link
Author

aigilea commented Jan 19, 2021

@plbossart should I keep the bardliao's patch to soc-acpi-intel-tgl-match.c when applying your commit?

@plbossart
Copy link
Member

@plbossart should I keep the bardliao's patch to soc-acpi-intel-tgl-match.c when applying your commit?

no, you'd need to add this on top of your kernel without Bard's change. This is a proof of concept, so bear with me if there are some issues left and right. Only trying to make sure it's easier in the end for all users of this platform.

plbossart added a commit to plbossart/sound that referenced this issue Jan 19, 2021
On some HP devices, the BIOS does not advertise the presence of RT711
on link0 and RT1308 on link1. This has been a known issue on reference
platforms, but this problem was not expected to spill into commercial
devices.

Unfortunately the BIOS remained broken and we can't reasonably expect
every Linux user to override the DSDT.

This patch suggests the use of a workaround. Broken BIOS expose the
part 0x701 on all links, which does not correspond to a real device or
configurations. We can however use this information to make existing
codec drivers probe on this device instead.

BugLink: thesofproject#2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
plbossart added a commit to plbossart/sound that referenced this issue Jan 19, 2021
On some HP devices, the BIOS does not advertise the presence of RT711
on link0 and RT1308 on link1. This has been a known issue on reference
platforms, but this problem was not expected to spill into commercial
devices.

Unfortunately the BIOS remained broken and we can't reasonably expect
every Linux user to override the DSDT.

This patch suggests the use of a workaround. Broken BIOS expose the
part 0x701 on all links, which does not correspond to a real device or
configurations. We can however use this information to make existing
codec drivers probe on this device instead.

BugLink: thesofproject#2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@aigilea
Copy link
Author

aigilea commented Jan 19, 2021

@plbossart I've bumped into build problems with dev_dbg calls and fixed them before I've seen you've updated the patch. I now see another difference in the latest patch with entry ordering in snd_soc_acpi_intel_tgl_sdw_machines, but it shouldn't affect me, right?

Anyway, it doesn't work out of the box, but it shows more information.
Here the dmesg with the first ACPI patch and your dyndbg config, here's the dmesg with your patch.

@plbossart
Copy link
Member

thanks @aigilea I think there's something missing when the probe fails. I'll try locally on a device I have with similar BIOS issues, stay tuned. thanks!

@bardliao
Copy link
Collaborator

@bardliao I am wondering if we shouldn't add a hack where we use the adr for 701 for either RT711 or RT1308. The BIOS is broken, and if we don't get a fix we should have an indirection to the 'right' devices.

Right, we should fix the adr issue on BIOS. The hack or DSDT overwrite should only be used for testing on local machines before we get a proper BIOS.

@bardliao
Copy link
Collaborator

@aigilea Could you add options snd_soc_core dyndbg=+p to /etc/modprobe.d/sof-dyndbg.conf? It can help us to get more information why sound card is not probed.

@aigilea
Copy link
Author

aigilea commented Jan 20, 2021

@bardliao here's dmesg with this option from the kernel with acpi overlay.

@RanderWang
Copy link

@bardliao I am wondering if we shouldn't add a hack where we use the adr for 701 for either RT711 or RT1308. The BIOS is broken, and if we don't get a fix we should have an indirection to the 'right' devices.

Right, we should fix the adr issue on BIOS. The hack or DSDT overwrite should only be used for testing on local machines before we get a proper BIOS.

@RanderWang
Copy link

@kv2019i @libinyang please check this on ADL and report a bug to BIOS team. It is too late to report it after PV.

plbossart added a commit to plbossart/sound that referenced this issue Jan 20, 2021
On some HP devices, the BIOS does not advertise the presence of RT711
on link0 and RT1308 on link1. This has been a known issue on reference
platforms, but this problem was not expected to spill into commercial
devices.

Unfortunately the BIOS remained broken and we can't reasonably expect
every Linux user to override the DSDT.

This patch suggests the use of a workaround. Broken BIOS expose the
part 0x701 on all links, which does not correspond to a real device or
configurations. We can however use this information to make existing
codec drivers probe on this device instead.

BugLink: thesofproject#2700
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@aigilea
Copy link
Author

aigilea commented Jun 3, 2021

@marian556
Alsa 1.2.5 is required to work with the latest ucm config.
This commit is just before the new syntax was introduced, it may work.
https://github.com/alsa-project/alsa-ucm-conf/archive/548036b8ecc92d4e8e2070046551fb0b8acb7d96.zip

@marian556
Copy link

Yes , it works. Thanks agilea. You saved me. this version of alsa-ucm-conf just works. Latest does not.

@marian556
Copy link

@aigilea . Is it a good idea to introduce changes into alsa-ucm-conf that are not backward compatible with older alsa-utils. It was not possible to maintain alsa-ucm-conf compatibility with alsa-utils 1.2.4 for some time. Could a new syntax could be introduced alongside the old one? How are you going to communicate incompatible changes to all distributions, such as https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1921632 ?

@plbossart . Proposed ubuntu kernel 5.11 release candidate in testing by ubuntu with this sof-soundwire patches still does not work for me. See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1921632 compare comments #46 and #40
In repository "deb http://archive.ubuntu.com/ubuntu/ hirsute-proposed restricted main multiverse universe"
I know you don't care about distros kernels, but is it anything introduced into kernel between 5.11 and 5.13 that your patches depend on and is missing in 5.11?
Was it good idea by ubuntu to backport those patches to 5.11 ? Are you able to assist ubuntu what might still go wrong even with your patches in?

@plbossart
Copy link
Member

@marian556 I have no idea what Ubuntu are doing and can't do their work. You have Hui Wang's contact, please work with him.

@aigilea
Copy link
Author

aigilea commented Jun 3, 2021

@marian556
Backwards compatible is a wrong term here. You're trying to configure an old program (alsa-lib 1.2.4) with a "future" configuration (alsa-ucm-conf 1.2.5).
The correct way to fix the issue you've run into is to use alsa-lib 1.2.5 with alsa-ucm-conf 1.2.5. Once they will make it to the package manager of your choice this issue will vanish.

I've used 5.11 kernel with the following patches, they are certainly heavily outdated now, but it worked
2ad1b7a
5c88b5b
2ab4440
f489f72
0339590
ce0830d
79af592
d647f14
c3920ec
d30c9c0

@by-cx
Copy link

by-cx commented Jun 3, 2021

Incredible ... speakers, HDMI output and microphone input are working or at least I can hear speakers and see the others in the list of available options. I will test it thoroughly later and report if I find any issue. The final touch needed was the UCM version from @aigilea like in @marian556 's case.

Thank you very much guys. The notebook arrived two days ago and I didn't expect speakers working anytime soon. This kind of support totally exceeded my expectations.

Btw: Above doesn't work with sof-firmware 1.8-rc2. Is it something worth reporting or is it just a bad mixture of versions in my system?

@plbossart
Copy link
Member

Glad you have a solution @by-cx. We've worked hard to make things work out of the box, too bad you tested too early :-)

Please do report the issue with firmware 1.8-rc2 separately, that's precisely the intent of -rc candidates. We don't have a lot of devices and we rely on the community early adopters to let us know of issues.

@by-cx
Copy link

by-cx commented Jun 4, 2021

@plbossart I started testing it in the right time :-) Thank you again, I will report the issue with 1.8-rc2 👍

@plbossart
Copy link
Member

I'll close this issue since it's fixed upstream. UCM issues due to topology changes in 1.8-rc2 are handled in #2985

Thanks to @aigilea for submitting this bug and testing fixes, much appreciated.

damentz pushed a commit to zen-kernel/zen-kernel that referenced this issue Jun 29, 2021
HP Spectre x360 Convertible devices expose invalid _ADR fields in the
DSDT, which prevents codec drivers from probing. A possible solution
is to override the DSDT, but that's just too painful for users.

This patch suggests a simple DMI-based quirk to remap the existing
invalid ADR information into valid ones.

BugLink: thesofproject#2700
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210302075105.11515-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
@ronohara
Copy link

I know this bug is closed, and after I just installed the Ubuntu kernel for 5.13 ... things look very good.

dmesg https://pastebin.com/MyfJhckp
alsa-info https://pastebin.com/bbhYAzcw

But despite alsa now loading the correct kernel module ... no sound. I have checked alsamixer and the speakers were 'off' - but I toggled them On..

Certainly the Sound control panel items sees and plays with the card - but no sound.

So I am really not sure that the 'quirk : -1' did its job properly ... or maybe someone else has an idea ??

@by-cx
Copy link

by-cx commented Jun 30, 2021

@ronohara You need this kernel, SOF firmware 1.7 and the right combination of UCM and SOF topology. You are on alsa-lib 1.2.2 and everything started working for me out of the box when new SOF firmware and upgrade of alsa-lib to 1.2.5 arrived to my system.

I don't think there is alsa-lib 1.2.5 in Ubuntu yet so you can do what I did at the beginning. Here is new version of SOF firmware and topology:

https://github.com/thesofproject/sof-bin

And in this comment there is a link to the right version of UCM, that worked for me:

#2700 (comment)

All you need is to copy those into the right locations of your system. SOF will install into /lib/firmware/intel/ with the included script. UCM, at least in my Fedora, is located here: /usr/share/alsa.

@ronohara
Copy link

@by-cx I compiled and installed alsa-lib-1.2.5.1 and alsa-tools-2.1.5.1 from source - Ubuntu packages do not seem to be flowing yet.

And I installed the new SOF firmware and topology directly from guthib ... but no joy. Alsa is still working if I attach bluetooth speakers. On reboot it sees the soundwire care ... but 'test speakers' = silence.

dmesg.txt https://pastebin.com/7PsJ9ihp
alsa-info https://pastebin.com/qusGmeUG
Sound control: https://ibb.co/94vBc4T

any thoughts ?

@plbossart
Copy link
Member

@ronohara if you installed the latest firmware 1.8, you also need the latest alsa-ucm-conf.

@ronohara
Copy link

@plbossart I had installed the latest alsa-ucm-conf

cd /root
git clone https://github.com/alsa-project/alsa-ucm-conf.git

BUT I got the link in /usr/share/alsa incorrect.
cd /usr/share/alsa
ls -la ucm2
lrwxrwxrwx 1 root root 28 Apr 16 12:12 ucm2 -> /root/dev/alsa-ucm-conf/ucm2

Corrected it with:
rm /usr/share/alsa/ucm2
ln -s /root/alsa-ucm-conf/ucm2 /usr/share/alsa/ucm2

Rebooted - and there is a huge amount of activity from the kernel ...

dmesg.txt https://pastebin.com/7ywNgKVK
alsa-info https://pastebin.com/DVpAj1y9

But still no sound.

PS: Putting all this commentary in for posterity .. there is almost no documents or hints about setting up alsa-ucm-conf

@plbossart
Copy link
Member

@ronohara you probably need to test the basics with command-line playback from a terminal

alsaucm -c sof-soundwire set _verb HiFi set _enadev Speaker
speaker-test -Dhw:0,2 -c2 -r48000

alsaucm -c sof-soundwire set _verb HiFi set _enadev Mic
arecord -Dhw:0,4 -c2 -r48000

if you don't hear sound or don't see any activity on the record there is something wrong with your setup.

@ronohara
Copy link

@plbossart Interesting .... speaker-test works !!! plenty of 'pink noise' and left/right is distinct (I will worry about the Mic later)

speaker-test 1.2.5.1

Playback device is hw:0,2
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 16384
Period size range from 48 to 4096
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 5.631267
0 - Front Left
1 - Front Right
Time per period = 5.973940
0 - Front Left
1 - Front Right
Time per period = 1.792136

But the Sound Control 'test' button does not work ... and applications using alsa don't work either.

@plbossart
Copy link
Member

@ronohara I guess it's a problem with the UCM2 setup then, or PulseAudio not getting the right config.

@ronohara
Copy link

ronohara commented Aug 15, 2021

@plobssart ... still no joy after upgrading alsa to 1.2.5 (lib, tools, utils) ... some traps for that. You need to remove the apt installed bits of alsa (1.2.2) before your compile /install from source, Otherwise some of the old version gets linked into the lib files.

Upgraded to LM 20.2 as well.

Status is: kernel 5.13 sees and uses the hardware just fine (dmesg.txt)... and alss-info shows all sorts of things as good.

dmesg: https://pastebin.com/NXBrEMnJ
alsa-info: https://pastebin.com/Yx4MK0yr

The last line of alsa-info is weird:

!!Packages installed
!!--------------------

rc alsa-utils 1.2.2-1ubuntu2.1 amd64 Utilities for configuring and using ALSA

and yet using apt .. I get this...

x360 tmp # apt remove alsa-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'alsa-utils' is not installed, so not removed
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

the Sound Control still does not deliver sound - but does see the sof-soundwire card and I have output hardware set to Stereo and Speakers

When you put the test button on the sound control, the dmesg log shows the kernel nudges the card and the card says that it worked ok ..... which is also odd.

As an example:
[ 417.573278] sof-audio-pci-intel-tgl 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 0
[ 417.573281] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x60050000
[ 417.573429] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x60050000
[ 417.573440] sof-audio-pci-intel-tgl 0000:00:1f.3: FW Poll Status: reg=0x140000 successful
[ 417.573443] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x60030000
[ 417.573595] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x60030000
[ 417.573621] sof-audio-pci-intel-tgl 0000:00:1f.3: pcm: free stream 0 dir 0
[ 417.574315] rt711 sdw:0:25d:711:0: [rt711_sdw_write] 00e0 <= 0003
[ 417.574398] rt711 sdw:0:25d:711:0: [rt711_sdw_write] 00f0 <= 0003
[ 417.574402] rt711 sdw:0:25d:711:0: rt711_clock_config complete, clk_freq=4800000
[ 417.574720] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000
[ 417.574894] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000
[ 417.574916] sof-audio-pci-intel-tgl 0000:00:1f.3: pcm: close stream 0 dir 0

@plbossart
Copy link
Member

@ronohara maybe try removing/reinstalling libasound2-data. We've seen cases where bad mixer settings keep being used, and removing them helps.

@ronohara
Copy link

Hmm - apt purge libasound2-data ,,,, looks a bit dangerous

The following packages will be REMOVED
ant* ant-optional* antlr* antlr3* antlr3.2* aspectj* blender* blueberry* brasero* brasero-cdrkit* brltty* bsh*
ca-certificates-java* celluloid* cheese* cup* default-jdk* default-jdk-headless* default-jre*
default-jre-headless* dissenter-browser* evolution-data-server* ffmpeg* ffmpegthumbnailer* fop* gimp*
gir1.2-gnomebluetooth-1.0* gnome-bluetooth* gnome-control-center* gnome-disk-utility* gnome-session-canberra*
gnome-settings-daemon* gnome-video-effects-extra* gnome-video-effects-frei0r* google-chrome-stable*
gstreamer1.0-alsa* gstreamer1.0-libav* gstreamer1.0-plugins-bad* hexchat* hypnotix* javacc* javahelp2* jlex*
junit4* jython* k3b* k3b-extrathemes* kaccounts-integration* kaccounts-providers* kactivitymanagerd* kate*
kcalc* kde-cli-tools* kde-config-cddb* kde-config-telepathy-accounts* kde-spectacle* kde-telepathy*
kde-telepathy-approver* kde-telepathy-auth-handler* kde-telepathy-contact-list* kde-telepathy-desktop-applets*
kde-telepathy-filetransfer-handler* kde-telepathy-integration-module* kde-telepathy-kpeople*
kde-telepathy-minimal* kde-telepathy-send-file* kde-telepathy-text-ui* kdeconnect* keditbookmarks* khelpcenter*
kinit* kio* konsole* konsole-kpart* kpackagelauncherqml* ktexteditor-katepart* libasound2* libasound2-data*
libasound2-plugins* libatopology2* libavdevice58* libavfilter7* libbrasero-media3-1* libcanberra-gtk-module*
libcanberra-gtk0* libcanberra-gtk3-0* libcanberra-gtk3-module* libcanberra-pulse* libcanberra0* libcheese-gtk25*
libespeak-ng1* libexcalibur-logkit-java* libffmpegthumbnailer4v5* libflite1* libfluidsynth2* libfop-java*
libgegl-0.4-0* libgeronimo-jms-1.1-spec-java* libgimp2.0* libgnome-bluetooth13* libgsound0* libk3b7*
libk3b7-extracodecs* libkf5cddb5* libkf5declarative5* libkf5kcmutils5* libkf5khtml-bin* libkf5khtml5*
libkf5newstuff5* libkf5newstuffcore5* libkf5notifications5* libkf5notifyconfig5* libkf5parts-plugins*
libkf5parts5* libkf5plasma5* libkf5plasmaquick5* libkf5purpose-bin* libkf5purpose5* libkf5quickaddons5*
libkf5runner5* libkf5texteditor5* libkf5wallet-bin* libkf5wallet5* libktpcommoninternals9* libktplogger9*
libktpmodels9* libktpotr9* libktpwidgets9* libkwalletbackend5-5* libmarco-private2* libmatemixer0* libmpv1*
libmsv-java* libnb-platform18-java* libopenal1* libpcaudio0* libqt5webenginecore5* libqt5webenginewidgets5*
libreoffice-sdbc-hsqldb* libsdl-image1.2* libsdl1.2debian* libsdl2-2.0-0* libsndio7.0* libsox-fmt-all*
libsox-fmt-alsa* libvisual-0.4-plugins* libxsltc-java* marco* mate-control-center* mate-media*
mate-notification-daemon* mate-power-manager* mate-settings-daemon* mate-utils* meld* metacity*
mint-meta-codecs* mint-meta-mate* mpg321* mplayer* nautilus-extension-brasero* onboard* openjdk-11-demo*
openjdk-11-jdk* openjdk-11-jdk-headless* openjdk-11-jre* openjdk-11-jre-headless* openjdk-11-source*
openjdk-14-demo* openjdk-14-jdk* openjdk-14-jdk-headless* openjdk-14-jre* openjdk-14-jre-headless*
openjdk-14-source* orca* pavucontrol* phonon4qt5-backend-vlc* plasma-framework* plasma-runner-telepathy-contact*
povray* povray-examples* povray-includes* pulseaudio* pulseaudio-module-bluetooth* pulseaudio-module-zeroconf*
qml-module-org-kde-kconfig* qml-module-org-kde-kirigami2* qml-module-org-kde-kquickcontrols*
qml-module-org-kde-kquickcontrolsaddons* qml-module-org-kde-newstuff* qml-module-org-kde-purpose*
qml-module-org-kde-runnermodel* qml-module-org-kde-telepathy* rhino* signal-desktop* signon-kwallet-extension*
slick-greeter* speech-dispatcher* speech-dispatcher-audio-plugins* speech-dispatcher-espeak-ng*
tumbler-plugins-extra* vim* vim-julia* visualvm* vlc* vlc-plugin-base*
The following NEW packages will be installed
notification-daemon
0 to upgrade, 1 to newly install, 206 to remove and 1 not to upgrade.
Need to get 37.0 kB of archives.
After this operation, 2,437 MB disk space will be freed.
Do you want to continue? [Y/n]

@ronohara
Copy link

And alsamixer now has a library problem. Looks like I might have to compile quite a bit from source to get the 1.2.5 alsa support working.

360 tmp # alsamixer
ALSA lib dlmisc.c:170:(snd_dlsym_verify) unable to verify version for symbol snd_func_private_integer
ALSA lib conf.c:4720:(_snd_config_evaluate) symbol snd_func_private_integer is not defined inside (null)
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such device or address
ALSA lib conf.c:3858:(snd_config_hook_load) Unable to expand filenames in the pre-load section
ALSA lib conf.c:3736:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: No such device or address
ALSA lib control.c:1268:(snd_ctl_open_conf) Invalid type for CTL default definition
cannot open mixer: Invalid argument
x360 tmp #

@hottwaj
Copy link

hottwaj commented Aug 31, 2021

Hey @ronohara, in case it helps, I was able to build .deb files for alsa 1.2.5.1 from the debian sources for the future "sid" release for the following:

  • alsa-lib
  • alsa-utils
  • alsa-topology-conf
  • alsa-ucm-conf

(libasound is part of alsa-lib)

You can download the debian source bundles for these here, e.g. here's the one for alsa-lib
https://launchpad.net/debian/sid/+source/alsa-lib

you can then build the deb files from these sources using:
dpkg-buildpackage -rfakeroot -uc -us --build=binary -d

(you will also need to install build dependencies but you probably have these already)

That way you can easily install the 1.2.5.1 debs or got back to an older version using apt or dpkg

However, even after doing all of this and using a 5.13 kernel, I am not able to get sound when I cold boot my system (linux mint 20 based on ubuntu 20.04)

Will follow up separately with logs & further questions

@plbossart
Copy link
Member

The jack detection doesn't seem to work on these HP x360 convertible devices, I added PR #3195 after local tests on a device. That helps with the ALSA mixer controls. I did find one case where the headset was not detected but that's not super reliable anyways. remove-insert forced the detection alright.

Changing the device with the Gnome settings remains broken, something's not working between PipeWire, Gnome Settings and possibly UCM. @perexg FYI.

The rest seems to work fine on Fedora 34 with the 5.14.9 kernel. speaker, local mics, headphones, headset record audio with decent levels.

sboyanex pushed a commit to dineshXadireddi/Backport-series that referenced this issue Aug 2, 2022
…Convertible

HP Spectre x360 Convertible devices expose invalid _ADR fields in the
DSDT, which prevents codec drivers from probing. A possible solution
is to override the DSDT, but that's just too painful for users.

This patch suggests a simple DMI-based quirk to remap the existing
invalid ADR information into valid ones.

BugLink: thesofproject/linux#2700
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210302075105.11515-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
(cherry picked from commit f6594cd)

BUG=b:238403794
TEST=Test Audio use cases.

Signed-off-by: sboyane <shankarx.boyane@intel.com>
Change-Id: I7b5844d1664f0466d153235813739951f08312d1
sboyanex pushed a commit to dineshXadireddi/Backport-series that referenced this issue Aug 26, 2022
…Convertible

HP Spectre x360 Convertible devices expose invalid _ADR fields in the
DSDT, which prevents codec drivers from probing. A possible solution
is to override the DSDT, but that's just too painful for users.

This patch suggests a simple DMI-based quirk to remap the existing
invalid ADR information into valid ones.

BugLink: thesofproject/linux#2700
Co-developed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210302075105.11515-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
(cherry picked from commit f6594cd
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:238403794
TEST=Test Audio use cases.

Signed-off-by: sboyane <shankarx.boyane@intel.com>
Change-Id: I58f42eb7a16fb77ea5d7736a78b2807f550cd630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BIOS Related to BIOS bug Something isn't working fix submitted Fix submitted but not merged yet P3 Low-impact bugs or features SDW Applies to SoundWire bus for codec connection TGL Applies to Tiger Lake platform
Projects
None yet
Development

No branches or pull requests