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

feat(deck): Use valve-firmware #1137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LukeShortCloud
Copy link

instead of manually installing Steam Deck firmware files.

instead of manually installing Steam Deck firmware files.
@LukeShortCloud
Copy link
Author

Greetings from the PlaytronOS project. :-) I'm the Director of Linux Engineering over at Playtron. Although we are not directly using Bazzite, we want to help contribute back to various parts of the Linux gaming community in any way that we can!

By packaging the firmware files as a RPM, this simplifies Bazzite's install of the files. They can also be easily installed and updated on other Fedora distributions now.

Using Bazzite's code as a starting point, I turned the firmware installation into a RPM package with the following changes:

  • Not all of the firmware files are bundled in the RPM because linux-firmware from Fedora 40 includes some of them now.
  • Firmware files come straight from Valve. This removes evlaV as a middle-man.
  • valve-firmware is hosted as a RPM on the playtron/gaming Fedora Copr.
    • The license of the SteamOS firmware packages states that all binaries have to be redistributable as long as they are unmodified.
    • The source can be found on GitHub at playtron-os/rpm-specs-gaming.
    • Where possible, we try to provide RPMs for all supported versions of Fedora.

I did a test build and it is working. However, I did not try rebasing to it using an rpm-ostree distribution.

$ podman build . -t bazzite-valve-firmware:latest
Downloading from 'copr:copr.fedorainfracloud.org:playtron:gaming'...done
Installing 1 packages:
  valve-firmware-20231113.1-1.fc40.noarch (copr:copr.fedorainfracloud.org:playtron:gaming)
Installing: valve-firmware-20231113.1-1.fc40.noarch (copr:copr.fedorainfracloud.org:playtron:gaming)
--> d5c39186bb1e

@LukeShortCloud
Copy link
Author

