All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug McLain <nostar@comcast.net>
To: alsa-devel@lists.sourceforge.net
Subject: return value of snd_pcm_hw_params_set_rate_near
Date: Mon, 01 Mar 2004 02:21:51 -0500	[thread overview]
Message-ID: <4042E48F.8090009@comcast.net> (raw)

According to the alsa documentation, the return value of 
snd_hw_params_set_rate_near is the 'approximate chosen rate', and the 
3rd arg being type 'int'.  The two tutorials at the documentation 
section of the alsa-project website both hold true to this with code like:

exact_rate = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, rate, &dir);
    if (dir != 0) {
      fprintf(stderr, "The rate %d Hz is not supported by your hardware.\n 
                       ==> Using %d Hz instead.\n", rate, exact_rate);
    }



After unsuccesful attempts at using this function this way (I'm learning 
linux audio software devel starting with alsa drivers and user 
interface), I went into the aplay source and found the version that 
tests a before and after version of arg 3 (which is a pointer to int 
that gets changed to the result rate by the function) and tests the 
return only for err. I assume this function changed?  Im at the learning 
stage so I'm probably stating the obvious, but when your new sometimes 
reassurance from someone that knows helps.  Is the documentaion just 
behind, or did this slip by unnoticed?  Curious...

---

http://nostar.isa-geek.com




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

             reply	other threads:[~2004-03-01  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01  7:21 Doug McLain [this message]
2004-03-01  8:24 ` return value of snd_pcm_hw_params_set_rate_near Jaroslav Kysela
2004-03-01  8:49   ` Doug McLain
2004-03-01  9:21 ` Måns Rullgård

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=4042E48F.8090009@comcast.net \
    --to=nostar@comcast.net \
    --cc=alsa-devel@lists.sourceforge.net \
    /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.