Re: [AGL6.x][4a-softmixer]Question about high latency of audio playback

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

 



Dear Mr Bultel,

    Thank you very much for your patience.

    Actually, I'm intending to measure the total delay of snd_aloop and procedure of copy loop in softmixer.

    I have adjusted the size of period and buffer and tried mmap stream by adding parameters of aplay. However, it doesn't work. The delay is still as much as before.

    1. I am wondering that if you have other approaches to reduce the latency.

    2. About "delayms" option, I reckon that only Bluetooth use it for configuration. Would it be possible for you to show me how to apply "delayms" option to multimedia?


On 2019/4/3 上午10:05, Thierry Bultel wrote:
Hello,

The software buffer size is determined by aplay, it depends
on some default values and/or command line options, and will
have an impact on your measure if you do it this way.
Have a look at --period-time and --buffer-size.

I guess you are intending to measure the inner latency of snd_aloop,
FYI the softmixer introduces an extra delay, because it has to deal
with a copy loop, too (from snd-aloop capture, to the PCM stack 
softvol+rate_converter+route+dmix+harware card).
That delay buffer is configurable, it is the "delayms" option in the HAL 
json
file.

Notice that there are some things that can be done to reduce this 
latency at the softmixer size, for instance mmap writes/reads have been 
tested at the beginning of the project, but not validated up to now.

Best regards,
Thierry.

On 04/02/2019 06:11 AM, luop wrote:
> Hello,
> 
> I understood that AGL is using the ALSA loopback driver to create a 
> virtual sound card to abstract underlying real sound cards. Softmixer 
> capture audio from the loopback in user-space, and then subsequently 
> playback to a real sound card.
> 
> So there must be a latency introduced. I want to measure how much this 
> latency is.
> 
> I recorded the time stamp that aplay  invoked the snd_pcm_writei for the 
> first time. And recorded the time stamp that write thread in softmixer 
> invoked the snd_pcm_writei for the first time. The difference of these 
> two time stamps should be the latency introduced.
> 
> But the measurement result of latency is extremely high, which is nearly 
> 1.4 second.
> 
> 1. I am wondering that if the approach of measurement is wrong.
> 
> 2. I am wondering that if anyone has measured this latency. Would it be 
> possible for you to share the approach and result with me?
> 
> Thank you , and I look forward to hearing from you.
> 
> Best Regards
> 
> ------------------------------------------------------------------
> Frank Luo(罗鹏)
> 
> Neusoft Automotive Solution Business Unit
> 
> Neusoft Corporation
> 
> 901 Huangpu Road High-Tech Zone Dalian 116085, PRC
> 
> Tel: (86 411) 8446 6663
> 
> Fax: ((86 411) 8446 6742
> 
> Mobile:15840620310
> 
> Email:_luo.p__ at neusoft.com_ <mailto:xxxxxxxxxx at neusoft.com>
> 
> _www.neusoft.com <http://www.neusoft.com/>
> _
> 
> 
> ---------------------------------------------------------------------------------------------------
> Confidentiality Notice: The information contained in this e-mail and any 
> accompanying attachment(s)
> is intended only for the use of the intended recipient and may be 
> confidential and/or privileged of
> Neusoft Corporation, its subsidiaries and/or its affiliates. If any 
> reader of this communication is
> not the intended recipient, unauthorized use, forwarding, printing,  
> storing, disclosure or copying
> is strictly prohibited, and may be unlawful.If you have received this 
> communication in error,please
> immediately notify the sender by return e-mail, and delete the original 
> message and all copies from
> your system. Thank you.
> ---------------------------------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> automotive-discussions mailing list
> automotive-discussions at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions
> 

Best Regards

------------------------------------------------------------------
Frank Luo(
罗鹏)

Neusoft Automotive Solution Business Unit

Neusoft Corporation

901 Huangpu Road High-Tech Zone Dalian 116085, PRC

Tel: (86 411) 8446 6663

Fax: ((86 411) 8446 6742

Mobile:15840620310

Email:luo.p@neusoft.com

www.neusoft.com


---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

_______________________________________________
automotive-discussions mailing list
automotive-discussions@xxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux