joshuagrisham / galaxy-book2-pro-linux

Notes and utilities for running Linux on the Samsung Galaxy Book2 Pro
115 stars 10 forks source link

Linux on the Samsung Galaxy Book2 Pro

I am running Ubunutu 23.04 (previously 22.10) with the Ubuntu-packaged kernel version 6.2.x on my Samsung Galaxy Book2 Pro (NP950XED-KA2SE). This repository contains various notes on different configurations and custom drivers which I am using.

$ sudo dmesg
[    0.000000] microcode: microcode updated early to revision 0x42c, date = 2023-04-18
[    0.000000] Linux version 6.2.0-34-generic (buildd@lcy02-amd64-025) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.40) #34-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep  4 13:06:55 UTC 2023 (Ubuntu 6.2.0-34.34-generic 6.2.16)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.2.0-34-generic root=UUID=048b3a23-f56e-4447-8d23-59f889235454 ro quiet splash i915.enable_dpcd_backlight=3 vt.handoff=7
...
[    0.000000] DMI: SAMSUNG ELECTRONICS CO., LTD. 950XED/NP950XED-KA2SE, BIOS P11RGF.057.230404.ZQ 04/04/2023
...

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:    23.04
Codename:   lunar

In order to install Linux on the laptop you will need to adjust the BIOS setting for Secure Boot to either

Linux Platform Driver

I have created the start of a Linux Kernel platform driver for the device called "Samsung Galaxybook" which you can find here: https://github.com/joshuagrisham/samsung-galaxybook-extras

It is likely that this driver can actually support many of the recent Samsung Galaxy Book series notebooks (not just the Galaxy Book2 Pro like I have).

With this driver, there is expected to be the possibility to control at least the following features:

Display Backlight

To add support for controlling the OLED display backlight you can add the following boot parameter: i915.enable_dpcd_backlight=3

For example with Grub you would modify the file /etc/default/grub and add it to the GRUB_CMDLINE_LINUX_DEFAULT value, run sudo update-grub, and then reboot.

I have created an issue to try and drive an upstream fix here: freedesktop.org: Wrong backlight control type on Samsung Galaxy Book 2 Pro.

Fingerprint Reader

A draft libfprint driver is available for this device. See fingerprint/libfprint.md for information on how to download, test, and install it. Hopefully it will be merged in soon!

Background:

I have opened an issue with the libfprint project for support for this device (see libfprint: EGIS 1C7A:0582 support for Samsung Galaxy Book2 Pro) and have done the following:

Sound

Audio works over bluetooth, with the 3.5mm audio jack, or with the USB-A or C ports, but not out-of-the-box with the speakers.

Huge caveat here: read and test the below at your own risk! No idea if this can or should work, and there have been reports of "funny smells", "funny sounds", and speakers stopping to work entirely. You have been warned!

There is quite a bit of discourse online about this issue, IMO the best collection of information is in this Github Issue posted on the SOF project here: https://github.com/thesofproject/linux/issues/4055 (including a reference to the Manjaro thread here: https://forum.manjaro.org/t/howto-set-up-the-audio-card-in-samsung-galaxy-book/37090)

There I have even posted a pastebin of my file necessary-verbs.txt.

If you like, you can run the script necessary-verbs.sh to "turn on" the speakers but note that you will need to run this periodically and/or create some kind of service that runs it in the background on certain events or a certain schedule (a bit like is shown in the Manjaro thread linked above).

Some of the config files and other logs from my capturing of this list (essentially: running Windows in a QEMU container, mapping the audio devices to the QEMU container, installing the audio drivers within the virtual Windows environment, playing sound from within the QEMU container, and capturing the output into a log file) you can find in the sound folder of this repository.

TODO how to continue narrowing down the necessary verb list and then package it for an upstream patch?

Battery

I typically get around 5-7 hours of battery life in Linux. Here are some tips:

Using a Thunderbolt Dock

There is only one Thunderbolt port on this laptop (USB-C port closer to the front, by the power/charging light). Even when using this port I have had some intermittent problems and can give a few tips:

I have also actually had some success driving a dock from the non-Thunderbolt port of this device (the USB-C port closer to the back, by the full-size HDMI port) as long as you make sure to connect the display to an HDMI port of the dock (and not a DisplayPort), and add the following kernel boot parameters:

(For example by updating /etc/default/grub, running update-grub, and rebooting)

This works pretty well if you boot the kernel with the cable already connected, but it can be a little tricky to force the display to come on if you connect afterwards (you basically have to enable/disable output multiple times in a certain sequence before it will come on). And also in this case, it can help to lower the refresh rate.