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

[MTL] Attempting to sniff custom verbs, QEMU HDA passthrough not working #5026

Open
arter97 opened this issue May 29, 2024 · 9 comments
Open

Comments

@arter97
Copy link

arter97 commented May 29, 2024

Related: #5002, #5006

Hi, I'm currently trying to fix speakers for ALC298 used in Galaxy Book4 Pro.

The Linux kernel currently has a Samsung-specific ALC298 verbs ( https://lore.kernel.org/alsa-devel/[email protected]/ ) that fixes speakers for older models, but it is not compatible with the Galaxy Book4 Pro.

To get the appropriate verbs on this specific device, I'm following https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html 's "Reverse-engineer the Windows audio driver" section.

The ASUS Linux blog allowed me to dump the codec states, but not the appropriate verb commands to reach such states, so no luck there.

With QEMU, I believe I'm running into a Meteor-lake-specific issue where the Intel OED (1f.3) fails to initialize. I've tried multiple QEMU versions and Linux kernel host versions, but no luck.

I get Code 43 in Device Manager with “FW dump detected”. In the Event Viewer, I get "Set DSP state. Firmware crashed (noncontinuable exception) - resetting., STATUS = {exception}".

The guest disk image is a real NVMe device, and booting it natively of course have speakers working.

Passing through other devices alongside 1f.3 didn’t work. I've tried passing through devices in bold here:
00:00.0 Host bridge [0600]: Intel Corporation Device [8086:7d14] (rev 04)
00:02.0 VGA compatible controller [0300]: Intel Corporation Meteor Lake-P [Intel Arc Graphics] [8086:7d55] (rev 08)
00:04.0 Signal processing controller [1180]: Intel Corporation Device [8086:7d03] (rev 04)
00:05.0 Multimedia controller [0480]: Intel Corporation Device [8086:7d19] (rev 04)

00:06.0 PCI bridge [0604]: Intel Corporation Device [8086:7e4d] (rev 20)
00:07.0 PCI bridge [0604]: Intel Corporation Meteor Lake-P Thunderbolt 4 PCI Express Root Port #0 [8086:7ec4] (rev 02)
00:07.1 PCI bridge [0604]: Intel Corporation Meteor Lake-P Thunderbolt 4 PCI Express Root Port #1 [8086:7ec5] (rev 02)
00:08.0 System peripheral [0880]: Intel Corporation Device [8086:7e4c] (rev 20)
00:0a.0 Signal processing controller [1180]: Intel Corporation Device [8086:7d0d] (rev 01)
00:0b.0 Processing accelerators [1200]: Intel Corporation Meteor Lake NPU [8086:7d1d] (rev 04)
00:0d.0 USB controller [0c03]: Intel Corporation Meteor Lake-P Thunderbolt 4 USB Controller [8086:7ec0] (rev 02)
00:0d.2 USB controller [0c03]: Intel Corporation Meteor Lake-P Thunderbolt 4 NHI #0 [8086:7ec2] (rev 02)
00:12.0 Serial controller [0700]: Intel Corporation Device [8086:7e45] (rev 20)
00:14.0 USB controller [0c03]: Intel Corporation Meteor Lake-P USB 3.2 Gen 2x1 xHCI Host Controller [8086:7e7d] (rev 20)
00:14.2 RAM memory [0500]: Intel Corporation Device [8086:7e7f] (rev 20)
00:14.3 Network controller [0280]: Intel Corporation Meteor Lake PCH CNVi WiFi [8086:7e40] (rev 20)
00:15.0 Serial bus controller [0c80]: Intel Corporation Meteor Lake-P Serial IO I2C Controller #0 [8086:7e78] (rev 20)
00:15.1 Serial bus controller [0c80]: Intel Corporation Meteor Lake-P Serial IO I2C Controller #1 [8086:7e79] (rev 20)
00:15.2 Serial bus controller [0c80]: Intel Corporation Meteor Lake-P Serial IO I2C Controller #2 [8086:7e7a] (rev 20)
00:15.3 Serial bus controller [0c80]: Intel Corporation Meteor Lake-P Serial IO I2C Controller #3 [8086:7e7b] (rev 20)
00:16.0 Communication controller [0780]: Intel Corporation Device [8086:7e70] (rev 20)

00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:7e38] (rev 20)
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:7e02] (rev 20)
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Meteor Lake-P HD Audio Controller [8086:7e28] (rev 20)
00:1f.4 SMBus [0c05]: Intel Corporation Meteor Lake-P SMBus Controller [8086:7e22] (rev 20)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Meteor Lake-P SPI Controller [8086:7e23] (rev 20)

