From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Hofman Subject: Re: period_time in slave definition Date: Mon, 28 Feb 2011 14:20:33 +0100 Message-ID: <4D6BA121.2000103@ivitera.com> References: <4D6B943E.4060302@ivitera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cable.insite.cz (upc-plzen.insite.cz [84.242.100.8]) by alsa0.perex.cz (Postfix) with ESMTP id 2D884103837 for ; Mon, 28 Feb 2011 14:20:34 +0100 (CET) In-Reply-To: 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: Jaroslav Kysela Cc: alsa-devel List-Id: alsa-devel@alsa-project.org Jaroslav Kysela napsal(a): > On Mon, 28 Feb 2011, Pavel Hofman wrote: > >> Hi, >> >> According to >> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html , my >> .asoundrc contains: >> >> pcm.test { >> type plug >> slave { >> pcm "hw:0" >> format "unchanged" >> channels "unchanged" >> rate "unchanged" >> period_size 1024 >> buffer_size 4096 >> } >> } >> >> >> While pcm, format, channels, and rate are accepted, the period and >> buffer fields are refused: >> >> ALSA lib pcm.c:6811:(snd_pcm_slave_conf) Unknown field period_time > > It's correct, pcm:plug does not support buffer modifiers. Look to > "Automatic conversion plugin". > >> I checked the source code and the keywords seem to be ok >> >> pcm.c: >> static const char *const names[SND_PCM_HW_PARAM_LAST_INTERVAL + 1] = { >> [SND_PCM_HW_PARAM_FORMAT] = "format", >> [SND_PCM_HW_PARAM_CHANNELS] = "channels", >> [SND_PCM_HW_PARAM_RATE] = "rate", >> [SND_PCM_HW_PARAM_PERIOD_TIME] = "period_time", >> [SND_PCM_HW_PARAM_PERIOD_SIZE] = "period_size", >> [SND_PCM_HW_PARAM_BUFFER_TIME] = "buffer_time", >> [SND_PCM_HW_PARAM_BUFFER_SIZE] = "buffer_size", >> [SND_PCM_HW_PARAM_PERIODS] = "periods" >> }; > > It's just a table to translate all possibilites between index and name. > The plug plugins allow only this: > > err = snd_pcm_slave_conf(root, slave, &sconf, 3, > SND_PCM_HW_PARAM_FORMAT, SCONF_UNCHANGED, &sformat, > SND_PCM_HW_PARAM_CHANNELS, SCONF_UNCHANGED, &schannels, > SND_PCM_HW_PARAM_RATE, SCONF_UNCHANGED, &srate); > > Jaroslav > Thanks a lot for your response. Is there a way to set default period/buffer parameters for applications which do not specify them (i.e. audacious)? My idea was to put it somewhere into device definition in .asoundrc. Dmix is not used. Thanks, Pavel.