All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Bill Unruh <unruh@physics.ubc.ca>
Cc: alsa-user@lists.sourceforge.net,
	ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: How to get set/fixed sample rate of ALSA device?
Date: Mon, 08 Oct 2007 21:30:42 +0200	[thread overview]
Message-ID: <470A8562.50301@keyaccess.nl> (raw)
In-Reply-To: <Pine.LNX.4.64.0710081212360.32693@info.physics.ubc.ca>

On 10/08/2007 09:14 PM, Bill Unruh wrote:

> On Mon, 8 Oct 2007, Peteris Krisjanis wrote:
> 
>>> Introducing a /proc/asound/card0/pcm0{p,c}/hw_limits or similar might
>>>  not be a bad idea though?
>> 
>> That would be good idea, with completion with 'alsainfo' about device.
>> 
>> How to do that properly, any clues before I try to sink my teeths in 
>> ALSA code?
> 
> Is this even possible? Ie, do sound cards actually tell you what their
> max or min hardware capabilities are and what info might you put into
> here? Ie, some cards can do 2 or 4 or 5.1 channel output. Do you put that
> in? And re speed, does the card actually advertise what speeds it
> supports, or is it more a matter of trying and if it does not support it,
> it rejects it.

It's really only about communicating what the _driver_ accepts (ie, tells us 
the hardware can do). That is, basically export the snd_pcm_hardware struct 
for the stream.

It could also be done in userspace by opening the stream and quering the 
format_mask, channels and rates and stuff and I'll look into that a bit as a 
followup to the rates_min/max thing that I posted if only as a template 
thingy, but unless I'm missing it, I don't believe there's actually a way to 
get the information from userspace without opening the "hw" device, and that 
one only allows "subdevices_count" concurrent opens, meaning you'd have to 
stop things talking to your soundcard if it has just one (normal).

Exposing it directly in /proc/asound would be the way. Peteris; if you'll be 
looking, note that rates (and channels) might not be continuous between 
their min and max or anything; mostly it's enumerated stuff. Looking at the 
/proc/asound/card0/pcm0p/sub0/hw_params file generation probably helps (but 
that just exports the currently selected paramters, not all possible).

Rene.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  reply	other threads:[~2007-10-08 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b97f4ee40710061456l5aa0764alce22c505401c7e6f@mail.gmail.com>
     [not found] ` <4708F918.3060207@keyaccess.nl>
     [not found]   ` <b97f4ee40710071004o23ea40a1w8c8f754b47083b95@mail.gmail.com>
2007-10-07 22:07     ` How to get set/fixed sample rate of ALSA device? Rene Herman
2007-10-07 22:27       ` Rene Herman
     [not found]       ` <200710080841.37709.markc@renta.net>
2007-10-07 23:52         ` Rene Herman
2007-10-08 19:09       ` Peteris Krisjanis
2007-10-08 19:14         ` Bill Unruh
2007-10-08 19:30           ` Rene Herman [this message]
2007-10-09  0:23             ` Rene Herman
2007-10-15 20:20               ` [Alsa-user] " Rene Herman
2007-10-16 13:26                 ` [alsa-devel] " Takashi Iwai

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=470A8562.50301@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=alsa-devel@alsa-project.org \
    --cc=alsa-user@lists.sourceforge.net \
    --cc=unruh@physics.ubc.ca \
    /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.