alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
366 stars 177 forks source link

alsa-lib 1.2.5 no devices on Lenovo Carbon (gen 7) - pipewire #142

Closed sambo57u closed 3 years ago

sambo57u commented 3 years ago

I use Fedora 34 and updated alsa-lib and all other alsa products to version 1.2.5. They work fine on my desktop machines but on Lenovo laptop I am getting the message alsactl cannot find hw:0 and daemon deactivates with no devices showing. Downgrading to 1.2.4 solves the problem.

perexg commented 3 years ago

Could you show me the error lines ?

sambo57u commented 3 years ago

alsactl[2087]: alsactl 1.2.5 daemon started systemd[1]: Reached target Sound Card. alsactl[2087]: /usr/sbin/alsactl: snd_card_iterator_sinit:252: Cannot find soundcard 'hw:0'... alsactl[2087]: alsactl daemon stopped

foutrelis commented 3 years ago

I think I'm seeing a similar issue on Arch Linux. After upgrading to alsa-lib 1.2.5 Chromium stopped playing audio until pulseaudio was restarted. Upon closer inspection, pactl list cards is now missing the HDA Intel HDMI card and only shows the HDA Intel PCH one.

Some error messages I've gathered:

Git bisect points to commit 63f7745be504e447923f2cde421177a2fca99340 as the first commit that results in the Failed to find a working profile error.

After restarting pulseaudio with alsa-lib 1.2.5 installed, it appears that pactl list cards shows one fewer cards on my laptop which has this audio hardware:

$ lspci | grep Audio
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)

alsa-lib-1.2.4-pactl-list-cards.txt alsa-lib-1.2.5-pactl-list-cards.txt

aminvakil commented 3 years ago

I have the exact same issue with @foutrelis, I only faced this issue using strawberry.

joakim-tjernlund commented 3 years ago

Same problem on Gentoo

Polynomial-C commented 3 years ago

Same problem on Gentoo

https://bugs.gentoo.org/793410

joakim-tjernlund commented 3 years ago

killing PA and restarting it may fix the problem, in case that makes it easier to diagnose.

perexg commented 3 years ago

Note that those are probably two bugs - PA sound device detection and alsactl hw:# problem. The alsactl problem should be fixed with the above commit.

foutrelis commented 3 years ago

@perexg Would you say the sound device detection is a PA bug? Or should I open a new bug in alsa-lib?

perexg commented 3 years ago
lenovo-x1.localdomain pipewire[4675]: '_ucm0001.hw:sofhdadsp,5': playback open failed: No such device
lenovo-x1.localdomain pipewire[4675]: adapter 0x5617b566a460: can't get format: No such device

Digging more.. It's problem for X1 Carbon, the HDA HDMI issue seems different. You should check the full pulseaudio / pipewire logs. The short version is not very helpful.

foutrelis commented 3 years ago

Any chance this pulseaudio -v output is more useful? 🐈

pulseaudio-verbose.txt

perexg commented 3 years ago

Yes:

Parse arguments error: Invalid argument
I: [pulseaudio] (alsa-lib)confmisc.c: Unable to find definition 'cards.HDA-Intel.pcm.hdmi.common:CARD=1,DEVICE=3,CTLINDEX=0,AES0=4,AES1=130,AES2=0,AES3=2cards.HDA-Intel.pcm.hdmi.common:CARD=1,DEVICE=3,CTLINDEX=0,AES0=4,AES1=130,AES2=0,AES3=2'
foutrelis commented 3 years ago

So it's complaining about AES3=2cards because Parameter AES3 must be an integer. Have you figured out how it relates to commit 63f7745be504e447923f2cde421177a2fca99340?

perexg commented 3 years ago

The config reference string is wrongly doubled. It should not happen. Trying to reproduce here.

foutrelis commented 3 years ago

The config reference string is wrongly doubled.

Ouch, it's indeed doubled! I opened a new issue to better track this.

perexg commented 3 years ago

The original issue is for pipewire. It seems that this daemon opens the devices outside the UCM manager, thus the private alsa-lib configuration (which is available only in memory), is not available for the forked process.

Trying to discuss this in the pipewire tracker:

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251

perexg commented 3 years ago

Workaround:

# diff -u /usr/share/alsa/ucm2/ucm.conf~ /usr/share/alsa/ucm2/ucm.conf
--- /usr/share/alsa/ucm2/ucm.conf~  2021-05-27 10:14:01.000000000 +0200
+++ /usr/share/alsa/ucm2/ucm.conf   2021-06-02 16:39:34.093331137 +0200
@@ -18,7 +18,7 @@
 Define.V2Module yes    # non-empty string to enable module name lookups (obsolete)
 Define.V2Name yes  # non-empty string to enable driver & card name lookups (obsolete)

-Include.libgen.File "/lib/generic.conf"  # private alsa-lib configuration
+#Include.libgen.File "/lib/generic.conf"  # private alsa-lib configuration

 If.driver {
    Condition {
sambo57u commented 3 years ago

I patched the rpms with all the recent changes including the one above and it works now with pipewire. I see that you are also building the rpms on koji.

dvzrv commented 3 years ago

@perexg Would it be possible to release bug fix version with the current fixes or is pipewire integration not fixed by their release of 0.3.29 and applying https://github.com/alsa-project/alsa-lib/commit/0e4ba2ea8c0402f12a645032a14693eb9b1278e6 and https://github.com/alsa-project/alsa-lib/commit/9621d0bff2e60b43e329ffa5059ab19f2914ec14?

From a packager perspective it is a bit unclear at this point, which patches to apply for this specific issue.

perexg commented 3 years ago

@dvzrv : Sorry about that. Yes, I plan to release 1.2.5.1 soon, but all changes in alsa-lib and alsa-utils repos are bug fixes right now.

dvzrv commented 3 years ago

I understand.

It seems the first three commits since 1.2.5 in combination with https://github.com/alsa-project/alsa-utils/commit/78212445de4c8e07873cbc7dff2abcacd031f151 and pipewire 0.3.29 (or pulseaudio 14.2) fixed it for the affected users on Arch Linux: https://bugs.archlinux.org/task/71077

tramtrist commented 3 years ago

My Lenovo X13 AMD lost Microphone with 1.2.5. 1.2.4 working just fine.

perexg commented 3 years ago

ALSA bugfix packages 1.2.5.1 were released. I believe that the original issue was resolved. Closing.

miquecg commented 3 years ago

@tramtrist You can join this Arch Linux forum thread. Main issue is solved but other problems are still present.