alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: linux@audioscience.com
To: patch@alsa-project.org
Cc: tiwai@suse.de,
	Eliot Blennerhassett <eblennerhassett@audioscience.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH 1/3] Support single-rate no-SRC cards.
Date: Fri, 25 Mar 2011 15:25:46 +1300	[thread overview]
Message-ID: <1301019948-3539-1-git-send-email-linux@audioscience.com> (raw)

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Cards without settable local samplerate and without SRC
still must have a valid samplerate.
This fixed rate is determined by reading the current rate for the card.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
 pci/asihpi/asihpi.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
index 0ac1f98..22606e3 100644
--- a/pci/asihpi/asihpi.c
+++ b/pci/asihpi/asihpi.c
@@ -381,13 +381,13 @@ static void snd_card_asihpi_pcm_samplerates(struct snd_card_asihpi *asihpi,
 				"No local sampleclock, err %d\n", err);
 		}
 
-		for (idx = 0; idx < 100; idx++) {
-			if (hpi_sample_clock_query_local_rate(
-				h_control, idx, &sample_rate)) {
-				if (!idx)
-					snd_printk(KERN_ERR
-						"Local rate query failed\n");
-
+		for (idx = -1; idx < 100; idx++) {
+			if (idx == -1) {
+				if (hpi_sample_clock_get_sample_rate(h_control,
+								&sample_rate))
+					continue;
+			} else if (hpi_sample_clock_query_local_rate(h_control,
+							idx, &sample_rate)) {
 				break;
 			}
 
@@ -440,8 +440,6 @@ static void snd_card_asihpi_pcm_samplerates(struct snd_card_asihpi *asihpi,
 		}
 	}
 
-	/* printk(KERN_INFO "Supported rates %X %d %d\n",
-	   rates, rate_min, rate_max); */
 	pcmhw->rates = rates;
 	pcmhw->rate_min = rate_min;
 	pcmhw->rate_max = rate_max;
-- 
1.7.0.4

             reply	other threads:[~2011-03-25  2:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  2:25 linux [this message]
2011-03-25  2:25 ` [PATCH 2/3] Improve non-busmaster adapter operation linux
2011-03-25  2:25 ` [PATCH 3/3] Update verbose debug print macros linux
2011-03-25 13:12 ` [PATCH 1/3] Support single-rate no-SRC cards 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=1301019948-3539-1-git-send-email-linux@audioscience.com \
    --to=linux@audioscience.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=eblennerhassett@audioscience.com \
    --cc=patch@alsa-project.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).