01:00.0 Non-Volatile memory controller [0108]: SK hynix Platinum P41/PC801 NVMe Solid State Drive [1c5c:1959]
56:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO [144d:a80a]

Booting a Linux guest seemed to indicate an issue with ACPI NHLT table, so I've even went ahead and modified QEMU to feed the host's NHLT table, but still no luck with Windows.

I understand that this is not a SOF issue and is rather the "infamous I2C amp over HDA needing custom vendor-specific verbs", but I'm stuck as QEMU guest is not initializing sound properly.

Can anyone give some additional pointers here?

I've attached alsa-info.txt as well:
alsa-info.txt

Thanks.

@plbossart
Copy link
Member

I am not sure if the Intel OED driver is required in your case @arter97, what happens if you use the default Microsoft in-box driver to control the HDaudio controller and codec?

@arter97
Copy link
Author

arter97 commented Jun 3, 2024

@plbossart Thanks, I've tried your approach but still no luck.

The result's a bit interesting though; If I boot with no Intel OED drivers present, the HD audio controller doesn't appear to the system at all. If I boot with Intel OED drivers present and enabled and then disable it, a different HD audio controller (HDAUDIO\FUNC_01&VEN_10EC&DEV_0298&SUBSYS_144DC890) appears with no drivers installed.

Now, if this is a native install, force-installing Samsung drivers (HDXSamsung.inf) on it (it warns me due to different PCI ID) makes the audio work.

From QEMU, I can see 1f.3 vfio traffic and Windows show a normally operating audio device but no actual sound is coming out. Consequently, using the verbs extracted from that still doesn't produce a working speaker in Linux.

So from what I can gather, a properly operating Intel OED device is required to setup the HD audio controller, and I'm back to square one :(

Any other tips that I can probably try? Thanks.

@plbossart
Copy link
Member

I am reasonably confident the OED driver is NOT needed, if you take a new Windows install without any audio drivers the Microsoft in-box driver should just work - albeit with the DSP disabled/not used.

@arter97
Copy link
Author

arter97 commented Jun 5, 2024

I am reasonably confident the OED driver is NOT needed, if you take a new Windows install without any audio drivers the Microsoft in-box driver should just work - albeit with the DSP disabled/not used.

An audio controller (INTELAUDIO\FUNC_01&VEN_10EC&DEV_0298&SUBSYS_144DC890&REV_1001) is not present when I do not install any drivers at all. The device manager asks me to install a driver for 1f.3 (PCI\VEN_8086&DEV_7E28&SUBSYS_C890144D&REV_20), and when I force-install Microsoft's "High Definition Audio device", I get code 10 error saying "Unsupported operation".

When I force-install a Realtek driver (both Windows-integrated one or one provided by my OEM - Samsung), I get a BSOD with SYSTEM_THREAD_EXCEPTION_NOT_HANDLED from RTKVHD64.sys.

Is there any other way I can expose the audio device without relying on OED?

@plbossart
Copy link
Member

I am afraid I can't help on such Windows low-level details, sorry.

@PowerKiKi
Copy link

@arter97, sorry for the slightly out of topic question, but does your webcam work on Linux on your Galaxy Book4 Pro ?

@arter97
Copy link
Author

arter97 commented Jul 9, 2024

@arter97, sorry for the slightly out of topic question, but does your webcam work on Linux on your Galaxy Book4 Pro ?

Yes, I fixed it: intel/ipu6-drivers#230

@PowerKiKi
Copy link

Oh this is great news, thank for you work ! ❤️ I assume, it should also work on the Galaxy Book 4 Ultra, right ? 🤞

Are you still working on sniffing the verbs to fix the audio ? Do you think it could be solvable in the coming months ? I'm considering buying the Book 4 Ultra, and I can live with only headphone for a while, but would be nice if we can have sound at some point later...

@arter97
Copy link
Author

arter97 commented Jul 9, 2024

Oh this is great news, thank for you work ! ❤️ I assume, it should also work on the Galaxy Book 4 Ultra, right ? 🤞

No clue, but the screen chassis looks identical, so most likely yes.

Are you still working on sniffing the verbs to fix the audio ? Do you think it could be solvable in the coming months ? I'm considering buying the Book 4 Ultra, and I can live with only headphone for a while, but would be nice if we can have sound at some point later...

Nope, I'm stuck at a dead end. I need a fix for this very issue until processing any further (which will still be a hassle, cleaning up the verbs, etc).

I still think this OED driver failure under VM is a Meteorlake-specific issue, not Samsung's, so as more Meteorlake devices (maybe Dell?) don't work under Linux and get more attention, this may progress further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants