NixOS / nixos-hardware

A collection of NixOS modules covering hardware quirks.
Creative Commons Zero v1.0 Universal
1.72k stars 543 forks source link

[ Surface Pro 6 ] No sound on NixOS 24.05 #970

Open balintbarna opened 2 weeks ago

balintbarna commented 2 weeks ago

After upgrading my flake based setup to nixos-24.05 and also upgrading NixOS Hardware to the latest version the built-in speaker and microphone disappears. Removing the import of the nixos-hardware module changes to the default kernel where the sound works fine again, however I lose the other features, such as touch and camera.

balintbarna commented 2 weeks ago

@mexisme hope you might have some ideas

mexisme commented 2 weeks ago

After upgrading my flake based setup to nixos-24.05 and also upgrading NixOS Hardware to the latest version the built-in speaker and microphone disappears. Removing the import of the nixos-hardware module changes to the default kernel where the sound works fine again, however I lose the other features, such as touch and camera.

I had the same problem this week on my Surface Go, and discovered that the driver for my camera no longer works. This also seems to cause WirePlumber to crash on starting, which means sound no longer works in any shell that needs it ... which I think is "all of them" these days?

Reports online seem to suggest a regression in more recent kernels (around late 6.7.x, from memory) and a few patches, but I haven't had a chance to try them.

However, it also seems weird that this change would be caused by NixOs 24.05, as nixos-hardware is not version-dependent, I believe?

mexisme commented 2 weeks ago

@mexisme hope you might have some ideas

This is the reference I found about the camera:

I will try to test whether this helps me.

Do you think you would also be able to investigate if it might be related to your issue, as well, @balintbarna ?

mexisme commented 2 weeks ago

After upgrading my flake based setup to nixos-24.05 and also upgrading NixOS Hardware to the latest version the built-in speaker and microphone disappears. Removing the import of the nixos-hardware module changes to the default kernel where the sound works fine again, however I lose the other features, such as touch and camera.

FYI: It may also be related to needing to provide a quirk param to the snd-hda driver; this is a very common difficulty, I'm afraid, e.g:

And the reason I mention this is I did discover that there were several updates and quirks added to the snd-hda-intel driver in 6.7, e.g:

balintbarna commented 2 weeks ago

I don't really know how to test these things. My biggest issue is the lack of sound on surface-linux, I didn't even get as far as to test the cameras. If you can provide me with a couple of lines to test in my nix config I can run it and tell you if it works or not, but I don't know what changes to make on my own.

mexisme commented 2 weeks ago

I don't really know how to test these things.

Ah, ok.

My biggest issue is the lack of sound on surface-linux, I didn't even get as far as to test the cameras. If you can provide me with a couple of lines to test in my nix config I can run it and tell you if it works or not, but I don't know what changes to make on my own.

I've just seen that https://github.com/llinux-surface/linux-surface has some new support for kernel 6.9, which suggests there might be some fixes available. Kernel 6.9.x had quite a few important fixes, IIRC, so this is probably worth looking at, anyway.

I'll try to build with this new kernel over the next few days, and see if it fixes my problems; if it does, then will raise a PR and some instructions on how you might be able to test it yourself?

// @balintbarna

mexisme commented 2 weeks ago

I don't really know how to test these things.

Ah, ok.

My biggest issue is the lack of sound on surface-linux, I didn't even get as far as to test the cameras. If you can provide me with a couple of lines to test in my nix config I can run it and tell you if it works or not, but I don't know what changes to make on my own.

I've just seen that https://github.com/llinux-surface/linux-surface has some new support for kernel 6.9, which suggests there might be some fixes available. Kernel 6.9.x had quite a few important fixes, IIRC, so this is probably worth looking at, anyway.

I'll try to build with this new kernel over the next few days, and see if it fixes my problems; if it does, then will raise a PR and some instructions on how you might be able to test it yourself?

// @balintbarna

Oops, nevermind. I see that @stigtsp merged an update to kernel 6.9.3 yesterday.

(Thanks for that, btw, @stigtsp!)

balintbarna commented 2 weeks ago

I tested with the new kernel and still have no sound. The built-in devices just don't show up as an option. I'm not sure what to look for exactly. I see some wireplumber crashes and error messages, and one of them was making a reference to libcamera and others are always around bluetooth errors. I don't know if that's related at all. Otherwise I'm not sure how to go about debugging. @mexisme @stigtsp

