alsa-project / alsa-lib

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

microphone disappeared on alsa-ucm-conf 1.2.6.1 #200

Closed galibozek closed 2 years ago

galibozek commented 2 years ago

after upgrade alsa-ucm-conf 1.2.5.1-1 to 1.2.6.1-1 (arch linux) my microphone disappeared on lenovo t14 gen2i

Similar to: https://bugs.archlinux.org/task/71180

00:1f.3 Audio device: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20) (prog-if 80)
        Subsystem: Lenovo Device 22c9
        Flags: bus master, fast devsel, latency 64, IRQ 187, IOMMU group 12
        Memory at 603dbc0000 (64-bit, non-prefetchable) [size=16K]
        Memory at 603da00000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: <access denied>
        Kernel driver in use: sof-audio-pci-intel-tgl
        Kernel modules: snd_hda_intel, snd_sof_pci_intel_tgl
kernel: input: sof-hda-dsp Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input9
kernel: input: sof-hda-dsp Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input10
kernel: input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input11
kernel: input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input12
kernel: input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input13
systemd-udevd[513]: controlC0: Process '/usr/bin/alsactl restore 0' failed with exit code 99.
alsactl[1136]: alsa-lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
alsactl[1136]: alsa-lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
alsactl[1136]: Found hardware: "sof-hda-dsp" "Realtek ALC257" "HDA:80862812,80860101,00100000 HDA:10ec0257,17aa22c9,00100001 cfg-dmics:2" "" ""
alsactl[1136]: Hardware is initialized using a generic method
audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=alsa-restore comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
plasmashell[1688]: org.kde.plasma.pulseaudio: No object for name "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.stereo-fallback.monitor"
kernel: snd_hda_codec_realtek ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
kernel: snd_hda_codec_realtek ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
nirs commented 2 years ago

Same problem in Fedora 35 after upgrading from alsa-lib-1.2.5.1-3.fc35.x86_64 to alsa-lib-1.2.6-1.fc35.x86_64. Downgrading back to 1.2.5.1-3 seems to restore the microphone.

Hardware: Lenovo P1 Gen 3

perexg commented 2 years ago

Does the simple change in https://github.com/alsa-project/alsa-ucm-conf/pull/127 work for you?

galibozek commented 2 years ago

@perexg unfortunately, it does not solve my problem (after apply this patch on 1.2.6.1)

there is no this error after this change

kernel: snd_hda_codec_realtek ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
kernel: snd_hda_codec_realtek ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
kernel: snd_hda_codec_realtek ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
perexg commented 2 years ago

Could you give me a link to the alsa-info.sh output (with the recent packages)?

Also, show me error/output from alsaucm -c hw:0 set _verb HiFi and alsaucm -c hw:0 dump text (upload the output to gist or pastebin and show only URL here). Thank you.

perexg commented 2 years ago

Same problem in Fedora 35 after upgrading from alsa-lib-1.2.5.1-3.fc35.x86_64 to alsa-lib-1.2.6-1.fc35.x86_64. Downgrading back to 1.2.5.1-3 seems to restore the microphone.

Hardware: Lenovo P1 Gen 3

It's already fixed. Upgrade to alsa-lib-1.2.6-3 : https://bodhi.fedoraproject.org/updates/FEDORA-2021-e6f6ed66d8

galibozek commented 2 years ago

@perexg where find patch for alsa-lib? i'm using arch linux :)

perexg commented 2 years ago

alsa-lib-1.2.6.1 is already fixed. -3 is the package release for Fedora only (which has this fix)

Please, follow my instructions in my previous comment - upgrade to 1.2.6.1 and fix the include path in the /usr/share/alsa/ucm2/ tree according https://github.com/alsa-project/alsa-ucm-conf/pull/127 .

galibozek commented 2 years ago

@perexg I did so, and I gave the result above

perexg commented 2 years ago

@perexg I did so, and I gave the result above

??? I don't see any outputs from alsa-info.sh nor alsaucm.

galibozek commented 2 years ago

alsa-info.sh: https://pastebin.com/JWW7bGBC

$ sudo alsaucm -c hw:0 set _verb HiFi

ALSA lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
alsaucm: error failed to open sound card hw:0: No such file or directory

$ sudo alsaucm -c hw:0 dump text

ALSA lib main.c:1412:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
alsaucm: error failed to open sound card hw:0: No such file or directory
alsa-card-profiles 1:0.3.40-1
alsa-lib 1.2.6.1-1
alsa-plugins 1:1.2.6-1
alsa-topology-conf 1.2.5.1-1
alsa-ucm-conf 1.2.6.1-1
alsa-utils 1.2.6-1
pulseaudio-alsa 1:1.2.6-1

and apply patch:

cat /usr/share/alsa/ucm2/Intel/sof-hda-dsp/HiFi.conf | sed '51!d'
Include.hdmi.File "/Intel/sof-hda-dsp/Hdmi.conf"
galibozek commented 2 years ago

