Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on Steam deck
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Wed Sep 28, 2022 6:44 am    Post subject: Gentoo on Steam deck Reply with quote

This thread documents the SteamDeck related things and my installation status.
I hope I can help other users to get Gentoo working on the device and of course hope for the hints I can better do on my device.
I do not describe steps from Gentoo Handbook, just some notes. Please use the Gentoo Handbook for installation.


Enter EFI Bootloader
Power-Off, Hold VOL- key and then power on (VOL+ is enter EFI BIOS).


Disk Formatting
The disk is formatted GPT, the SteamDeck OS contains 8x partitions. The last one, /home, can be shrinked.
I shrinked /home and created 3 new partitions for gentoo:
Code:
/dev/nvme0n1p9         /               ext4            noatime         0 1
/dev/nvme0n1p10        /boot           vfat            noauto,noatime  1 2
/dev/nvme0n1p11        none            swap            sw              0 0

After partition creation and formatting the SteamDeck OS can be launched in Desktop mode. I did the installation from this linux instead of live linux.


Kernel and configuration
The minimum version recommended is Linux-6.1. I recommend to use newest testing version since each version contains improvements for SteamDeck.
Just for reference: I use the gentoo-kernel ebuild. Created sys-kernel/neptune-sources ebuild for Valve kernel in my (bell07) overlay. But since I did not found any advantage I returned to the gentoo-kernel. Therefore the sys-kernel/neptune-sources maybe outdated.

The Valve kernel configuration adjustments file config-neptune could be found at https://gitlab.com/evlaV/jupiter-PKGBUILD/-/tree/master/linux-neptune-68 (or maybe higher number exists).
My configuration snippet (with some additional ajdustments) can be found at https://github.com/bell07/bashscripts-kernel_cfg/blob/master/cfg/30_enable_steamdeck_device.config and installed using sys-kernel/kernel-cfg from my overlay.


Kernel command line
The Steam Deck kernel parameters can be found at https://gitlab.com/evlaV/jupiter-hw-support/-/blob/master/etc/default/grub-steamos
I use the next line, based on this parameters
Code:
rootwait root=/dev/nvme0n1p9 resume=/dev/nvme0n1p11 console=tty1 fbcon=rotate:1 quiet amd_iommu=off amdgpu.gttsize=8128 amdgpu.lockup_timeout=5000,10000,10000,5000 amdgpu.sched_hw_submission=4 tsc=directsync audit=0 clearcpuid=514



Bootloader
To configure and use the builtin EFI bootloader the efibootmgr can be used.
For testing reason I installed in addition sys-boot/refind. By default a keyboard emulation is enabled on boot. The gaming arrow keys are mapped to keyboard arrow keys and the A is mapped to Enter and more. Therefore this bootmanager is fully usable. One thing is the missed screen rotation.
I think grub or any other bootmanager should be usable in the same way too


Framebuffer on boot
I like the right framebuffer in early boot, so I built the driver and firmware into the kernel:
Code:
CONFIG_DRM=y
CONFIG_DRM_AMDGPU=y
CONFIG_EXTRA_FIRMWARE="amdgpu/vangogh_asd.bin amdgpu/vangogh_ce.bin amdgpu/vangogh_dmcub.bin amdgpu/vangogh_me.bin amdgpu/vangogh_mec2.bin amdgpu/vangogh_mec.bin amdgpu/vangogh_pfp.bin amdgpu/vangogh_rlc.bin amdgpu/vangogh_sdma.bin amdgpu/vangogh_toc.bin amdgpu/vangogh_vcn.bin"


Wifi
Since kernel 6.4 the In-Kernel driver CONFIG_RTW88_8822CE does work stable for me.
Previously I used lwfinger rtw88 driver because the connection is not stable. The ebuild net-wireless/rtw88 can be found in my (bell07) overlay.


Audio/Sound
For Audio the next kernel modules are used:
Code:
# Builtin Speaker
CONFIG_SND_SOC_AMD_ACP5x=m

# Audio trough HDMI
CONFIG_SND_SOC_CS35L41_SPI=m

Maybe further workaround settings required, see provided kernel config links.

The builtin speaker does work out of the box since kernel 6.1
In case of issues after Kernel-Upgrade: Do you use /etc/init.d/alsasound service? If yes, stop them, delete /var/lib/alsa/asound.state file and reboot. After reboot the alsasound service create new asound.state file with compatible settings.


Joystick / Hardware buttons
By default the joystick is not available. On boot a keyboard and mouse emulation is active in hardware and available in Boot manager already.
Code:
Valve Software Steam Controller
Right pad=Mouse
L2=Mouse RIGHT
R2=Mouse LEFT

