Re: Any way to count samples written out to the ADC?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/5/28 Paul Adolph <padolph@xxxxxxxxx>:
> Is there any way to divine a count of samples that leave the ALSA ring
> buffer during playback? My application requires that I send a callback
> when a buffer-full of data is actually played for it to do A/V sync
> correctly. Right now I'm doing math  to figure out the right clock
> time to issue the callback, using the latency value from
> snd_pcm_delay(), but this is not working very well.
>
> Thanks in advance.
>

I don't know what sort of A/V method you are using, but needing a
callback for it seems wrong to me.
snd_pcm_delay() gives you a way to calculate the delay between you
writing samples to the buffer and them actually arriving at the
speakers. You can therefore calculate the exact time a particular
sample will reach the speakers, and work out the A/V sync required
from that. This is how xine works to achieve A/V sync.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux