Better way to enable bit-perfect audio

This commit is contained in:
ssn
2026-04-07 12:07:12 +02:00
parent 14f9338bb1
commit 2cecafd956
2 changed files with 24 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
context.properties = {
#default.clock.rate = 48000
default.clock.allowed-rates = [ 44100, 48000, 88200, 96000, 176400, 192000, 384000 ]
default.clock.allowed-rates = [ 44100, 48000, 88200, 96000, 176400, 192000 ]
}

View File

@@ -7,6 +7,20 @@ if [[ $EUID > 0 ]]; then
sudo su -
fi
# Source - https://stackoverflow.com/a/29436423
# Posted by Tiago Lopo, modified by community. See post 'Timeline' for change history
# Retrieved 2026-04-07, License - CC BY-SA 3.0
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "Aborted" ; return 1 ;;
esac
done
}
echo "adding RPM fusion repos & updating DNF"
# Get the free repository (most stuff you need)
dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm &> /dev/null
@@ -136,10 +150,15 @@ systemctl daemon-reload &> /dev/null
systemctl enable --now flatpak-update.timer &> /dev/null
###Bit-perfect audio support
sed -i 's+\#default\.clock\.rate+default.clock.rate+g' /usr/share/pipewire/pipewire.conf
sed -i 's+\#default\.clock\.allowed-rates.*+default.clock.allowed-rates = [ 44100, 48000, 88200, 96000, 192000 ]+g' /usr/share/pipewire/pipewire.conf
cp /etc/pipewire/pipewire.conf /etc/pipewire/pipewire.conf.bak &> /dev/null
cp /usr/share/pipewire/pipewire.conf /etc/pipewire/pipewire.conf -f &> /dev/null
function bitperfect_audio {
###This will enable support for the following audio sample rates:
###44100, 48000, 88200, 96000, 176400, 192000
###Please adjust according to the capabilities of your hardware
###or simply delete the file created below if you don't care about resampling
mkdir -p ~/.config/pipewire/pipewire.conf.d
curl https://git.zfx.dk/Siim/Fedora-post-install-script/raw/branch/main/10-bitperfect.conf > ~/.config/pipewire/pipewire.conf.d/10-bitperfect.conf
}
yes_or_no "Would you like to add support for high-res audio?" && bitperfect_audio ||
###All done
echo "Script completed, please reboot."