Re: Reproducible pops on some hardware

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

 



On 06/14/12 10:30, Bryan Ischo wrote:
>
> Here is a technique I have tried to reduce the effect of underrun.  In 
> my application, underrun either means that the process that is 
> generating audio can't keep up (it's a game emulator, generating audio 
> and video frames at a fixed rate, and some games can't be emulated at 
> full speed and so don't generate audio fast enough, and in that case, 
> the user experience is not going to be great; I'd rather have choppy 
> audio than pops though so this is why I tried the following technique):
>
> snd_pcm_sw_params_get_boundary(sw_params, &boundary);
> snd_pcm_sw_params_set_stop_threshold(pcmM, sw_params, boundary);
> snd_pcm_sw_params_set_silence_threshold(pcmM, sw_params, 0);
> snd_pcm_sw_params_set_silence_size(pcmM, sw_params, boundary);
>
> The idea here is to play silence on underrun instead of looping (which 
> sounds bad), and also to avoid having to re-prepare the device after 
> underrun which takes time and only compounds the performance problem 
> that is resulting in underruns.
>
> The thing is, this technique didn't work on some hardware - once ALSA 
> played silence instead of underrunning one time, it never would play 
> anything again.  I didn't investigate too deeply though.
>
> Is this technique sensible at all?

Hm, I think I may have found the reason that it doesn't work sometimes 
... I just printed out the boundary value that I am getting from 
snd_pcm_sw_params_get_boundary(), and it is 4611686018427387904 (on a 64 
bit system where sizeof(snd_pcm_uframes_t) == 8).

That value is 0x4000000000000000 in hex.  I have no idea what that means.

Bryan


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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