From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gustavo da Silva Serra Subject: Re: Application hangs with different period sizes Date: Thu, 03 Jul 2008 12:31:02 -0300 Message-ID: <486CF0B6.7090004@tet.com.br> References: <2ee9e08d0807030019i1442729cyd241d72074791077@mail.gmail.com> <486CBAE9.60203@tet.com.br> <2ee9e08d0807030554t259c3b79x9023d901408a36e7@mail.gmail.com> <486CCD83.4040408@tet.com.br> <2ee9e08d0807030641g15a14349o8cce5a029f555132@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from einstein.tteng.com.br (mail.tteng.com.br [201.86.232.130]) by alsa0.perex.cz (Postfix) with ESMTP id 4618E24926 for ; Thu, 3 Jul 2008 17:31:08 +0200 (CEST) In-Reply-To: <2ee9e08d0807030641g15a14349o8cce5a029f555132@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: anuj aggarwal Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Sorry, I didn't read the log. I don't know where you can find this limitation, the only thing I know is that a specific model of Audigy, for example, seems to support only two periods. Can't you just use 1024 or 512? I don't know why the application crashes, it is something that is beyond my knowledge, sorry. anuj aggarwal escreveu: > I think the library/driver is able to configure the way user has > requested. See the logs (in my first mail) which confirm that the > requested period size has been taken for configuration. > > Where can I found the limitation in the driver code/spec which says > that these period sizes are not supported? Any suggestion is most > welcome... > > Thanks, > Anuj > > On Thu, Jul 3, 2008 at 6:30 PM, Gustavo da Silva Serra > > wrote: > > I think that snd_pcm_hw_params_set_period_size_near() will not > return an error, but you must check the "val" parameter, is it > returning the same value that you passed? > > "Some periods are not supported" means that some cards may not > support periods that aren't power of two. I am not sure, since I > am new to ALSA and I am working most with aloop. > > anuj aggarwal escreveu: > > I am doing the same. I used > snd_pcm_hw_params_set_period_size_near() to set the period > size and checked the return value also; it was not an error. > > I have one more question. When you say 'Some periods are not > supported', what does that mean? What are the constraints > which make some periods not-supported by the audio codec driver? > > On Thu, Jul 3, 2008 at 5:11 PM, Gustavo da Silva Serra > > >> wrote: > > Do you check the result of the function that sets the > period size? > Some periods are not supported and you can't assume that > they are > valid and proceed in your application. Use > snd_pcm_hw_params_set_period_time_near to see what is the > nearest > possible value for period. > > > > anuj aggarwal escreveu: > > My audio driver supports buffer sizes from 128 to 32768 and > period sizes > from 8 to 2048. I am trying to set the period size as 1030 > (just a random > number between 8 & 2048, but not multiple of 2^n) and > buffer > size as > 16*buffer_size (i.e. 16480). The output is as follows: > > Buffer size range from 128 to 32768 > Period size range from 8 to 2048 > Request period size 1030 and got 1030 > Plug PCM: Hardware PCM card 0 'TWL4030' device 0 > subdevice 0 > Its setup is: > stream : PLAYBACK > access : RW_INTERLEAVED > format : S16_LE > subformat : STD > channels : 2 > rate : 44100 > exact rate : 44100 (44100/1) > msbits : 16 > buffer_size : 16480 > period_size : 1030 > period_time : 23356 > tstamp_mode : NONE > period_step : 1 > avail_min : 1030 > start_threshold : 16480 > stop_threshold : 16480 > silence_threshold: 0 > silence_size : 0 > boundary : 1080033280 > > The problem with this setup is the application just hangs > without playing > anything. If I use period size as 2048, the app plays > the song > but clips the > last part of it. If I use 1024/512, it works fine. > > I have tried alsa lib version 1.0.15 & 1.0.16 but the > problem > persists. Is > there anything wrong with my app or audio driver? > > Please help. > > Thanks in advance, > Anuj Aggarwal > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > > > > > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel > > __________ NOD32 3238 (20080703) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > > > > > > > > > -- > Best Regards, > Anuj Aggarwal > > > > > > -- > Best Regards, > Anuj Aggarwal