All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: Takashi Iwai <tiwai@suse.de>
Cc: Mark Knecht <markknecht@gmail.com>Mark Knecht
	<markknecht@gmail.com>,
	Patrick Shirkey <pshirkey@boosthardware.com>,
	alsa-devel@lists.sourceforge.net
Subject: Re: Maintaining sound card at a specific frequency
Date: Wed, 19 Jan 2005 11:07:03 +0100 (CET)	[thread overview]
Message-ID: <XFMail.20050119110703.pochini@shiny.it> (raw)
In-Reply-To: <s5hzmz6vdov.wl@alsa2.suse.de>


On 18-Jan-2005 Takashi Iwai wrote:

>> > You can add a control to lock the sample rate (e.g. ICE1712).
>>
>> Yep, I know, but it's not part of the pcm API: applications do not
>> lock the sample rate themselves. The user has to do it manually. This is
>> why I choosed an alternate solution. If apps were able to lock the rate it
>> would be very useful. It may need some help from the driver, though.
>
> I think this is above the PCM API since this influences the whole
> system.  It's fine to add a new API call in alsa-lib, just as a
> wrapper to toggle such a  control, though...

My driver workarounds the problem this way:

When opencount==1 the app can change the rate freely.
When opencount>1 the app can change the rate only if it
has not been set yet.
pcm_open() always returns the whole frequency range. There
is a rule that does rate_min=rate_max=current_rate when
the user cannot change the sample rate.

This solves all common cases:

1- trivial case:
        open, set_rate, play, close

2- single app, two substreams:
        open(1), open(2), set_rate(1), set_rate(2), ...
        open(1), set_rate(1), open(2), set_rate(2), ...

3- two apps:
        A               B
        open
        set_rate(44)
        ...             open
        ...             set_rate(48) -> sets 44
        ...             play
        close           ...
                        set_rate(48) -> sets 48
                        ...

Of course this method doesn't solve completely the problem
Mark is having, because it doesn't warrant that the rate stays
at 48K always.


--
Giuliano.


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

  reply	other threads:[~2005-01-19 10:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-16 21:05 Maintaining sound card at a specific frequency Mark Knecht
2005-01-17  5:14 ` Patrick Shirkey
2005-01-18 15:50   ` Giuliano Pochini
2005-01-18 16:48     ` Takashi Iwai
2005-01-18 17:01       ` Mark Knecht
2005-01-18 17:08         ` Takashi Iwai
2005-01-18 17:12           ` Mark Knecht
2005-01-18 17:15             ` Takashi Iwai
2005-01-18 17:43               ` Mark Knecht
2005-01-18 17:48           ` Takashi Iwai
2005-01-18 18:04             ` Mark Knecht
2005-01-18 17:31       ` Giuliano Pochini
2005-01-18 17:40         ` Takashi Iwai
2005-01-19 10:07           ` Giuliano Pochini [this message]
2005-01-18 17:45         ` Mark Knecht
2005-01-18 19:51           ` Takashi Iwai
2005-01-18 21:22             ` Mark Knecht
2005-01-18 21:30           ` Lee Revell
2005-01-18 23:16             ` Mark Knecht
2005-01-19 19:59   ` Mark Knecht
2005-01-19  9:07 ` Clemens Ladisch
2005-01-19 10:14   ` Takashi Iwai
2005-01-19 19:49   ` Mark Knecht
2005-01-19 21:09     ` Russ Pridemore
2005-01-19 23:08       ` Mark Knecht

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=XFMail.20050119110703.pochini@shiny.it \
    --to=pochini@shiny.it \
    --cc=markknecht@gmail.com \
    --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.