[alsa-devel] sound: latency and synchronization measurements
[ Please keep me in CC as I'm not subscribed to the list]
Hi All,
I am trying to characterize the audio synchronization between two systems. There is a mechanism to route audio between two systems, we run ‘aplay’ at one system and ‘arecord’ in other system.
We need to measure the time difference when audio sample is out at one port and arriving at another port in different system.
I plan to add printk’s in “struct snd_pcm_ops” call backs, but does these call backs tells when it received first and last audio frames\samples?
Or else please suggest any other best method.
On Fri, May 18, 2018 at 06:07:29PM +0530, Muni Sekhar wrote:
[ Please keep me in CC as I'm not subscribed to the list]
Hi All,
I am trying to characterize the audio synchronization between two systems. There is a mechanism to route audio between two systems, we run ‘aplay’ at one system and ‘arecord’ in other system.
We need to measure the time difference when audio sample is out at one port and arriving at another port in different system.
I plan to add printk’s in “struct snd_pcm_ops” call backs, but does these call backs tells when it received first and last audio frames\samples?
Or else please suggest any other best method.
First off you need a "shared timer/clock" between the two systems in order to have a chance to determine what actually happens here. Good luck with that! :)
Also, there's been tons of research in this area over the years, please look into that, odds are these problems have been solved already. I know of several commercial devices that already handle this just fine.
best of luck!
greg k-h
On Fri, May 18, 2018 at 6:42 PM, Greg KH greg@kroah.com wrote:
On Fri, May 18, 2018 at 06:07:29PM +0530, Muni Sekhar wrote:
[ Please keep me in CC as I'm not subscribed to the list]
Hi All,
I am trying to characterize the audio synchronization between two systems. There is a mechanism to route audio between two systems, we run ‘aplay’ at one system and ‘arecord’ in other system.
We need to measure the time difference when audio sample is out at one port and arriving at another port in different system.
I plan to add printk’s in “struct snd_pcm_ops” call backs, but does these call backs tells when it received first and last audio frames\samples?
Or else please suggest any other best method.
First off you need a "shared timer/clock" between the two systems in order to have a chance to determine what actually happens here. Good luck with that! :)
Yes, we do have the shared clock.
Also, there's been tons of research in this area over the years, please look into that, odds are these problems have been solved already. I know of several commercial devices that already handle this just fine.
Can you point me some information on this.
best of luck!
greg k-h
Hi,
You could try bitbanging any availiable peripheral(i.e gpio) from each system at the callbacks and have a logic analyzer measuring and reporting time delay.
Best regards,
Aris
On Fri, May 18, 2018 at 3:37 PM, Muni Sekhar munisekharrms@gmail.com wrote:
[ Please keep me in CC as I'm not subscribed to the list]
Hi All,
I am trying to characterize the audio synchronization between two systems. There is a mechanism to route audio between two systems, we run ‘aplay’ at one system and ‘arecord’ in other system.
We need to measure the time difference when audio sample is out at one port and arriving at another port in different system.
I plan to add printk’s in “struct snd_pcm_ops” call backs, but does these call backs tells when it received first and last audio frames\samples?
Or else please suggest any other best method.
-- Thanks, Sekhar
Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Fri, May 18, 2018 at 6:53 PM, Aris Aris father.aris@gmail.com wrote:
Hi,
You could try bitbanging any availiable peripheral(i.e gpio) from each system at the callbacks and have a logic analyzer measuring and reporting time delay.
Thank you very much Aris for this information. I am fairly new to sound sub system, I’m glad if you can point me on the callbacks.
Does the sound driver will be notified aplay\arecord open via “snd_xxx_open(struct snd_pcm_substeam *substream)” callback? Which callbacks of sound driver will tell when it received first and last audio frames\samples?
Best regards,
Aris
On Fri, May 18, 2018 at 3:37 PM, Muni Sekhar munisekharrms@gmail.com wrote:
[ Please keep me in CC as I'm not subscribed to the list]
Hi All,
I am trying to characterize the audio synchronization between two systems. There is a mechanism to route audio between two systems, we run ‘aplay’ at one system and ‘arecord’ in other system.
We need to measure the time difference when audio sample is out at one port and arriving at another port in different system.
I plan to add printk’s in “struct snd_pcm_ops” call backs, but does these call backs tells when it received first and last audio frames\samples?
Or else please suggest any other best method.
-- Thanks, Sekhar
Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
Aris Aris
-
Greg KH
-
Muni Sekhar