Adding new ALSA UCM configs

I have a audio interface that don't work properly on Linux without getting a new a new ALSA UCM config. However the /usr/share/alsa directory is of course non-editable. Is it possible to update it? I severely need the configuration to be able to record my audio properly!
Solution:
So I've made the copr repo and the package spec. Package spec: https://github.com/Zelaf/alsa-ucm-conf-rpm Copr repo: https://copr.fedorainfracloud.org/coprs/zelaf/alsa-ucm/ To install on Bazzite: ...
GitHub
GitHub - Zelaf/alsa-ucm-conf-rpm: An RPM spec for creating a newer ...
An RPM spec for creating a newer version of the ALSA UCM configurations. - GitHub - Zelaf/alsa-ucm-conf-rpm: An RPM spec for creating a newer version of the ALSA UCM configurations.
Jump to solution
49 Replies
Zelaf
ZelafOP13mo ago
So far it seems that my only possibility would be to either find or make a rpm package or copr repository to find the latest config updates
Kyle Gospo
Kyle Gospo13mo ago
those files should work locally too in a folder in ~/.local or ~/.config
Zelaf
ZelafOP13mo ago
Oh? I've read the UCM config over and over and haven't found anything in regard to having them in a local folder
Kyle Gospo
Kyle Gospo13mo ago
checking I take that back, works for everything but UCM you can also just fork the bazzite repo and make your changes in the containerfile, or make a new containerfile which calls myimage FROM ghcr.io/ublue-os/bazzite quick and easy way to make changes to the core files
Zelaf
ZelafOP13mo ago
Oh, I can make a new container file that calls on another container file??
Kyle Gospo
Kyle Gospo13mo ago
yep!
EyeCantCU
EyeCantCU13mo ago
/etc/alsa doesn't work?
Zelaf
ZelafOP13mo ago
That sounds like a sweet way to instantly plug in new programs and features
Kyle Gospo
Kyle Gospo13mo ago
note as well that if your changes don't break other hardware we're more than happy to accept a PR
Zelaf
ZelafOP13mo ago
Hell yeah I mean, it's just config files They're gonna be pushed out eventually to a new ALSA UCM version But they rarely do it
Zelaf
ZelafOP13mo ago
GitHub
GitHub - alsa-project/alsa-ucm-conf: ALSA Use Case Manager configur...
ALSA Use Case Manager configuration. Contribute to alsa-project/alsa-ucm-conf development by creating an account on GitHub.
Zelaf
ZelafOP13mo ago
As you can see, there's no releases, only tags
Zelaf
ZelafOP13mo ago
GitHub
Commits · alsa-project/alsa-ucm-conf
ALSA Use Case Manager configuration. Contribute to alsa-project/alsa-ucm-conf development by creating an account on GitHub.
Zelaf
ZelafOP13mo ago
And sadly the config needed for me was added on the 30th when one decided to go over PRs D; I won't be able to test all these config files sadly. But if I get it working will someone look over it?
Kyle Gospo
Kyle Gospo13mo ago
yeah we'll take a look
Zelaf
ZelafOP13mo ago
Also any documentation for how I do this?
Zelaf
ZelafOP13mo ago
Woah I think I'm in love with this fedora type now Right, still gonna need documentation on how all this works. Also if I want to make it as "stable" for bazzite as possible I imagine download a tarbal to put in the repo would potentially be best? Or a folder perhaps. Since making a script to pull the repo or follow the commands in the ucm repo seems like a bad idea WAIT, can the just command surpass the restrictions on the /usrfolder? Like, does it run outside of the container itself?
Kyle Gospo
Kyle Gospo13mo ago
It can not, the usr folder is unwriteable outside of layers via rpm-ostree and what's done in the container file Might be best as a Copr in that case
Zelaf
ZelafOP13mo ago
I did read up on that I'm a total newbie when it comes to making and modifying distros. Been using Linux for years but never really modified something as sensitive as a distro setup before so I'm unsure what the best approach to this is
Kyle Gospo
Kyle Gospo13mo ago
For a stable release for users I think an RPM made in copr is best, for personal use you can straight up pull the latest from that repo with git and move them into place in a containerfile or wget the specific file you need, straight into the final folder
Zelaf
ZelafOP13mo ago
Alright, so either be kind to all users and learn copr for everyone else who uses their setup as audio recording too or make it easy :D Is it hard mainting a copr repo? What chroot is required on copr?
Kyle Gospo
Kyle Gospo13mo ago
this packge would be noarch, for building you'd use 38. 39, and rawhide x86_64 that way it forks automatically as 40, 41, 42 come out etc maintaining a copr is pretty easy brick wall learning curve to get started, then smooth sailing
Zelaf
ZelafOP13mo ago
I have no idea what I'm doing let's hope it goes well enough :D
Kyle Gospo
Kyle Gospo13mo ago
copr takes a spec file best thing to do is grab upstream's spec file change it to point to main rather than a specific tag and then just build that in copr
Zelaf
ZelafOP13mo ago
Sounds easy enough I really have to download the whole alsa-lib build to get to the config files??? After all this work, I hope more people will use ublue for audio stuff
Zelaf
ZelafOP13mo ago
alsa-ucm-1.2.10-3.fc39 - Fedora Packages
View alsa-ucm-1.2.10-3.fc39 in Fedora 39. alsa-ucm: ALSA Use Case Manager configuration
Zelaf
ZelafOP13mo ago
I cannot for the life of me find any spec files https://koji.fedoraproject.org/koji/rpminfo?rpmID=36005731 Found this could the spec file be inside of the rpm?
Zelaf
ZelafOP13mo ago
Oh wait, that's not it
Kyle Gospo
Kyle Gospo13mo ago
ulsa-ucm is a sub package of alsa-lib Spec file is there
Zelaf
ZelafOP13mo ago
Oh there it is Woah, the spec file is literally just the commands from the ucm repo
Zelaf
ZelafOP13mo ago
No description
Zelaf
ZelafOP13mo ago
Should I name the package alsa-ucm or make it something along the lines of alsa-ucm-config? Or perhaps alsa-ucm-git?
Summary: Updated ALSA-UCM configuration files from the alsa-ucm-conf GitHub repository.
Name: alsa-ucm
Version: 23adf5a
Release: 1
License: BSD-3-Clause
URL: http://www.alsa-project.org/

