All of lore.kernel.org
 help / color / mirror / Atom feed
* SALSA-Lib: Playback overrun on initial PCM start
@ 2007-06-28 19:01 J. Scott Merritt
  2007-06-29  9:25 ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: J. Scott Merritt @ 2007-06-28 19:01 UTC (permalink / raw)
  To: alsa-devel

Dear List,

Using SALSA-Lib 0.0.3, I call:	

snd_pcm_open (&playback_handle, argv[1], SND_PCM_STREAM_PLAYBACK, 0);
snd_pcm_hw_params_malloc (&hw_params);
snd_pcm_hw_params_any (playback_handle, hw_params);
snd_pcm_hw_params_set_access (playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
snd_pcm_hw_params_set_format (playback_handle, hw_params, SND_PCM_FORMAT_S16_LE));
snd_pcm_hw_params_set_rate_near (playback_handle, hw_params, 44100, 0);
snd_pcm_hw_params_set_channels (playback_handle, hw_params, 2);
snd_pcm_hw_params_set_buffer_size_last (playback_handle, hw_params, &bfrsize);
snd_pcm_hw_params_get_buffer_size (hw_params, &bfrsize);
snd_pcm_hw_params (playback_handle, hw_params);
snd_pcm_hw_params_free (hw_params);
	
snd_pcm_sw_params_malloc (&sw_params);
snd_pcm_sw_params_current (playback_handle, sw_params);
snd_pcm_sw_params_set_avail_min (playback_handle, sw_params, 4096);
snd_pcm_sw_params_set_start_threshold (playback_handle, sw_params, 10000U);
snd_pcm_sw_params_set_xfer_align (playback_handle, sw_params, 1);
snd_pcm_sw_params (playback_handle, sw_params);
	
state = snd_pcm_state (playback_handle);
frames_to_deliver = snd_pcm_avail_update (playback_handle);

while ((frames_to_deliver = snd_pcm_avail_update (playback_handle)) > 4096) {
   snd_pcm_writei (playback_handle, &buf, 4096) }


As soon as the buffer start threshold is reached, or alternatively
if I manually start PCM stream, the PCM stream reports an overrun
(i.e. "Broken Pipe").  If I then examine the PCM state, it is in the
overrun (XRUN) state.

The code is being cross-compiled and tested on an ARM processor
(PXA270) which is running linux kernel 2.6.21.   This same code sequence
-does- operate properly (in the same ARM test environment) when compiled
against AlsaLib 1.0.13.

Another apparent (and perhaps relevent) difference between AlsaLib and
SALSA-Lib is that if I open the PCM stream with O_NONBLOCK and then call
snd_pcm_poll_descriptors, AlsaLib gives me a FD = 4, whereas SALSA-Lib
reports an FD = 3;

Thanks, Scott.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-06-29 17:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-28 19:01 SALSA-Lib: Playback overrun on initial PCM start J. Scott Merritt
2007-06-29  9:25 ` Takashi Iwai
2007-06-29 15:24   ` J. Scott Merritt
2007-06-29 16:07     ` Takashi Iwai
2007-06-29 16:26       ` J. Scott Merritt
2007-06-29 17:15         ` Takashi Iwai
2007-06-29 17:33           ` J. Scott Merritt
2007-06-29 17:10       ` SALSA-Lib: Playback Select/Poll not effective J. Scott Merritt
2007-06-29 17:16       ` SALSA-Lib: Playback overrun on initial PCM start J. Scott Merritt

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.