aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-02 13:28:23 +0100
committersalmonik <salmonik@tuta.io>2026-11-02 13:28:23 +0100
commit6e62ee4057b8ea3144f2f4df85e5d56c37c8fd72 (patch)
tree5cc559e2eaad47f632294914a9d57133e863b1b8 /src/daemon.rs
parentconfig: parse the config once and reuse it until the file changes (diff)
downloadrsplayer-6e62ee4057b8ea3144f2f4df85e5d56c37c8fd72.tar.gz
rsplayer-6e62ee4057b8ea3144f2f4df85e5d56c37c8fd72.zip
audio: open the output at the track's rate instead of pw-alsa's 44100
cpal asks the ALSA "default" PCM for its default config and pipewire-alsa answers 44.1 kHz no matter what the graph runs at, so 48 kHz material was resampled down to 44.1 in our linear resampler and then back up to 48 by PipeWire. The stream now opens at the track's own rate (when the device supports it), which keeps our resampler out of the path and leaves the conversion to PipeWire's polyphase one. The new `sample_rate` setting forces a fixed rate instead ("auto" by default), for anyone who would rather match the graph exactly.
Diffstat (limited to 'src/daemon.rs')
-rw-r--r--src/daemon.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemon.rs b/src/daemon.rs
index eaae64f..3dcb802 100644
--- a/src/daemon.rs
+++ b/src/daemon.rs
@@ -225,7 +225,7 @@ pub fn start_daemon() -> Result<(), Box<dyn std::error::Error>> {
225 let listener = UnixListener::bind(&socket_path)?; 225 let listener = UnixListener::bind(&socket_path)?;
226 println!("Listening on {:?}", socket_path); 226 println!("Listening on {:?}", socket_path);
227 227
228 let audio_engine = Arc::new(AudioEngine::new()); 228 let audio_engine = Arc::new(AudioEngine::new(config.sample_rate_hz()));
229 let queue = Arc::new(Mutex::new(Queue::new())); 229 let queue = Arc::new(Mutex::new(Queue::new()));
230 230
231 // Load and apply saved settings 231 // Load and apply saved settings