ALSA_UCM_Source: https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz

%package -n alsa-ucm
Summary: ALSA Use Case Manager configuration
BuildArch: noarch
License: BSD-3-Clause
%description -n alsa-ucm

The Advanced Linux Sound Architecture (ALSA) Use Case Manager configuration

contains alsa-lib configuration of Audio input/output names and routing

downloaded from the GitHub Repository alsa-project/alsa-ucm-config

%install
# Unpack UCMs
curl -L -o alsa-ucm-conf.tar.gz %{ALSA_UCM_Source}
tar xvzf alsa-ucm-conf.tar.gz -C /usr/share/alsa --strip-components=1 --wildcards "*/ucm" "*/ucm2"


%files -n alsa-ucm
# BSD
%{_datadir}/alsa/ucm
%{_datadir}/alsa/ucm2
Summary: Updated ALSA-UCM configuration files from the alsa-ucm-conf GitHub repository.
Name: alsa-ucm
Version: 23adf5a
Release: 1
License: BSD-3-Clause
URL: http://www.alsa-project.org/

ALSA_UCM_Source: https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz

%package -n alsa-ucm
Summary: ALSA Use Case Manager configuration
BuildArch: noarch
License: BSD-3-Clause
%description -n alsa-ucm

The Advanced Linux Sound Architecture (ALSA) Use Case Manager configuration

contains alsa-lib configuration of Audio input/output names and routing

downloaded from the GitHub Repository alsa-project/alsa-ucm-config

%install
# Unpack UCMs
curl -L -o alsa-ucm-conf.tar.gz %{ALSA_UCM_Source}
tar xvzf alsa-ucm-conf.tar.gz -C /usr/share/alsa --strip-components=1 --wildcards "*/ucm" "*/ucm2"


