Reading number of samples for follower devices
We want to tunnel audio data from an usb-gadget device to a usb-soundcard.
The usb-soundcard is forced to be the driver of the graph.
The sampling rate is propagated back to the usb-gadget device so state->resample = false
.
For both devices state->disable_tsched = true
.
In this case for the driver and for the follower snd_pcm_avail_update
(spa/plugins/alsa/alsa-pcm.c
function alsa_avail
) is called.
This is a problem when the period size of both devices are equal.
Sometimes the position of the follower is updated after the driver is fetching the position. In this case we miss a complete period which leads to a big error and to a resync.
I think for a follower the function snd_pcm_avail
should called to prevent such problems.