Hi,
I'm developing an audio stream player application with ALSA output, the player has a large software buffer. The trouble is that the stream can potentially change the sampling rate (e.g. streaming RTP from a VLC playlist created from different MP3 songs). How to properly handle this?
I'm thinking of the following concept: The codec feeds data into the software buffer together with markers for sample rate changes. The ALSA playback is asynchronous, using a callback function feeding the data from the software buffer into ALSA. If a samplerate marker is hit the new rate is set.
Can the sample rate be set from a callback? What other constraints are there? And how does the HW FIFO handle samplerate changes? Or is there a better way of implementing?
Thanks a lot! Petr