bazzite icon indicating copy to clipboard operation
bazzite copied to clipboard

feat(deck): Use valve-firmware

Open LukeShortCloud opened this issue 1 month ago • 2 comments

instead of manually installing Steam Deck firmware files.

LukeShortCloud avatar May 16 '24 23:05 LukeShortCloud

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 avatar May 16 '24 23:05 LukeShortCloud

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 

LukeShortCloud avatar May 16 '24 23:05 LukeShortCloud

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.

antheas avatar May 17 '24 17:05 antheas

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 avatar May 17 '24 17:05 LukeShortCloud

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.

LukeShortCloud avatar May 17 '24 18:05 LukeShortCloud

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.

dylanmtaylor avatar May 22 '24 04:05 dylanmtaylor

@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.

LukeShortCloud avatar May 22 '24 15:05 LukeShortCloud

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.

dylanmtaylor avatar May 23 '24 16:05 dylanmtaylor