* snd_pcm_sw_params_set_start_threshold() functionality
@ 2012-10-29 11:20 irfanks
2012-10-29 12:28 ` irfanks
0 siblings, 1 reply; 2+ messages in thread
From: irfanks @ 2012-10-29 11:20 UTC (permalink / raw)
To: alsa-devel
Hello,
snd_pcm_sw_params_set_start_threshold() API description
explains, "PCM is automatically started when playback frames available
to PCM are >= threshold"
I want to know, whether above pre-buffering(threshold)
mechanism is only during the start of playback ?
OR
Also if my playback device goes to XRUN state, Again next
time when i prepare my playback device using snd_pcm_prepare(). Again
the prebuffering (threshold) will occur since i have set
snd_pcm_sw_params_set_start_threshold() to N periods in software params.
Best Regards,
Thanks in advance,
Irfan...
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: snd_pcm_sw_params_set_start_threshold() functionality
2012-10-29 11:20 snd_pcm_sw_params_set_start_threshold() functionality irfanks
@ 2012-10-29 12:28 ` irfanks
0 siblings, 0 replies; 2+ messages in thread
From: irfanks @ 2012-10-29 12:28 UTC (permalink / raw)
To: alsa-devel
Please let me know if my below understanding is correct :
snd_pcm_sw_params_set_start_threshold() explains :
"PCM is automatically started when playback frames available to PCM are
>= threshold or when requested capture frames are >= threshold"
PCM has below states :
SND_PCM_STATE_OPEN Open
SND_PCM_STATE_SETUP Setup installed
SND_PCM_STATE_PREPARED Ready to start
SND_PCM_STATE_RUNNING Running
SND_PCM_STATE_XRUN Stopped: underrun (playback) or
overrun (capture) detected
SND_PCM_STATE_DRAINING Draining: running (playback) or
stopped (capture)
SND_PCM_STATE_PAUSED Paused
SND_PCM_STATE_SUSPENDED Hardware is suspended
SND_PCM_STATE_DISCONNECTED Hardware is disconnected
When ever underrun occurs, PCM device state goes to XRUN state.
To bring back the PCM playback device to playback {Ready to start}, we
use snd_pcm_prepare().
*Thus snd_pcm_sw_params_set_start_threshold() should again
prebuffer(threshold) X periods of data {which we have set in software
params}, once again after the XRUN state is recovered.*
Thanks and regards,
Irfan
On 10/29/2012 04:50 PM, irfanks wrote:
> Hello,
>
> snd_pcm_sw_params_set_start_threshold() API description
> explains, "PCM is automatically started when playback frames available
> to PCM are >= threshold"
>
> I want to know, whether above pre-buffering(threshold)
> mechanism is only during the start of playback ?
> OR
> Also if my playback device goes to XRUN state, Again next
> time when i prepare my playback device using snd_pcm_prepare(). Again
> the prebuffering (threshold) will occur since i have set
> snd_pcm_sw_params_set_start_threshold() to N periods in software params.
>
>
> Best Regards,
> Thanks in advance,
> Irfan...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-29 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 11:20 snd_pcm_sw_params_set_start_threshold() functionality irfanks
2012-10-29 12:28 ` irfanks
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.