Keyboard:
SELECT=TAB
START=ESC
A=ENTER
B=ESC

The gaming controls can be enabled next ways:
- The in-kernel driver hid_steam.
- If Steam client (games-util/steam-meta from steam overlay) is launched, an "Microsoft X-Box 360 pad 0" appears as event device.
- The games-util/sc-controller is able to handle Steamdeck input since version 0.4.8.9. I blacklisted hid_steam, because got issues with sc-controller and hid_steam enabled.


Video / Xorg
X does work out of the box with
Code:
VIDEO_CARDS="amdgpu radeon radeonsi"


Created /etc/X11/xorg.conf for screen and touchscreen rotation. Not tested if TearFree and VariableRefresh improve anything.

Code:
Section "Device"
   Identifier "AMD"
   Driver "amdgpu"
   Option "TearFree" "true"
   Option "VariableRefresh" "true"
EndSection

Section "Monitor"
  Identifier "eDP"
  Option "Rotate" "right"
EndSection

Section "InputClass"
  Identifier "Touchscreen"
  MatchIsTouchscreen "on"
  Driver "libinput"
  MatchProduct "FTS3528:00 2808:1015"
  Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection


Last edited by bell on Thu Nov 14, 2024 11:41 am; edited 8 times in total
Back to top
View user's profile Send private message
Saundersx
Apprentice
Apprentice


Joined: 11 Apr 2005
Posts: 294

PostPosted: Tue Oct 18, 2022 1:11 am    Post subject: Reply with quote

How far have you gotten on this? I was toying with the idea of making a binary repo with everything compiled on my main computer, tweaked kernel and full disk encryption but decided it was just too much effort. Using flatpak on the deck is nice and all but it's a pita in it's own way.

This thread has some useful links https://steamcommunity.com/app/1675200/discussions/0/3417683648802253046/

afaict valve haven't released all of their kernel changes/firmwares yet (though they could be in those urls listed in the link, haven't dug)
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Wed Oct 26, 2022 1:54 pm    Post subject: Reply with quote

Did not got answers notification ...

Quote:
How far have you gotten on this?
All is working as expected with Gentoo as described above. Last issue is the builtin speakers audio clicking after sleep resume.

No need for additional Valve kernel or firmware. Deck seems to be fully supported by Kernel-6.
Back to top
View user's profile Send private message
Saundersx
Apprentice
Apprentice


Joined: 11 Apr 2005
Posts: 294

PostPosted: Thu Oct 27, 2022 7:43 pm    Post subject: Reply with quote

Don't suppose you could share your make.conf and whatever else settings you used to get to going? Would save me some time.
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Fri Oct 28, 2022 9:02 am    Post subject: Reply with quote

There is nothing special in make.conf. Steamdeck is just an amd64 PC. ... and is fast enough to compile software byself, without any distcc or binhost setups.

Code:

VIDEO_CARDS="amdgpu radeon radeonsi"

CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3"

COMMON_FLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

MAKEOPTS="-j10"
PORTAGE_NICENESS=19
PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"

All of them is common. The CPU_FLAGS_X86 I got using app-portage/cpuid2cpuflags.

My use-flags are in my default desktop profile in my overlay, that I use on my workstation too. I am XFCE-User. On Gaming devices I launch games-util/gamehub (guru overlay) on boot to select games.

Other settings I provided in first post.
Back to top
View user's profile Send private message
shimbob
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2003
Posts: 140

PostPosted: Wed Nov 02, 2022 2:23 am    Post subject: Reply with quote

How did you configure your kernel, genkernel or hand-rolled?

I reused my hand-rolled .config of my 3900X desktop box to make a gentoo deck kernel, with minor driver tweaks, tried that kernel and it booted first try. Not needing an initrd is nice.
Back to top
View user's profile Send private message
st3rk
n00b
n00b


Joined: 26 Nov 2022
Posts: 1

PostPosted: Sat Nov 26, 2022 6:59 pm    Post subject: Reply with quote

Hi,

I'm a Debian user, but it seems the only few other people having a steam deck and a vanilla Linux kernel are here :)

I'm able to get everything working with a Linux 6.0 kernel, except the display port available through USB-C. The port and the screen are detected, I see them with xrandr. However, when I'm trying to enable the screen, I get this error :

Code:
[ 2650.560792] [drm] Failed to add display topology, DTM TA is not initialized.
[ 2657.744796] [drm] DP Alt mode state on HPD: 1


I tried the last RC of Linux 6.1, same result.