When testing the installation of the firmware along with kernel-fsync, my OLED Steam Deck finally going Wi-Fi working! But audio still does not work. I tested the RPM on Fedora 40. I also tried manually installing the firmware files on both Arch Linux (using linux-fsync-nobara-bin from the AUR) and Fedora 40 using the steps from the Bazzite build. Still no audio. Perhaps I'm missing something?

    mkdir -p /tmp/linux-firmware-neptune && \
    curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-cali.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/cs35l41-dsp1-spk-cali.bin && \
    curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-cali.wmfw https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/cs35l41-dsp1-spk-cali.wmfw && \
    curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-prot.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/cs35l41-dsp1-spk-prot.bin && \
    curl -Lo /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-prot.wmfw https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/cs35l41-dsp1-spk-prot.wmfw && \
    xz --check=crc32 /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-{cali.bin,cali.wmfw,prot.bin,prot.wmfw} && \
    mv -vf /tmp/linux-firmware-neptune/* /usr/lib/firmware/cirrus/ && \
    rm -rf /tmp/linux-firmware-neptune && \
    mkdir -p /tmp/linux-firmware-galileo && \
    curl https://gitlab.com/evlaV/linux-firmware-neptune/-/archive/jupiter-20231113.1/linux-firmware-neptune-jupiter-20231113.1.tar.gz?path=ath11k/QCA206X -o /tmp/linux-firmware-galileo/ath11k.tar.gz && \
    tar --strip-components 1 --no-same-owner --no-same-permissions --no-overwrite-dir -xvf /tmp/linux-firmware-galileo/ath11k.tar.gz -C /tmp/linux-firmware-galileo && \
    xz --check=crc32 /tmp/linux-firmware-galileo/ath11k/QCA206X/hw2.1/* && \
    mv -vf /tmp/linux-firmware-galileo/ath11k/QCA206X /usr/lib/firmware/ath11k/QCA206X && \
    rm -rf /tmp/linux-firmware-galileo/ath11k && \
    rm -rf /tmp/linux-firmware-galileo/ath11k.tar.gz && \
    curl -Lo /tmp/linux-firmware-galileo/hpbtfw21.tlv https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/qca/hpbtfw21.tlv && \
    curl -Lo /tmp/linux-firmware-galileo/hpnv21.309 https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/qca/hpnv21.309 && \
    curl -Lo /tmp/linux-firmware-galileo/hpnv21.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/qca/hpnv21.bin && \
    curl -Lo /tmp/linux-firmware-galileo/hpnv21g.309 https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/qca/hpnv21g.309 && \
    curl -Lo /tmp/linux-firmware-galileo/hpnv21g.bin https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter-20231113.1/qca/hpnv21g.bin && \
    xz --check=crc32 /tmp/linux-firmware-galileo/* && \
    mv -vf /tmp/linux-firmware-galileo/* /usr/lib/firmware/qca/ && \
    rm -rf /tmp/linux-firmware-galileo && \
    rm -rf /usr/share/alsa/ucm2/conf.d/acp5x/Valve-Jupiter-1.conf 

@antheas
Copy link

antheas commented May 17, 2024

Hi Luke,
I think the reason it is this way is because COPR has license requirements that the firmware does not meet, so it can't be made as a COPR repo.

Essentially all copr software needs to be open source

So that is something to consider.

@LukeShortCloud
Copy link
Author

Hey @antheas, thanks for the information! I wasn't aware of that. PlaytronOS also has a public RPM repository that is hosted on an AWS S3 bucket. I'll look into transitioning the RPM over to there.

@LukeShortCloud
Copy link
Author

We're actually about to go through a major restructure of our AWS S3 repositories next week. I'll follow-up once that's done.

@dylanmtaylor
Copy link

Hey @antheas, thanks for the information! I wasn't aware of that. PlaytronOS also has a public RPM repository that is hosted on an AWS S3 bucket. I'll look into transitioning the RPM over to there.

I wonder if this package can be contributed to the rpmfusion project? Then it is not adding another repository.

@LukeShortCloud
Copy link
Author

@dylanmtaylor Our long-term goal for every package we maintain in PlaytronOS is to upstream them into Fedora and help maintain them there. I used to work at Red Hat and maintained a few gaming related packages during that time. I know it is easier said than done. In this specific scenario, I'd like to see if we can work with Valve to add their firmware blobs to the upstream linux-firmware project.

RPM Fusion is our goal for the short-term, too. I'm not sure how long it would take for this package to be accepted and I can start the submission soon.

@dylanmtaylor
Copy link

I'd like to see if we can work with Valve to add their firmware blobs to the upstream linux-firmware project.

This is a brilliant idea, actually. I'd love to see that too.

@LukeShortCloud
Copy link
Author

Early last week, I reached out to a few members of the SteamOS team about upstreaming their firmware. I got no response. After talking with a few folks in the community, it seems that they are more interested in leaving the firmware blobs up to the hardware vendors to support upstream.

I love Valve. They're one of my favorite companies. However, from my winesapOS project and other upstream projects I'm involved in, I've tried to work close with the SteamOS team for years and it has been a struggle. Valve has not been interested in patches to improve compatibility for other devices. The situation has slightly improved now that a 2024 public release of SteamOS has been rumored. But adding additional hardware support could accidentally break their Steam Deck support. They are also in no hurry to upstream their hardware support as everything just works on the Steam Deck OLED with SteamOS.

As of Linux 6.9, both sound and Wi-Fi still do not work for upstream Linux distributions. The Steam Deck has custom firmware files for sound. The Sound Open Firmware (SOF) project is working on fixing up support with alternative firmware but it still has a lot of issues. For Wi-Fi, some firmware files are available but they are buggy. I recall SteamOS adding a handful of patches to their Linux kernel to deal with that. My Steam Deck OLED was affected and had no Wi-Fi on SteamOS for the first month I owned it.

Next Steps

The valve-firmware package is hosted on the Fedora Copr but we need to move it. For compliance, as @antheas pointed out, the Copr requires us to provide a reproducible build which includes source code. Looking into the requirements of both upstream Fedora and RPM Fusion, they require the same. Perhaps linux-firmware is one of the few exceptions? Otherwise, it seems that the only avenue is to host the RPM on our Playtron repository. That will be accessible by the end of this month. There are a couple proprietary RPMs there and we are working on a road map to hopefully open source our entire stack.

I'm also open to other suggestions if there is another, more widely used, repository where we could contribute this to. Our goal here is simply to make it easy for any RPM-based distribution to be able to install better Steam Deck OLED support.

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

Successfully merging this pull request may close these issues.

None yet

4 participants