in kde sound applet is shown as unavailable Screenshot_20211210_114626

perexg commented 2 years ago

Could you run alsaucm commands as root? The output should be different, if the card is present.

galibozek commented 2 years ago

I runned command as root via sudo, from root same output.

perexg commented 2 years ago

I have a feedback from the other sources (https://bodhi.fedoraproject.org/updates/FEDORA-2021-e6f6ed66d8) that alsa-lib-1.2.6.1 and alsa-ucm-conf-1.2.6.2 should resolve the issues with the Intel SOF drriver (digital microphones). Please, wait until your distribution updates the alsa-ucm-conf package and retest.

The alsaucm output is not correct (permissions?), I'll try to dig into this more when the package upgrade does not help. Thank you for your co-operation to resolve this issue.

galibozek commented 2 years ago

no change after apply this patch and reboot https://github.com/alsa-project/alsa-ucm-conf/commit/b0ffdb057133f6e3fe1484ff72b5115dc471f303

perexg commented 2 years ago

The bytcht-es8316 patch is not relevant. I would try to determine, why alsaucm commands don't show anything. They should work also with the 1.2.5 version. I usually use strace to look which files are touched.

galibozek commented 2 years ago

alsa-utils 1.2.6-1 sudo strace alsaucm -c hw:0 set _verb HiFi https://pastebin.com/HvMh8L4d

perexg commented 2 years ago

What's your /usr/share/alsa/ucm2/ucm.conf file ? EDIT: I mean contents.

galibozek commented 2 years ago

alsa-ucm-conf: 1.2.6.1-1 /usr/share/alsa/ucm2/ucm.conf: https://pastebin.com/n1by5xps

galibozek commented 2 years ago

after downgrade alsa-topology-conf to: 1.2.5.1-1

sudo strace alsaucm -c hw:0 set _verb HiFi https://pastebin.com/jADgBwpR

perexg commented 2 years ago

The problem with your 1.2.6 UCM files is:

access("/usr/share/alsa/ucm2/conf.d/sof-hda-dsp/sof-hda-dsp.conf", R_OK) = -1 ENOENT (Nie ma takiego pliku ani katalogu)

It should be link to:

alsa-ucm-conf-1.2.6.2/ucm2/conf.d/sof-hda-dsp/sof-hda-dsp.conf -> ../../Intel/sof-hda-dsp/sof-hda-dsp.conf`

It looks like a bad packaging or so...

dvzrv commented 2 years ago

Hi! I'm packaging alsa-ucm-conf for Arch Linux. There seems to be a bug in the package script for this package, which did not install any of the symlinks.

It looks like a bad packaging or so...

Given that there is neither a build system nor any instructions in the project explaining where things have to go, your statement rather points out that there are open questions in regards to how to install these files and that this needs improvement.

I recall other problems around these files and I guess even a simple Makefile would already help in getting this right for everyone without anyone having to guess. Can I assume, that all files are just copied verbatim to the file system below /usr/share/alsa/ or are also other locations possible? I can provide a PR for this with a little guidance on what the possible locations are.

galibozek commented 2 years ago

alsa-ucm-conf 1.2.6.2-2 (arch linux) fixes the problem @perexg, @dvzrv thanks

perexg commented 2 years ago

@dvzrv : Thank you for the suggestion. Is text in https://github.com/alsa-project/alsa-ucm-conf/commit/3fe9216bc91794d77241cc7c8f21f961f83db489 enough ? There is no installation script, because it's just a simple copy. I use tar for Fedora to unpack the source directly to the proper location like:

tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2"
dvzrv commented 2 years ago

Is text in alsa-project/alsa-ucm-conf@3fe9216 enough ?

Sure, thanks! At first I thought the libdir is also exposed in alsa-lib's pkgconfig integration (and could e.g. be easily integrated into some install steps), but that seems to be not the case.

injcristianrojas commented 2 years ago

Subscribing to this discussion. On Fedora 35 not only my microphone disappeared, but also a HDMI/DisplayPort profile. Sticking with alsa-lib/alsa-ucm 1.2.5.1-3.fc35 using dnf versionlock is a workaround.

perexg commented 2 years ago

Subscribing to this discussion. On Fedora 35 not only my microphone disappeared, but also a HDMI/DisplayPort profile. Sticking with alsa-lib/alsa-ucm 1.2.5.1-3.fc35 using dnf versionlock is a workaround.

What exactly does not work with https://bodhi.fedoraproject.org/updates/FEDORA-2021-e6f6ed66d8 ? Did you update to latest packages?

injcristianrojas commented 2 years ago

@perexg sorry, nevermind. I did an upgrade using bodhi yesterday and it didn't work. Now I did a full dnf upgrade --refresh and the HDMI profile is back again. Thank you.

perexg commented 2 years ago

Fixed in alsa-lib-1.2.6.1 and alsa-ucm-conf-1.2.6.2.