unexpected sample rate change detected
I'm running camilladsp on Linux Ubuntu 24.04 LTS via Jack, the "devices" part of my configuration file is set as
devices:
samplerate: 48000
chunksize: 1024
capture:
type: Jack
channels: 10
device: default
playback:
type: Jack
channels: 10
device: default
However, if I start Jack Audio server by bash script command jackd -R -P95 -d alsa -d hw:RAVENNA -r 48000 -p 64 -n 3 & and then launch camilladsp(camillagui included), some weird warnings will pop up in the terminal:
2024-08-30 15:33:17.712817 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44111.681990926874 Hz 2024-08-30 15:33:18.734072 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44118.2290988274 Hz 2024-08-30 15:33:19.755835 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44096.39640198734 Hz 2024-08-30 15:33:20.777312 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44108.7106988326 Hz 2024-08-30 15:33:21.798850 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44105.94402815522 Hz 2024-08-30 15:33:22.820306 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44109.64848788511 Hz 2024-08-30 15:33:23.841660 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44114.01966279426 Hz 2024-08-30 15:33:24.863324 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44100.5988061838 Hz 2024-08-30 15:33:25.884852 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44106.48243846306 Hz 2024-08-30 15:33:26.906293 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44110.24589200573 Hz 2024-08-30 15:33:27.927772 WARN [src/cpaldevice.rs:678] sample rate change detected, last rate was 44108.56155099588 Hz
I really don't understand why the sample rate has automatically been changed to approximately 44100 Hz, despite both my Jack server and camilladsp being explicitly set to 48000 Hz. According to the documentation, the enable_rate_adjust parameter defaults to false, which is why I omitted it from the configuration file. By the way, the sample rate displayed on qjackctl GUI has consistently been 48000 Hz.
This discrepancy is causing audio output issues, such as crackling, so I would greatly appreciate your assistance in resolving this. Many thanks!!!
Unfortunately I have no idea what might cause this. I don't know much about jack since I never use it, and I have very limited time I could spend on getting more familiar with it. I'm considering dropping the jack support simply because I'm not really able to maintain and support it properly. Camilladsp uses the cpal library for jack, can you try asking over there? https://github.com/RustAudio/cpal
Unfortunately I have no idea what might cause this. I don't know much about jack since I never use it, and I have very limited time I could spend on getting more familiar with it. I'm considering dropping the jack support simply because I'm not really able to maintain and support it properly. Camilladsp uses the goal library for jack, can you try asking over there? https://github.com/RustAudio/cpal
So are you saying that the waring messages displayed on the terminal window are not coming from your camilladsp code but are instead originating from the goal library for jack? If that's the case, I'll try to ask my question over there. Thank you for your generous support.
Thanks autocorrect, it should be "cpal", not "goal". The warning message comes from my code. It measures the rate of the samples it receives from cpal. Cpal is an abstraction layer that supports many audio api:s. It handles all the exchange with the jack server, and that is all hidden from the application using it.
For some reason, cpal delivers samples at the wrong rate from the jack server, and camilladsp detects this and shows the warning. I ave no idea how it could happen, but that's something that would be good to ask over at cpal.
Thanks autocorrect, it should be "cpal", not "goal". The warning message comes from my code. It measures the rate of the samples it receives from cpal. Cpal is an abstraction layer that supports many audio api:s. It handles all the exchange with the jack server, and that is all hidden from the application using it.
For some reason, cpal delivers samples at the wrong rate from the jack server, and camilladsp detects this and shows the warning. I hævd nl idea how it could happen, but that's something that would be good to ask over at cpal.
Got it, I'll continue to explore solutions to my problem at the cpal community. Thanks again for your help!!😊😊
Closing since this is either a cpal or jack issue.