Open qdrop17 opened 1 year ago
I captured the driver initialization sequence from a Windows VM. Then I replayed the initialization using the alsa-utils, bisecting the 2000 "verbs" (commands used in the HDA protocol) until I found the minimum required to get the speakers working. This took me two weeks of messing with qemu from random git repos online, reading the HDA standard to understand what I'm working with and a lot of trial and error. A lot of that was pretty useless in the end as there are a lot of similar cases documented online.
Did you check out this thread on the kernel bugzilla? https://bugzilla.kernel.org/show_bug.cgi?id=208555
There are a lot of great hints buried between all those reports, mine included. (lately a lot about AMD versions of these laptops, just skim through it to find hints on Intel versions)
If you want to start tinkering check this post. https://docs.kernel.org/sound/hd-audio/notes.html
Newer intel platforms use the snd-sof driver instead of the snd-hda-intel one, the sof driver is required for mic support but does not have all the debugging capabilities of the snd-hda-intel one.
Start by reading up on other peoples experiences, then check out documentation on the kernel driver and debugging facilities. Try to use patch files and sysfs attributes to replicate the fixes for other laptops. Pay special attention to the pin configuration and hda-verbs for initialization.
Only then start tinkering with the kernel when you've got some initial success. Search for the patch_realtek.c
file in the kernel sources, where all the fixes for realtek codecs reside.
You can contact me by mail to get more details!
Hi!
I have faced the similar problem with Lenovo Yoga Pro 7 14IRH8. It was unable to control speaker volume using ALSA with sof-firmware. Sometimes volume control accidentally appeared after configuring Bluetooth headset but it was very unstable.
The final solution I used is quiet similar to this repo's. Just one line in snd.conf:
options snd-sof-intel-hda-common hda_model=alc287-yoga9-bass-spk-pin
I have found the solution here, and mine setup's behavior is the same. However I use newer 6.2 kernel version shipped with arch.
This is not the exact same problem as yours, but it is nearby. Hopefully, my comment will be helpful to someone.
Nice to know that there's a way to apply the hda model parameter to the snd-sof
based drivers. I should probably take this up into this repo. The legacy driver non-hda-sof
driver was already unable to handle the microphone of my model. I don't know whether the standard snd-hda-intel
driver is working at all for newer devices.
@glebpinigin Thank you for sharing!
Hi! thanks @glebpinigin for the tip! I got my mic and bass speakers working properly now!!
As another owner of the Lenovo Yoga 9 14IRPB, I want to add _Herzlichen Dank!__ to @PJungkamp and the others who contribute this great work, and test. (My Yoga died yesterday - some kind of no-charge/no-power/no-boot situation. Until that is repaired, I won't be able to test.) It had been running 23.04 quite well, excluding the issues discussed here.
I got my speakers working at Manjaro, with linux 6.6.
options snd-sof-intel-hda-common hda_model=17aa:38be
(or whatever is your model, which you can check with alsa-info
, but my guess is 17aa:38be
for the Slim Pro 9i and 17aa:38bf
for Yoga Pro 9i).I don't know if both are needed, so it would be useful to know what is exactly needed.
Also, I'm using KDE and the speakers only work if I first switch to "Play HiFi quality Music" profile, and I can only control the volume with the "Pro Audio" profile. Not sure how can I fix it and if this issue happens with Gnome too, so please tell me if you try it.
Finally, I think the repository https://github.com/darinpp/yoga-slim-7 contains useful things that would probably be helpful here (I'm almost sure the binary firmware there is from the same source).
btw, @PJungkamp how are you using the HPD sensor?
The HPD sensor is a very simple HID sensor that I had been able to monitor using the hid-sensor-prox
driver but a regression in Linux 6.6 an beyond broke hid-sensor-custom
which is needed to find the sensor device... so with current kernels you're out of luck.
My goal was to have the HPD sensor be easily accessible using iio-sensor-proxy
, but issues with the hid-sensor-prox
code upstream and some internals in iio-sensor-proxy
where a breaking change postponed MR had come to bite me.
I currently don't have too much time. Maybe I'll get back to it between semesters.
So the commits https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=sound-6.8-rc7&id=c1947ce61ff4cd4de2fe5f72423abedb6dc83011 and https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=sound-6.8-rc7&id=0ac32a396e4f41e88df76ce2282423188a2d2ed0 that are gonna be in 6.8, 6.7.9 and 6.6.21 should fix completely the sound issue with 14IRP8, including the weak sound and lack of volume control.
About the sensor, I think some patch was recently merged and your script find_sensors.fish
is showing the sensor information strings again in 6.7.4 and 6.8. I still don't understand how to integrate iio-sensor-proxy, though. I enabled the one with the VL53L1_HOD
sensor writing 1
manually to the enable_sensor
file and succeeded to read the HPD data using your rust program. Is it the way to enable it or iio-sensor-proxy is supposed to do it? what about the other sensors in the list, like Lenovo ST HPD v201 Sensor
and VL53L1
?
Well iio-sensor-proxy
is something that I haven't worked on in almost 2 years...
It became quite tiresome to integrate the changes there and while all the code there's no ETA for it being upstreamed (and it might have rotted away over the last year or so...).
But I'm still using my fork of iio-sensor-proxy right now and auto-brightness is working well.
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/364/commits
Apparently after update to 6.8 kernel solution with editing snd.conf stopped working for me. Update to 6.10 didn't fix anything. My laptop version is Yoga Pro 7 14IRH8.
I have the Yoga Pro 9 16IMH9, the device in alsa-info is 17aa:3811 and unfortunately the solution described above doesn't work
Hi.
I really appreciate your work. I have the same issue with the speakers on the 2023 model of the Pro 9. I already tried to fix it by applying https://github.com/PJungkamp/yoga9-linux/blob/main/config/etc/modprobe.d/snd.conf. But apparently, the speakers are wired a bit differently.
What steps do you recommend to get this working? I'm asking because you already fixed it before the fix was applied to the mainline.