On Tue, 6 Apr 2004, Tom Browne wrote: > Clemens Ladisch wrote: > >> state: PREPARED > > The pcm isn't (yet) running. > > > >> avail : 5 > > And the buffer is almost full. snd_pcm_writei blocks because it > > cannot write more data to the buffer, probably because the transfer > > threshold is too high. > > ?! See below... > > > How do you start the pcm? If you're using the start threshold, it may > > be too big, too. > > The code is based on alsa-lib/test/pcm.c using the poll method, so if you > look at that, you'll see how most of the parameters are set in my code. I > had to change to alsa_buffer_size-1 after upgrading to ALSA 0.9rc6 (I was > using rc2, if memory serves) otherwise it never started playing... it seems > something had changed in alsa-lib around this time. > > alsa_buffer_size = snd_pcm_hw_params_get_buffer_size(params); > err = snd_pcm_hw_params_set_period_time_near(handle, params, > alsa_period_time, &dir); > alsa_period_size = snd_pcm_hw_params_get_period_size(params, &dir); > ... > err = snd_pcm_sw_params_set_start_threshold(handle, swparams, > alsa_buffer_size-1)
It's not correct and it was never correct, but the pcm.c was buggy, too. Look to the latest version. Jaroslav ----- Jaroslav Kysela <[EMAIL PROTECTED]> Linux Kernel Sound Maintainer ALSA Project, SuSE Labs ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel