From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: A suggestion for better resamplers in alsa. Date: Thu, 07 Apr 2005 10:32:06 +0200 Message-ID: References: <4252EDF9.6090608@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Jaroslav Kysela Cc: James Courtier-Dutton , Clemens Ladisch , alsa-devel List-Id: alsa-devel@alsa-project.org At Thu, 7 Apr 2005 09:56:48 +0200 (CEST), Jaroslav wrote: > > On Tue, 5 Apr 2005, James Courtier-Dutton wrote: > > > I have yet another possible idea. What about reporting to the > > application whether resampling needs to be done at the rate requested by > > the application, together with reporting the resulting hardware rate. > > The application could then detect when it should maybe try resampling > > itself to improve quality. We could then have resampling helper > > functions to alsa-lib, that the application could call to do the actual > > resampling before it send the samples to the card. In this way the > > application will get visibility of the fixed hardware period size, and > > make more educated descisions regarding which output rate to use. > > This could probably be supported by the addition of a new function call > > "snd_pcm_prevent_resampling(...)". This call would be called by the > > application just before it calls snd_pcm_set_rate(), and this would > > modify the behaviour of the snd_pcm_set_rate() function or just > > implement a new function "snd_pcm_set_rate_no_resample()". > > > > We would still want alsa-lib pcm layer to do the sample format > > conversion and all the other plugins, just not the problematic resampling. > > alsa-lib would then provide a selection of resampling functions that the > > application could then use before snd_pcm_writei() or any other form of > > mmap transfer. > > > > For example, the application xine has a feature to force a particular > > output sample rate, but at the moment, the user has to manually > > configure the output sample rate if they wish it to be anything apart > > from the sample rate of the media stream. With this new alsa function, > > xine could be informed when to use it's own internal resamplers, and > > when not to bother, removing the need for the user having to manually > > configure the "force_output_sample_rate" setting. But xine would still > > wish to send floating point samples to alsa-lib, knowing that alsa-lib > > will convert them to 24bit or 16bit depending on the sound card. > > I like this idea. This setup belongs to: > > snd_pcm_hw_params_set_rate_noresample() This feature would be nice especially also for the sound servers which do resampling by themselves. Takashi ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click