All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raymond Yau <superquad.vortex2@gmail.com>
To: Clemens Ladisch <clemens@ladisch.de>,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	Takashi Iwai <tiwai@suse.de>
Subject: Re: snd_pcm_hw_rule_noresample
Date: Fri, 23 Sep 2011 09:19:36 +0800	[thread overview]
Message-ID: <CAN8cciask6QSBuoj2n87_Po1Xxi3v=FQHdbfnRM+ZvmyvtshQA@mail.gmail.com> (raw)
In-Reply-To: <4E785362.2090808@ladisch.de>

2011/9/20 Clemens Ladisch <clemens@ladisch.de>:
> Raymond Yau wrote:
>> ALSA: pcm: add snd_pcm_hw_rule_noresample()
>> ...
>>
>> ymfpci and emu10k1 have SNDRV_PCM_RATE_CONTINUOUS and support 8000Hz to 48000Hz
>>
>> after this patch and if application using
>> snd_pcm_hw_params_set_rate_resample(,pcm , params ,0)
>>
>> why the supported rate is only 48000Hz ?
>
> Because these cards run at 48 kHz and resample anything else.  That
> the resampler is implemented in hardware does not make a conceptual
> difference, and just means that the resampler has low quality.
>
>> but snd_pcm_hw_params_get_rate_min() is still 8000Hz
>
> This should not happen.  I'd guess the rules engine hasn't noticed
> that some parameters affected by the new rule need to change.
>
> Please try the patch below.  But there might be drivers where other
> parameters are affected by SND_PCM_HW_PARAMS_NORESAMPLE, so I guess
> all parameter bits need to be set.
>
>> This patch won't affect the accuracy of the playback position of the ymfpci
>
> Why should it?
>

I think the correct way for ymfpci is to add a period_bytes constraint
(just like emu10k1 and au88x0) in addition of a switch to fixed rate
at 48000Hz to force the application to choose a period time which is
close to the interval of timer interrupt

 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 1024);

are there any problem in snd_pcm_drain(), snd_pcm_rewind() and
snd_pcm_forward() when the driver let the application select any
period time when those hardware mixing sound card 's DSP have to mix
audio streams?

since hwptr is inaccurate, snd_pcm_rewindable() may need to return
zero if it can only rewind to period boundary

  parent reply	other threads:[~2011-09-23  1:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  8:24 snd_pcm_hw_rule_noresample Raymond Yau
2011-09-20  8:48 ` snd_pcm_hw_rule_noresample Clemens Ladisch
2011-09-21  7:09   ` snd_pcm_hw_rule_noresample Clemens Ladisch
2011-09-23  1:19   ` Raymond Yau [this message]
2011-09-23  6:33   ` snd_pcm_hw_rule_noresample Raymond Yau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN8cciask6QSBuoj2n87_Po1Xxi3v=FQHdbfnRM+ZvmyvtshQA@mail.gmail.com' \
    --to=superquad.vortex2@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.