%files -n alsa-ucm
# BSD
%{_datadir}/alsa/ucm
%{_datadir}/alsa/ucm2
Do you think this will work? Not sure how to define %{_datadir} however
Kyle Gospo
Kyle Gospo13mo ago
BuildRequires: systemd-rpm-macros
Kyle Gospo
Kyle Gospo13mo ago
Fedora Docs
RPM Macros
Learn more about Fedora Linux, the Fedora Project & the Fedora Community.
Kyle Gospo
Kyle Gospo13mo ago
No description
Zelaf
ZelafOP13mo ago
I found a rpm spec that I decided to modify Doing trial and error until it turns out fine
Zelaf
ZelafOP13mo ago
GitHub
GitHub - Zelaf/alsa-ucm-conf-rpm-spec: Newer ALSA Use Case Manager ...
Newer ALSA Use Case Manager configurations. Contribute to Zelaf/alsa-ucm-conf-rpm-spec development by creating an account on GitHub.
Zelaf
ZelafOP13mo ago
So... What's the correct way to test this? How do I make sure this package doesn't get overwritten by a alsa-lib update or a ucm update? Also will it not show package conflicts between the two? Alright, I think I'm gonna have to give up on the rpm package.
Kyle Gospo
Kyle Gospo13mo ago
rpm-ostree override install file.rpm conflicts are a given since you're replacing if your RPM has a different name, make sure it has "Provides: original_package_name_here" in the spec
Zelaf
ZelafOP13mo ago
Oh that's a smart one I just can't figure out how to make copr handle the files properly /var/tmp/rpm-tmp.78RG7m: line 40: cd: alsa-ucm-conf-23adf5a: No such file or directoryKeep getting this error and the only result I found is that it assumes file and folder names and the files and folders aren't the same as the project on the downloaded git repo
Kyle Gospo
Kyle Gospo13mo ago
you're close couple errors in your spec file
Kyle Gospo
Kyle Gospo13mo ago
GitHub
unl0kr/unl0kr.spec at main · KyleGospo/unl0kr
Framebuffer-based disk unlocker for the initramfs based on LVGL - KyleGospo/unl0kr
Kyle Gospo
Kyle Gospo13mo ago
take a look at this one
Zelaf
ZelafOP13mo ago
Oh yeah, I can just git clone directly Alright, I just don't understand what I'm doing wrong. AFAIK the Source0 command should create the directory in the tmp directory of the package name that then tries to get deleted but at the same time it fails because the folder isn't there? From what I understand a way around this would basically to take the install section and make it a separate script and just run that under the install I suppose? Oh!
RPM build warnings:
stderr: warning: Downloading https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz to /var/lib/copr-rpmbuild/results/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz
warning: source_date_epoch_from_changelog set but %changelog is missing
Downloading https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz to /var/lib/copr-rpmbuild/results/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz
source_date_epoch_from_changelog set but %changelog is missing
RPM build warnings:
stderr: warning: Downloading https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz to /var/lib/copr-rpmbuild/results/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz
warning: source_date_epoch_from_changelog set but %changelog is missing
Downloading https://github.com/alsa-project/alsa-ucm-conf/archive/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz to /var/lib/copr-rpmbuild/results/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz
source_date_epoch_from_changelog set but %changelog is missing
It doesn't get downloaded to the same folder??

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.cADcRH
+ umask 022
+ cd /builddir/build/BUILD
+ mkdir -p /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa
+ RPM_EC=0
++ jobs -p
+ exit 0

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.cADcRH
+ umask 022
+ cd /builddir/build/BUILD
+ mkdir -p /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa
+ RPM_EC=0
++ jobs -p
+ exit 0

+ tar xvzf /builddir/build/SOURCES/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz -C /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa --strip-components=1 --wildcards '*/ucm2'
tar: /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

