From: Pavel Hofman <pavel.hofman@insite.cz>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Takashi Iwai <tiwai@suse.de>,
ALSA development <alsa-devel@alsa-project.org>
Subject: AK4114 - capturing spdif input stops the stream
Date: Wed, 12 Mar 2008 23:50:08 +0100 [thread overview]
Message-ID: <47D85E20.7060109@insite.cz> (raw)
Hi,
here is my scenario:
ICE1724 card, trying to record from SPDIF input via AK4114, ICE1724
slaved to SPDIF clock from the receiver.
The card detects SPDIF input rate correctly (in my case ESI Juli where
AK4114 is provided with independent clock signal to enable the rate
detection). Let's say it is 192000.
Now I want to arecord the input stream, let's say in CD quality, using
the plug plugin. The command fails, because of the check in ak4114.c:
res = external_rate(rcs1);
if (!(flags & AK4114_CHECK_NO_RATE) && runtime && runtime->rate != res) {
snd_pcm_stream_lock_irqsave(ak4114->capture_substream, _flags);
if (snd_pcm_running(ak4114->capture_substream)) {
printk(KERN_DEBUG "rate changed (%i <- %i)\n", runtime->rate, res);
snd_pcm_stop(ak4114->capture_substream, SNDRV_PCM_STATE_DRAINING);
res = 1;
}
snd_pcm_stream_unlock_irqrestore(ak4114->capture_substream, _flags);
}
The stream gets stopped because res = 192000 and runtime->rate = 44100.
The problem is that the capture device still offers all the available
rates, instead of the single SPDIF input one. Thus, the plug plugin is
not forced to convert from 192000 to 44100 and runtime->rate is 44100
instead of 192000.
Of course recording at 192000 works fine.
What would be the best way to force the SPDIF capture device to offer
(advertise) only the current rate? This functionality would have to be
applicable only to the few cards correctly detecting incoming rate
(unlike most ice1724 cards without independent clock in slave mode).
If the card cannot detect input frequency reliably (the driver developer
should know), I guess it should not do the check in ak4114.c at all - I
can prepare a simple patch for that.
The same will most probably apply to cards with AK4117 as the code looks
the same.
I know it is a minor issue but if a user hits this problem, it will take
him a lot of effort to fix his setup appropriately.
Thanks,
Pavel.
next reply other threads:[~2008-03-12 22:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-12 22:50 Pavel Hofman [this message]
2008-03-13 7:50 ` AK4114 - capturing spdif input stops the stream Takashi Iwai
2008-03-13 12:49 ` Pavel Hofman
2008-03-13 13:57 ` Takashi Iwai
2008-03-13 14:11 ` Pavel Hofman
2008-03-13 19:18 ` Pavel Hofman
2008-03-14 16:18 ` Takashi Iwai
2008-03-14 17:15 ` Pavel Hofman
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=47D85E20.7060109@insite.cz \
--to=pavel.hofman@insite.cz \
--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.