Sample rate switcher for CamillaDSP

In my setup, immediately after alsa initialisation, camilladsp-setrate always captures a rate change event indicating the greatest sample rate supported by the playback device.
That looks like an activity of your specific USB host, there is no code in the gadget which would send a fake rate change with the highest rate.

Of course even the first track should send correct samplerate change from 0 to current rate. But it's possible the host had already opened the gadget audio device at that rate before the first track started playing (windows mixer or PA/PW could do that). In any case the initial change from 0 to the the first playback rate should be there.
 
But I would really like to know if there are any camilladsp-setrate users interested in this feature.
IMO all users of high-channel long-sample gadget will eventually need that because of the buffer bytes limit, which results in buffer sizes depending on audio frame lengths. E.g. 8ch 32bit would yield 16 * 4kB buffer bytes / 8ch / 4bytes = 2k buffer size which would take 1k chunksize for reasonable performance, regardless the samplerate.

EDIT: I did not realize the chunksize limit relates to playback side. But if someone wanted to use the opposite direction (for USB capture), then the gadget would be on the playback side. A duplex USB gadget device would be an example.

Nevertheless Henrik is working on improving this situation - adding inner threads to his alsa interfaces which decouple the work with chunks from the soundcard buffers. It's not there yet.
 
I have just updated the README.md file on github to add a few notes about use of camilladsp-setrate with CamillaDSP v3.1 and later.
In fact, as of CamillaDSP v3.1, the playback device is guaranteed to resume after pause. Therefore the automatic unlocking of CamillaDSP after a temporary unavailability is no longer necessary.

https://github.com/marcoevang/camilladsp-setrate/tree/main
 
Last edited: