-
Notifications
You must be signed in to change notification settings - Fork 16
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
Issue compiling on Linux 6.12.1 #46
Comments
Hi @observantdragon thank you for reporting this! This method I created to fetch the fan "description" is not super clean IMO and I would rather that there would be a standard ACPI method like What I did in the meantime was basically copied their In the end it is not super critical but I just thought it would be nice to take the Fan device description from the ACPI as in some newer models Samsung has actually used this to give nicer names (e.g. "CPU Fan" and "GPU Fan" etc) so to me it was best case to use these descriptions as the fan labels for when you monitor the speeds via hwmon. Anyway I make a correction to follow how the maintainers changed this in 6.12 but I only put it in the branch which I am prepping for a mainline patch. Would you mind to take a look at the information here and test with the branch that is mentioned there? #44 Do note that some of the sysfs interface will change and you can also take a look at using udev vs not in case that is important to you :) All of that info is written in the PR.. Incidentally I have still not found any branch or RC of 6.12 I was able to actually install as of yet, every one I have tried I hit this same bug: https://bugs.launchpad.net/ubuntu/+source/backport-iwlwifi-dkms/+bug/2083994 / https://bugs.launchpad.net/ubuntu/+source/backport-iwlwifi-dkms/+bug/2085453 But I did test this change now against 6.5.x and 6.11.3 and it seems to be working for me in both, plus it matches what the ACPI maintainers did now in 6.12 so I feel pretty good that this part should be working better now? |
Regarding your headphone jack issue, this sounds like the same issue which exists on other models and there is potentially already a fix for it (just would need to add your device ID to the quirk table). Can you try something like this:
And then reboot or even power off/power on? If this works well let me know if you want/need help that I can submit a kernel patch for you (otherwise you are of course welcome to submit one yourself!!). And then if/when your device is added to the quirk table there, you would be able to remove the file |
Yup, I can confirm that it now works again on 6.12.1 on arch for me. Indeed, agreed regarding the fan names. I have tested that the battery charge limit and keyboard functions work. |
This didn't work for me. I haven't looked into this issue in a while since it doesn't really bother me but this took me on a bit of a rabbit hole. My device actually shows up as ALC256 and not ALC298
I looked into /pci/hda/patch_realtek.c and found that it has the following models
I tried using alc256-samsung-headphone but that did not work either. Then I noticed that while there is no alc298-samsung-headphone model, alc298-samsung-amp seems to implement a different headphone fix
which applies the following verb:
which is different from the alc256 verbs for the same issue. If I manually apply the verbs from the alc298 verbs fix which other 3rd gen GalaxyBooks seem to use on my model with 256 with. headphone output now works perfectly, however with the caveats that
I attempted to create a firmware patch:
and load it: but that did not work after a reboot. I feel like it somehow resets to the original state when playback stops, likely due to power management or something. I then tried both
and this fixed the issue completely but no longer uses sof-firmware obviously, so the internal mic stops working. I also think the 3.5mm jack mic is also always very low but have not looked into that yet. I might be able to fix it with some more investigation and a kernel patch but let me know if you have any thoughts. |
I've now found out that I can fix the headphones by running. So presumably adding my device to |
Thanks @observantdragon and good that you could confirm this :) I actually was sort of thinking that is probably what it would be based on what you described, but there is not an existing device / "model name" in patch_realtek that gives only that (only the ones that give the headphone fix AND some speaker amp fixes).. as a guess/hope I asked you to try the one that gave both (which seems like it did not work?) so yes the right course of action would be to add your device / subdevice ID to the quirk table with only ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET I think (and/or a new name under ALC256 that is an alias / points to the same function). If you want then I can help prepare a patch for this otherwise you can feel free to take it as a challenge for yourself , just let me know if you want me to do anything :) |
It did not work via setting it via
Already got the draft patch ready! Just wanted to investigate the headphone mic quality first and compare some things with Windows. Although I realise now that this might just be my headset. One thing I did notice with On another note, I don't use these but the lock trackpad and disable mic and camera keys do not seem to work for me even with the layout file. Not sure if they are supposed to. My device is set to need the FN + modifier for those. Power management on my device seems pretty good around 7 to 10 hours for a 13.3 device with an OLED panel and generally much better than Windows. Let me know if you would like the DSDT of this machine. |
@observantdragon I think in this case it might be a good opportunity to use Disable any kind of script/patch in Linux and then power off totally, then power back on, then you can check the value of all of the same pins and coeffs in Linux and compare what is in the value dumps from Windows vs the values you see in Linux. Sort of like this (assuming right path for your device/codec): echo 1 | sudo tee /sys/module/snd_hda_codec/parameters/dump_coef
cat /proc/asound/card0/codec#0 Hopefully it will be very clear what the value is for this coeff in the Windows dumps and very clear that it is NOT that value in Linux; then just try making the value match (e.g. using From there it is to figure out how to weave that into patch_realtek.c in the right way so that it matches your device and applies the right fix :) |
@joshuagrisham That is a good idea, I'll look into capturing it from Windows and comparing. On another note, I was wrong about the block recording key not working, it does work, I just assumed it would disconnect the devices but it just makes the output black (for the webcam). Additionally I also noticed the following in dmesg
Are the ACPI errors to be expected? My laptop has only one fan. Another quirk I noticed is if I moprobe -r |
@joshuagrisham Regarding the coeffs on Windows, I looked into it and there are only a few differences between windows and linux, however changing them in Linux does not fix any issue. There are no differences on either windows and linux, whether the headset is plugged in or not or whether sound is playing or not. I went through what I found here and the Applying this seems to change to pin-ctls of the Amp from
Also the headphone mic in jack always worked even without a fix, this issue was with my headset and also present on Windows, a different headset works! So I'm going to go ahead with sending a patch. |
Hi again! The value you are seeing is basically what it "looks like" their code would return, if it did not have this exception. No idea if this is a true-to-life RPM value, just reporting what it looks like it should report in case the bug did not exist :) Regarding your keyboard stopping to work when you remove the module -- I have heard a similar report to this and was never able to look into it more or get more details. If you have any other debug information you might be able to provide about this, it would be appreciated! It might be that if you disable the i8042_filter then you will not have this problem, but then some of the hotkey actions will not work automatically (e.g. you will need to rig up your own actions based on the hotkeys, including adjusting kbd backlight level etc). |
I did not follow 100% of the thread here but it sounds like you have a good grasp on what is going on here and what needs to be fixed. Great, go forth and conquer, I say! |
That's what I would have guessed since a lot of laptops have ACPI and UEFI quirks.
I haven´t looked much into it but I don't have this problem with
|
Hi @observantdragon The suggestion is to only use Note also that using Another option is if you configure your kernel to include i8042 instead of building it as a module ( |
Indeed, and yeah I saw their response on the mailing list. Hopefully there won't be a need to rmod, it is just something I noticed. |
I am glad you reported it as there have been other reports of exactly this same behavior and I was not able to connect the dots until this additional information from you, so thank you for that! 🍻 |
Hi,
I have been using your driver for the past few months on a book 3 360 13.3 inch, non pro (NP730QFG) which appears as SAM0429. I have had no issues with it on prior versions of the kernel before 6.12. Since the upgrade to 6.12 the compile fails on archlinux.
Additionally since I have not seen much feedback for this model, I just wanted to mention that it works for me. However on this model I have the opposite issue that everyone seems to be reporting regarding audio on samsung notebooks. My internal speakers work fine with no workarounds, however the headphone jack does not work properly. The headphones are detected and auto mute the internal speakers but there is "no" audio from the headphones. Increasing the volume to the maximum though does have some audio play extremely faint and distorted through some headphones. I had tried the script that was mentioned elsewhere as a workaround but running that script just hangs and does not solve the issue.
Other than that the fingerprint reader does not work (Canvas Bio CB200), and without the driver, the keyboard backlight turns to max brightness if it was set at any level in windows (off otherwise). HDR works fine as well on gamescope and kwin.
Amazing work btw, really appreciate the effort! I'm happy to test anything you may need for this device if needed (if I can compile it on arch). But I assume the LTS kernel should work.
Here is the dkms log for the compile issue:
DKMS make.log for samsung-galaxybook-extras for kernel 6.12.1-arch1-1 (x86_64) make: Entering directory '/usr/lib/modules/6.12.1-arch1-1/build' CC [M] /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.o /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c: In function ‘get_acpi_device_description’: /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:256:26: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 256 | if (acpi_dev->pnp.str_obj != NULL && acpi_dev->pnp.str_obj->buffer.length > 0) { | ^ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:256:59: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 256 | if (acpi_dev->pnp.str_obj != NULL && acpi_dev->pnp.str_obj->buffer.length > 0) { | ^ In file included from ./include/linux/percpu.h:5, from ./arch/x86/include/asm/msr.h:15, from ./arch/x86/include/asm/tsc.h:10, from ./arch/x86/include/asm/timex.h:6, from ./include/linux/timex.h:67, from ./include/linux/time32.h:13, from ./include/linux/time.h:60, from ./include/linux/stat.h:19, from ./include/linux/module.h:13, from /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:15: /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:257:65: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 257 | char *buf = kzalloc(sizeof(*buf) * acpi_dev->pnp.str_obj->buffer.length, GFP_KERNEL); | ^ ./include/linux/alloc_tag.h:206:16: note: in definition of macro ‘alloc_hooks_tag’ 206 | typeof(_do_alloc) _res = _do_alloc; \ | ^~~~~~~~~ ./include/linux/slab.h:1016:49: note: in expansion of macro ‘alloc_hooks’ 1016 | #define kzalloc(...) alloc_hooks(kzalloc_noprof(__VA_ARGS__)) | ^~~~~~~~~~~ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:257:29: note: in expansion of macro ‘kzalloc’ 257 | char *buf = kzalloc(sizeof(*buf) * acpi_dev->pnp.str_obj->buffer.length, GFP_KERNEL); | ^~~~~~~ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:257:65: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 257 | char *buf = kzalloc(sizeof(*buf) * acpi_dev->pnp.str_obj->buffer.length, GFP_KERNEL); | ^ ./include/linux/alloc_tag.h:206:34: note: in definition of macro ‘alloc_hooks_tag’ 206 | typeof(_do_alloc) _res = _do_alloc; \ | ^~~~~~~~~ ./include/linux/slab.h:1016:49: note: in expansion of macro ‘alloc_hooks’ 1016 | #define kzalloc(...) alloc_hooks(kzalloc_noprof(__VA_ARGS__)) | ^~~~~~~~~~~ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:257:29: note: in expansion of macro ‘kzalloc’ 257 | char *buf = kzalloc(sizeof(*buf) * acpi_dev->pnp.str_obj->buffer.length, GFP_KERNEL); | ^~~~~~~ ./include/linux/alloc_tag.h:212:1: error: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 212 | ({ \ | ^ ./include/linux/slab.h:1016:49: note: in expansion of macro ‘alloc_hooks’ 1016 | #define kzalloc(...) alloc_hooks(kzalloc_noprof(__VA_ARGS__)) | ^~~~~~~~~~~ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:257:29: note: in expansion of macro ‘kzalloc’ 257 | char *buf = kzalloc(sizeof(*buf) * acpi_dev->pnp.str_obj->buffer.length, GFP_KERNEL); | ^~~~~~~ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:259:49: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 259 | (wchar_t *)acpi_dev->pnp.str_obj->buffer.pointer, | ^ /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.c:260:38: error: ‘struct acpi_device_pnp’ has no member named ‘str_obj’ 260 | acpi_dev->pnp.str_obj->buffer.length, | ^ make[2]: *** [scripts/Makefile.build:229: /var/lib/dkms/samsung-galaxybook/extras/build/samsung-galaxybook.o] Error 1 make[1]: *** [/usr/lib/modules/6.12.1-arch1-1/build/Makefile:1936: /var/lib/dkms/samsung-galaxybook/extras/build] Error 2 make: *** [Makefile:224: __sub-make] Error 2 make: Leaving directory '/usr/lib/modules/6.12.1-arch1-1/build'
The text was updated successfully, but these errors were encountered: