From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tom Browne" Subject: Re: snd_pcm_writei not returning (?!?) Date: Tue, 6 Apr 2004 10:58:19 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <021d01c41bbd$b0a8fc10$0100a8c0@burpxp> References: <01d901c41bb6$988aaf40$0100a8c0@burpxp> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Jaroslav Kysela Cc: Clemens Ladisch , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Jaroslav Kysela wrote: >> 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. Running a file compare, I see only one line of significant difference between the version in 0.9rc2 and 1.0.4 pcm.c... err = snd_pcm_sw_params_set_start_threshold(handle, swparams, (buffer_size / period_size) * period_size); Which gives threshold = 6552 from buffer=6553, period=3276... exactly the same value as the code I was already using gives! What else am I missing from the garish red and yellow blocks of WinDiff? Why does changing to mmap writes make the blocking problem go away? And as I said, the problem only has been made to occur at 88.2 and 96K sampling rates... - Tom. ------------------------------------------------------- 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