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

[FEATURE] Xiaomi Redmibook 16 2024 mic is not working #5053

Open
OrelSokolov opened this issue May 28, 2024 · 30 comments
Open

[FEATURE] Xiaomi Redmibook 16 2024 mic is not working #5053

OrelSokolov opened this issue May 28, 2024 · 30 comments
Labels
dmic Issues related to PCH connected DMIC duplicate This issue or pull request already exists MTL Applies to Meteor Lake platform.

Comments

@OrelSokolov
Copy link

OrelSokolov commented May 28, 2024

So can anyone help with implementing firmware for this model?
What should I provide?

options snd-hda-intel dmic_detect=0 currently works for sound, but internal microphone does not work.
3.5 headset works.

Thanks.

UPD:
Windows works fine with internal mic, device info:

INTELAUDIO\CTLR_DEV_7E28&LINKTYPE_02&DEVTYPE_00&VEN_8086&DEV_AE20&SUBSYS_1D722309&REV_10EC\5&1ed5312d&0&0000

@OrelSokolov OrelSokolov added the enhancement New feature or request label May 28, 2024
@plbossart
Copy link
Member

please share the output of 'alsa-info', it's not clear that it's an SOF problem but more likely a Linux hardware detection issue.

@OrelSokolov
Copy link
Author

@lgirdwood
Copy link
Member

Looks like this issue is unrelated to SOF and is a platform issue with HDA mic integration.

@plbossart
Copy link
Member

please share alsa-info without this "option snd_intel_dspcfg: dsp_driver=1"

@plbossart plbossart transferred this issue from thesofproject/sof Jun 10, 2024
@OrelSokolov
Copy link
Author

@plbossart how to do this? I ran just alsa-info without any options.

@plbossart
Copy link
Member

you have this option somewhere in /etc/modprobe.d/*.conf. Remove it, reboot and send the results of alsa-info.

@plbossart
Copy link
Member

double check the results,

!!Modprobe options (Sound related)
!!--------------------------------

snd_pcsp: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
snd_usb_audio: index=-2
snd_usb_caiaq: index=-2
snd_usb_ua101: index=-2
snd_usb_us122l: index=-2
snd_usb_usx2y: index=-2
snd_cmipci: mpu_port=0x330 fm_port=0x388
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_intel_dspcfg: dsp_driver=1 <<<< THIS NEEDS TO BE GONE

@OrelSokolov
Copy link
Author

@plbossart
Copy link
Member

Ha yes, we've seen this before

[    6.000606] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 4
[    6.000623] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget dai-copier.DMIC.dmic01.capture
[    6.000629] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets

This was reported in #4973 and fixed by 806f52f

The patch was submitted upstream and is already in maintainer branches, commit d556f80, and already in Linus' tree.

Please try to apply this commit or wait until it shows up in your distribution.

@plbossart plbossart added dmic Issues related to PCH connected DMIC MTL Applies to Meteor Lake platform. duplicate This issue or pull request already exists and removed enhancement New feature or request labels Jun 11, 2024
@plbossart plbossart changed the title [FEATURE] Redmibook 16 2024 mic is not working [FEATURE] Huawei Redmibook 16 2024 mic is not working Jun 11, 2024
@OrelSokolov
Copy link
Author

@plbossart so how can I fix this on Ubuntu? Kernel did not help some weeks ago.

@plbossart
Copy link
Member

you can compile your own kernel or wait for the Ubuntu kernel to have this supported. Presumably the fix will be applied to Linux stable so all distros will get the fix at some point.

@OrelSokolov
Copy link
Author

@plbossart thanks a lot!

@OrelSokolov
Copy link
Author

@plbossart this is not Huawei, this is Xiaomi

@OrelSokolov
Copy link
Author

OrelSokolov commented Jun 12, 2024

@plbossart anyway, I am running 6.10rc2, looks like it includes this commit. But still no any microphone input.

Can you please give advice how to configure alsa now?

https://alsa-project.org/db/?f=ebfc9d57a9e98132909114151d1f70e9109b8eaa

@plbossart plbossart removed the Huawei label Jun 12, 2024
@plbossart
Copy link
Member

are you sure this is the right log? There's the same error

[    5.310431] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 4
[    5.310450] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget dai-copier.DMIC.dmic01.capture
[    5.310457] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets

I can't recall if we need a topology update as well. @ujfalusi might know?

@plbossart plbossart changed the title [FEATURE] Huawei Redmibook 16 2024 mic is not working [FEATURE] Xiaomi Redmibook 16 2024 mic is not working Jun 12, 2024
@OrelSokolov
Copy link
Author

@plbossart as you can see this is within new kernel 6.10 which includes your patch. And yes, I have no idea how to setup this thing properly.
I turned off again dsp driver, I tried to install some repos from the SOF project earlier. So I have no clue what is the correct combination of these.
That's why I created and issue to ask for help to detect correct combination of kernel, driver, config and etc...

@plbossart
Copy link
Member

Can you also extract the NHLT?

cat /sys/firmware/acpi/tables/NHLT > nhlt.dat; gzip nhlt.dat

and attach the zipped file, thanks!

@OrelSokolov
Copy link
Author

nhlt.dat.gz

@plbossart
Copy link
Member

nhlt.dsl.txt

This still looks like the 16-bit issue corrected by the commit d556f80

my money is on the topology now. Please try to add (backup what you have of course!) from this comment: #4973 (comment)

@OrelSokolov
Copy link
Author

@plbossart locate command gives this

/usr/lib/firmware/intel/sof-ipc4-tplg/sof-hda-generic-4ch.tplg
/usr/lib/firmware/intel/sof-ipc4-tplg-v2.9/sof-hda-generic-4ch.tplg
/usr/lib/firmware/intel/sof-ipc4-tplg-v2.9/sof-hda-generic-4ch.tplg.zst
/usr/lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg
/usr/lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg.zst

@OrelSokolov
Copy link
Author

OrelSokolov commented Jun 12, 2024

@plbossart OMG it works!!!! Without any additional options

Thanks. What is futher steps to fix this in codebase?

https://alsa-project.org/db/?f=71084485390ea3ac2dab60932cd23e0ee6b91e16

@plbossart
Copy link
Member

Excellent.

What is futher steps to fix this in codebase?

If you meant "when is this going to be supported by distros", there will be an 'sof-bin' 2.10 release soonish - in the coming weeks - where the required topology will be included. The kernel patch should also be propagated to stable kernels but that takes time and depends on stable maintainers.

@OrelSokolov
Copy link
Author

@plbossart Yes, I mean when this update will be in the linux kernel or somewhere downloadable.

@yw662
Copy link

yw662 commented Sep 6, 2024

Fedora is now on Linux 6.10.7 SOF 2024.06, sound and microphone both work.

@johndoe3535
Copy link

johndoe3535 commented Sep 10, 2024

I'm on Fedora KDE now and can confirm that sound and microphone is working now. However something in the sound pipepline seems to crash somehow after some time. I get robotic sounding voices, everything sounds distored. It stops when I switch to pro audio in the sound settings. When I get it on pro audio, it stops again when switching to play hi fi quality music. Maybe some buffering issues. It seems I can trigger it faster when skipping trough a youtube video with the arrow keys, and often start and stop playing sounds. But yeah, maybe the issue is somewhere in pipewire idk. Anyone else with a redmibook 16 that has this now ? I was on bazzite before (fedora atomic spin with custom kernel) with kernel 6.10, and the sof files from march. So for me its hard to say what introduced this on my side...

@malvery
Copy link

malvery commented Sep 10, 2024

I'm on Fedora KDE now and can confirm that sound and microphone is working now. However something in the sound pipepline seems to crash somehow after some time. I get robotic sounding voices, everything sounds distored. It stops when I switch to pro audio in the sound settings. When I get it on pro audio, it stops again when switching to play hi fi quality music. Maybe some buffering issues. It seems I can trigger it faster when skipping trough a youtube video with the arrow keys, and often start and stop playing sounds. But yeah, maybe the issue is somewhere in pipewire idk. Anyone else with a redmibook 16 that has this now ? I was on bazzite before (fedora atomic spin with custom kernel) with kernel 6.10, and the sof files from march. So for me its hard to say what introduced this on my side...

Same issues on Arch Linux (linux=6.10.8, sof-firmware=2024.06, pipewire 1:1.2.3).

Steps to reproduce robotic sound:

  • change microphone level => gets robotic sound until toggle card on/off or switch card profile

Steps to reproduce missed sound:

  • start play sound on user1 and tty1
  • switch to the user2 on tty2 and play something sound too
  • return to the user1 on tt1 => gets missed sound in any application until toggle card profile

@ujfalusi
Copy link
Collaborator

@johndoe3535, @malvery, can you describe or better provide a recording of the 'robotic' sound?
The robotic sound is on the playback or capture direction?

@OrelSokolov
Copy link
Author

@ujfalusi I can confirm this issue. This is completely random issue. I have this issue while using Chrome browser. Restarting application process helps.
Bug just adds glitches to the original sound, so it sounds similar to original sound just with glitches.

@ujfalusi
Copy link
Collaborator

@OrelSokolov, so it is with playback?
Pipewire/Pulseaudio keeps the audio open for few more seconds after the last user is gone, stopping/restarting application 'fast' enough will still use the same stream the audio was opened with (the sound servers are playing silence when no client is around).

If the issue is easy to reproduce, can you make a recording of it with a phone for example for us to hear it? A video is also good so we could see what is going on in the UI.

I think we will need to collect firmware logs to have cleaner picture and more data points.

@malvery
Copy link

malvery commented Sep 15, 2024

@johndoe3535, @malvery, can you describe or better provide a recording of the 'robotic' sound? The robotic sound is on the playback or capture direction?

Recorded "robotic" sound on the attached video
https://github.com/user-attachments/assets/6221b976-dbba-4026-ba7d-f3011afe3804

How can I help in collecting firmware logs ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dmic Issues related to PCH connected DMIC duplicate This issue or pull request already exists MTL Applies to Meteor Lake platform.
Projects
None yet
Development

No branches or pull requests

7 participants