diff --git a/scripts/50-urx22c.conf b/scripts/50-urx22c.conf new file mode 100644 index 0000000..e005204 --- /dev/null +++ b/scripts/50-urx22c.conf @@ -0,0 +1,27 @@ +# Custom configuration for Yamaha URX22C +context.objects = [ + { + factory = adapter + args = { + factory.name = api.alsa.pcm.sink + node.name = "URX22C_Bit_Perfect" + node.description = "Yamaha URX22C (96kHz/32-bit)" + media.class = "Audio/Sink" + api.alsa.path = "hw:URX22C" # You may need to replace 'URX22C' with the ALSA ID of your device + # api.alsa.period-size = 1024 + audio.format = S32LE # Send 32-bit integer to the DAC + audio.rate = 96000 # Force 96kHz + resample.disable = true # Crucial: Disables resampling to keep the rate locked + node.suspend-on-idle = false + } + } +] + +context.properties = { + default.clock.rate = 96000 + default.clock.allowed-rates = [ 44100 48000 88200 96000 ] + default.clock.quantum = 512 # 256 to 1024 + # Define the allowable range for dynamic adjustment + default.clock.min-quantum = 64 + default.clock.max-quantum = 1024 +} diff --git a/scripts/installPipeWire.sh b/scripts/installPipeWire.sh new file mode 100644 index 0000000..5d0b8ab --- /dev/null +++ b/scripts/installPipeWire.sh @@ -0,0 +1,56 @@ +#!/bin/bash +sudo apt update && sudo apt upgrade -y + +sudo apt install -y \ +pipewire \ +pipewire-pulse \ +wireplumber \ +pipewire-alsa \ +pipewire-jack \ +pipewire-audio \ +libspa-0.2-bluetooth + +sudo apt install -y qpwgraph +sudo apt install -y easyeffects +# Install PipeWire Wayland portal +sudo apt-get install -y xdg-desktop-portal xdg-desktop-portal-gnome + +# Disable PulseAudio +systemctl --user disable pulseaudio.service pulseaudio.socket +systemctl --user mask pulseaudio.service pulseaudio.socket + +# Stop PulseAudio immediately +systemctl --user stop pulseaudio.service pulseaudio.socket + +# Enable PipeWire and its components +systemctl --user enable pipewire pipewire-pulse wireplumber +systemctl --user start pipewire pipewire-pulse wireplumber + +mkdir -p ~/.config/pipewire +cp /usr/share/pipewire/pipewire.conf ~/.config/pipewire/ + +# Create user pipewire config directory +mkdir -p ~/.config/pipewire/pipewire.conf.d/ + +# Set lower latency (default is 1024/48000 = ~21ms) +cat > ~/.config/pipewire/pipewire.conf.d/10-custom.conf << 'EOF' +context.properties = { + default.clock.rate = 96000 + default.clock.quantum = 512 + default.clock.min-quantum = 32 + default.clock.max-quantum = 8192 +} +EOF + +# Create a virtual null sink (useful for recording desktop audio) +pactl load-module module-null-sink media.class=Audio/Sink sink_name=virtual-speaker object.linger=1 + +# Create a loopback (route audio from virtual sink to real output) +pactl load-module module-loopback source=virtual-speaker.monitor sink=@DEFAULT_SINK@ + +systemctl --user restart pipewire.service pipewire-pulse.service wireplumber.service + +# Verify PipeWire is now the audio server +pactl info | grep "Server Name" + +#https://oneuptime.com/blog/post/2026-03-02-how-to-set-up-pipewire-as-audio-server-on-ubuntu/view