Was anyone able to use an external display?
Back to top
View user's profile Send private message
shimbob
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2003
Posts: 140

PostPosted: Tue Dec 06, 2022 4:37 am    Post subject: Reply with quote

st3rk wrote:
Hi,
Code:
[ 2650.560792] [drm] Failed to add display topology, DTM TA is not initialized.
[ 2657.744796] [drm] DP Alt mode state on HPD: 1


These messages shows up in my dmesg as well, but everything's working fine here (under steamos though, gentoo's still compiling)
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Thu Dec 15, 2022 5:58 am    Post subject: Reply with quote

shimbob wrote:
How did you configure your kernel, genkernel or hand-rolled?

I just use the sys-kernel/gentoo-kernel provided configuration with my usual additional adjustments. Nothing special

st3rk wrote:
Was anyone able to use an external display?
I use Monitor with USB3 connection without issues from beginning. My Usb Hub with HDMI work fine too. Maybe you try an other usb2hdmi device?
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Thu Dec 29, 2022 2:51 pm    Post subject: Reply with quote

Updated the howto. Using kernel 6.1 the upstreamed ucm files are useable from https://github.com/alsa-project/alsa-ucm-conf/pull/233
No noises after sleep anymore
Back to top
View user's profile Send private message
mega_flow
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jun 2016
Posts: 95
Location: Belgium

PostPosted: Fri Dec 30, 2022 10:06 am    Post subject: Reply with quote

I switch back to steamos . keep getting hardlocks hang on gentoo when playing games. (gpu or sound)
how stabel is 6.1 kernel on the deck when playing games. may putting gentoo back as only os
_________________
default/linux/amd64/23.0/no-multilib/gnome/systemd gnome:46
Back to top
View user's profile Send private message
gordon_quad
n00b
n00b


Joined: 27 Jan 2023
Posts: 1

PostPosted: Fri Jan 27, 2023 10:45 am    Post subject: Re: Gentoo on Steam deck Reply with quote

Could you provide info on your audio setup? Do you use pulseaudio/pipewire or bare alsa? Did you do any extra configuration to make it work?

It seems that even with ucm patches I am unable to make internal speakers play sound unless I explicitly specify hw:0,1 as an output device and do all required manipulations in alsamixer by hand (e.g. preload dsp firmware).
Back to top
View user's profile Send private message
grucifeet
n00b
n00b


Joined: 22 Feb 2023
Posts: 1

PostPosted: Wed Feb 22, 2023 2:32 am    Post subject: Reply with quote

This kernel config patch maybe a bit helpful
https://gist.github.com/atmouse-/b02ad447dc8006b36749b4be8fab220a

also following this ucm configure to get speaker work
https://github.com/batocera-linux/batocera.linux/issues/5813
Back to top
View user's profile Send private message
qlb1234
n00b
n00b


Joined: 23 Aug 2016
Posts: 7

PostPosted: Sun Feb 26, 2023 1:57 pm    Post subject: Reply with quote

To rotate the screen to the right direction (holding with both hands), you need

1.
Code:
fbcon=rotate:1
in the kernel command line
2. Set
Code:
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
to y in the kernel
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Mon Feb 27, 2023 8:24 pm    Post subject: Re: Gentoo on Steam deck Reply with quote

gordon_quad wrote:
Could you provide info on your audio setup? Do you use pulseaudio/pipewire or bare alsa? Did you do any extra configuration to make it work?

It seems that even with ucm patches I am unable to make internal speakers play sound unless I explicitly specify hw:0,1 as an output device and do all required manipulations in alsamixer by hand (e.g. preload dsp firmware).


I use pulseaudio/pipewire. No additional configuration except ucm patches.

Do you use /etc/init.d/alsasound service? If yes, stop them, delete /var/lib/alsa/asound.state file and reboot.

For switching between internal speakers and HDMI I wrote some simple autorandr postswitch scripts
Back to top
View user's profile Send private message
qlb1234
n00b
n00b


Joined: 23 Aug 2016
Posts: 7

PostPosted: Tue Mar 07, 2023 5:43 am    Post subject: Re: Gentoo on Steam deck Reply with quote

bell wrote:
gordon_quad wrote:
Could you provide info on your audio setup? Do you use pulseaudio/pipewire or bare alsa? Did you do any extra configuration to make it work?

It seems that even with ucm patches I am unable to make internal speakers play sound unless I explicitly specify hw:0,1 as an output device and do all required manipulations in alsamixer by hand (e.g. preload dsp firmware).


I use pulseaudio/pipewire. No additional configuration except ucm patches.