wireplumber[1620]: segfault at 0 ip 00007f93e3f23aaf sp 00007f93d7dff110 error 4 in libcamera.so.0.2.0[7f93e3f04000+b8000] likely on CPU 0 (core 0, socket 0)
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_chrc() Failed to create characteristic entry in database
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_service() Failed to add characteristic
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_app() Failed to add service
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:client_ready_cb() Failed to create GATT service entry in local database
jun 14 17:31:27 balint-surfacepro wireplumber[2068]: spa.bluez5.midi.server: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: Fa>
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/aptx_hd
jun 14 17:31:27 balint-surfacepro systemd[1749]: wireplumber.service: Main process exited, code=dumped, status=11/SEGV
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/aptx_hd
jun 14 17:31:27 balint-surfacepro systemd[1749]: wireplumber.service: Failed with result 'core-dump'.
lVentus commented 5 days ago

我确实不知道如何测试这些东西。

喔好吧。

我最大的问题是 Surface Linux 上没有声音,我甚至还没来得及测试摄像头。如果你能提供几行代码让我在我的 nix 配置中进行测试,我可以运行它并告诉你它是否有效,但我不知道自己该做哪些更改。

我刚刚看到https://github.com/llinux-surface/linux-surface对内核 6.9 提供了一些新支持,这表明可能有一些修复可用。 内核 6.9.x 有相当多的重要修复,如果我没记错的话,所以无论如何,这可能值得一看。

我将在接下来的几天内尝试使用这个新内核进行构建,看看它是否能解决我的问题;如果能,那么是否会提出一个 PR 并提供一些关于如何自己测试它的说明?

//@balintbarna Sorry, my question is not related to this question, but it is also a problem with surface. When I use the configuration of surface in nixos-hardware directly. Once I enable service.iptsd.enable (because I want to enable disableOnPalm), then all finger touch screens in gtk cannot work. But when I use the following configuration instead of nixos-hardware, this problem is solved, so I think there should be some problem with the wurface part of nixos-hardware.

I don't really know how to test these things.

Ah, ok.

My biggest issue is the lack of sound on surface-linux, I didn't even get as far as to test the cameras. If you can provide me with a couple of lines to test in my nix config I can run it and tell you if it works or not, but I don't know what changes to make on my own.

I've just seen that https://github.com/llinux-surface/linux-surface has some new support for kernel 6.9, which suggests there might be some fixes available. Kernel 6.9.x had quite a few important fixes, IIRC, so this is probably worth looking at, anyway. I'll try to build with this new kernel over the next few days, and see if it fixes my problems; if it does, then will raise a PR and some instructions on how you might be able to test it yourself? // @balintbarna

Oops, nevermind. I see that @stigtsp merged an update to kernel 6.9.3 yesterday.

(Thanks for that, btw, @stigtsp!)

Sorry, my question is not related to this question, but it is also a problem with surface. When I use the configuration of surface in nixos-hardware directly. Once I enable service.iptsd.enable (because I want to enable disableOnPalm), then all finger touch screens in gtk cannot work. But when I use the following configuration instead of nixos-hardware, https://github.com/NixOS/nixpkgs/issues/240612#issuecomment-1635859341 this problem is solved, so I think there should be some problem with the wurface part of nixos-hardware.

mexisme commented 2 days ago

I tested with the new kernel and still have no sound. The built-in devices just don't show up as an option. I'm not sure what to look for exactly. I see some wireplumber crashes and error messages, and one of them was making a reference to libcamera and others are always around bluetooth errors. I don't know if that's related at all. Otherwise I'm not sure how to go about debugging. @mexisme @stigtsp

wireplumber[1620]: segfault at 0 ip 00007f93e3f23aaf sp 00007f93d7dff110 error 4 in libcamera.so.0.2.0[7f93e3f04000+b8000] likely on CPU 0 (core 0, socket 0)
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_chrc() Failed to create characteristic entry in database
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_service() Failed to add characteristic
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:database_add_app() Failed to add service
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: src/gatt-database.c:client_ready_cb() Failed to create GATT service entry in local database
jun 14 17:31:27 balint-surfacepro wireplumber[2068]: spa.bluez5.midi.server: org.bluez.GattManager1.RegisterApplication() failed: GDBus.Error:org.bluez.Error.Failed: Fa>
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSink/aptx_hd
jun 14 17:31:27 balint-surfacepro systemd[1749]: wireplumber.service: Main process exited, code=dumped, status=11/SEGV
jun 14 17:31:27 balint-surfacepro bluetoothd[1111]: Endpoint unregistered: sender=:1.88 path=/MediaEndpoint/A2DPSource/aptx_hd
jun 14 17:31:27 balint-surfacepro systemd[1749]: wireplumber.service: Failed with result 'core-dump'.

Yeah, the new kernel didn't fix my camera for me either — wireplumber is still crashing in the same way. Some additional googling suggested it might be because the firmware for the camera has been renamed in a way that might be causing this.

I'll try to investigate further this week.

stigtsp commented 2 days ago

I don't have the Surface Pro hardware, so unable to help debug this. Maybe bumping to 6.9.6 will help?

balintbarna commented 1 day ago

I’m happy to debug if someone can support me in changing my configuration