+ tar xvzf /builddir/build/SOURCES/23adf5a368abe9009f44547b91d60a244f735d81.tar.gz -C /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa --strip-components=1 --wildcards '*/ucm2'
tar: /builddir/build/BUILDROOT/alsa-ucm-conf-23adf5a-1.x86_64/usr/share/alsa: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
It creates the folder and then complains about it not existing? D; HOLY FUCK I DID IT
Zelaf
ZelafOP13mo ago
Should I change any of these settings?
No description
Zelaf
ZelafOP13mo ago
Omfg such hype
error: Checkout alsa-ucm-conf-23adf5a-1.noarch: Hardlinking e5/c92832cbefbba380dfcdd52b0eea8c49935c86cad69b372a32d63b6dc37b5c.file to HiFi.conf: File exists
error: Checkout alsa-ucm-conf-23adf5a-1.noarch: Hardlinking e5/c92832cbefbba380dfcdd52b0eea8c49935c86cad69b372a32d63b6dc37b5c.file to HiFi.conf: File exists
Piss
$ sudo rpm-ostree install alsa-ucm-conf --apply-live --force-replacefiles
error: Non-local fileoverrides not implemented
$ sudo rpm-ostree install alsa-ucm-conf --apply-live --force-replacefiles
error: Non-local fileoverrides not implemented
Alright so from what I can understand the only way to fix it is by either removing the original alsa-ucm package or the files
$ sudo rpm-ostree uninstall alsa-ucm
[sudo] password for Zelaf:
error: Package/capability 'alsa-ucm' is not currently requested
$ sudo rpm-ostree uninstall alsa-ucm
[sudo] password for Zelaf:
error: Package/capability 'alsa-ucm' is not currently requested
The package isn't layered so I can't remove it, is it based on pre-installed packages from the ublue image? I ran
$ sudo rpm-ostree override remove alsa-ucm
$ sudo rpm-ostree override remove alsa-ucm
Hopefully it won't remove all of alsa
ls /usr/share/alsa/ucm2/USB-Audio/Behringer/
Flow8-Recording.conf Flow8-Streaming.conf UMC202HD.conf UMC204HD.conf UMC404HD.conf
Flow8-Recording-Hifi.conf Flow8-Streaming-Hifi.conf UMC202HD-HiFi.conf UMC204HD-HiFi.conf UMC404HD-HiFi.conf
ls /usr/share/alsa/ucm2/USB-Audio/Behringer/
Flow8-Recording.conf Flow8-Streaming.conf UMC202HD.conf UMC204HD.conf UMC404HD.conf
Flow8-Recording-Hifi.conf Flow8-Streaming-Hifi.conf UMC202HD-HiFi.conf UMC204HD-HiFi.conf UMC404HD-HiFi.conf
Omg seems to actually be working I can't test now tho because I don't have my audio interface lol Do I need to run rpm-ostree uninstall alsa-ucm and rpm-ostree install alsa-ucm every time I get a new system update? Do you know how to properly handle versioning and release numbers for this? I'm thinking of doing something like this: Current:
Version: 23adf5a
Release: 1
Version: 23adf5a
Release: 1
And then:
Version: NewCommitNum.
Release: 2
Version: NewCommitNum.
Release: 2
Solution
Zelaf
Zelaf12mo ago
So I've made the copr repo and the package spec. Package spec: https://github.com/Zelaf/alsa-ucm-conf-rpm Copr repo: https://copr.fedorainfracloud.org/coprs/zelaf/alsa-ucm/ To install on Bazzite:
$ sudo rpm-ostree override replace --experimental --freeze --from repo='copr:copr.fedorainfracloud.org:zelaf:alsa-ucm' alsa-ucm
$ sudo rpm-ostree override replace --experimental --freeze --from repo='copr:copr.fedorainfracloud.org:zelaf:alsa-ucm' alsa-ucm
GitHub
GitHub - Zelaf/alsa-ucm-conf-rpm: An RPM spec for creating a newer ...
An RPM spec for creating a newer version of the ALSA UCM configurations. - GitHub - Zelaf/alsa-ucm-conf-rpm: An RPM spec for creating a newer version of the ALSA UCM configurations.
Want results from more Discord servers?
Add your server