Do you use /etc/init.d/alsasound service? If yes, stop them, delete /var/lib/alsa/asound.state file and reboot.

For switching between internal speakers and HDMI I wrote some simple autorandr postswitch scripts


Thank you very much. Your comment helped me as much as the OP.

For a long time I have been using pure ALSA and it worked fine with my generic x86 desktop/laptop. But for Steam Deck, I can only get it (CS35L41) working as two separate channels (left and right), and no sound from headphone jack, even with patched ucm.

Today I emerged Pulseaudio (using Pipewire as the server) and both built-in speakers and headphone jack worked fine, along with HDMI audio output. Disabling the service alsasound and removing the state file are very important steps for it to work.

I'm (guiltily) happy with it now but also looking forward to someday I can use pure ALSA again, even if I need to use a custom script to switch between multiple .asoundrc files.

Thank you once again.
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Thu May 25, 2023 11:03 am    Post subject: Re: Gentoo on Steam deck Reply with quote

qlb1234 wrote:
I'm (guiltily) happy with it now but also looking forward to someday I can use pure ALSA again, even if I need to use a custom script to switch between multiple .asoundrc files.


If you like pure ALSA, just do it.
The issue with the asound.state was the file was containing outdated incompatible settings. After removal you can use the alsasound service again, then the service generates new state file, compatible to current driver.

By the way, UCM-Patching is not necessary anymore since already included upstream in media-libs/alsa-ucm-conf-1.2.9
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Thu Nov 14, 2024 11:43 am    Post subject: Reply with quote

Updated the first thread. Mainly mentioned the kernel configuration snippets and neptune-sources, if anyone looks out for it.
Back to top
View user's profile Send private message
keet
Guru
Guru


Joined: 09 Sep 2008
Posts: 573

PostPosted: Sun Dec 08, 2024 3:18 am    Post subject: Reply with quote

I installed Gentoo on my Steam Deck recently after tiring of dealing with the quirks of its custom operating system. Everything seems to be working, at least what I've tested so far, except the internal speaker and 3.5mm audio jack. I followed your kernel configuration guide and tried a lot of variants (everything audio-related as modules or built-in). I see this in dmesg:

platform acp5x_mach.0: deferred probe pending: acp5x_mach: Register card (acp5x) failed

I'm using gentoo-sources 6.12.3. I tried gentoo-kernel, but the graphics driver kept crashing. The monitor speaker through DisplayPort works fine, but I much prefer using proper speakers through the 3.5mm jack. Does anyone have any ideas?


Last edited by keet on Mon Dec 09, 2024 3:06 am; edited 1 time in total
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Sun Dec 08, 2024 8:08 am    Post subject: Reply with quote

I use sys-kernel/gentoo-kernel-6.12.3 kernel currently. Audio and video is working without any issues.

sys-kernel/linux-firmware is installed, right?
/var/lib/alsa/asound.state is deleted / dows not exists?
I hope, you did updated your steam os before wiping, since steam os does update the firmware too, that is currently not possible in Gentoo.

You can try to place the file https://github.com/bell07/bashscripts-kernel_cfg/blob/master/cfg/30_enable_steamdeck_device.config into /etc/kernel/config.d/30_enable_steamdeck_device.config and rebuild sys-kernel/gentoo-kernel
(The gentoo-kernel ebuild use config adjustments in /etc/kernel/config.d for configuration) or double check all of the settings in your gentoo-sources configuration.

If it does not help, please provide full dmesg output and your kernel config file.
Back to top
View user's profile Send private message
keet
Guru
Guru


Joined: 09 Sep 2008
Posts: 573

PostPosted: Mon Dec 09, 2024 3:09 am    Post subject: Reply with quote

Yes, linux-firmware is installed and /var/lib/alsa/asound.state does not exist.

I tried again with gentoo-kernel with your configuration file, and it's working now.

I wonder why it's not working with the default configuration. One of the first things I did was try porting the configuration from that file into my kernel configuration (manually). Maybe something else in that kernel configuration is preventing it from working. It's from a desktop computer, and it's possible that it's been handed down from multiple previous computers. I'll probably make a new one from the beginning and try again because gentoo-kernel seems to take tons of disk space for compiling/installation. Thanks for your help.
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 513

PostPosted: Mon Dec 09, 2024 6:22 am    Post subject: Reply with quote

The easiest way to apply config snipped to own kernel configuration is append them and deduplicate using make oldconfig

Code:
cd /usr/src/linux
cp .config .config.orig
cat additional_config_file.config >> .config
make oldconfig
# or make olddefconfig


Then you can compare the new .config file with the .config.orig backup
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum