From: Clemens Ladisch <clemens@ladisch.de>
To: Laurent Pinchart <laurent.pinchart@skynet.be>
Cc: alsa-devel@alsa-project.org, linux-usb@vger.kernel.org
Subject: Re: [RFC] ALSA vs. dedicated char device for a USB Audio Class gadget driver
Date: Mon, 18 May 2009 10:39:24 +0200 [thread overview]
Message-ID: <4A111EBC.2010606@ladisch.de> (raw)
In-Reply-To: <200905171925.23956.laurent.pinchart@skynet.be>
Laurent Pinchart wrote:
> The applicable techniques require knowledge of both the audio clock and the
> SOF clock in a common place. My driver has no access to the audio clock. All
> it knows about is the SOF clock.
>
> There are only two options I can think of.
>
> The first one is to use an asynchronous endpoint and sent the occasional
> smaller or bigger packet (or duplicate/drop one sample). As the driver can't
> access the audio clock it needs to derive the information from the amount of
> data present in the ALSA ring buffer. To be honest I'm not sure if that will
> be possible at all, as the application will write data at a non-constant rate.
The ALSA API assumes that the device controls the audio clock and that
the application derives its own speed from that, not the other way
round.
> The second one, which sounds easier, at least on the driver side, is to use a
> synchronous endpoint with a fixed packet size. The application will perform
> rate matching (duplicating/dropping a sample or resampling the audio stream)
> using the audio clock and the SOF clock. What I'm still unsure about is how
> the application can access the audio clock and the SOF clock through ALSA, but
> I suppose that's possible.
The ALSA API doesn't give you access to the SOF clock.
What you want to do is not possible (or impracticably hard) with the
ALSA API; I strongly suggest that you define your own API for your
audio gadget driver so that SOF clock information is made available to
the application, and that packet sizes can be directly controlled by the
application.
Best regards,
Clemens
next prev parent reply other threads:[~2009-05-18 8:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <laurent.pinchart@skynet.be>
[not found] ` <200905141545.01798.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-14 18:18 ` [RFC] ALSA vs. dedicated char device for a USB Audio Class gadget driver Hal Murray
2009-05-14 20:58 ` Laurent Pinchart
[not found] ` <200905142258.42935.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-14 21:12 ` Steve Calfee
[not found] ` <4a5ff6bc0905141412t5ab4f0f5x6c50b4e38af0790f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-14 21:25 ` Laurent Pinchart
[not found] ` <200905142325.24408.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-15 7:01 ` [alsa-devel] " Clemens Ladisch
[not found] ` <4A0D135C.7090806-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2009-05-15 9:36 ` Laurent Pinchart
[not found] ` <200905151136.52995.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-15 15:07 ` Clemens Ladisch
[not found] ` <4A0D8532.4070104-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2009-05-15 15:52 ` Laurent Pinchart
[not found] ` <200905151752.58040.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-15 17:04 ` Clemens Ladisch
2009-05-17 16:49 ` Laurent Pinchart
2009-05-15 20:15 ` Hal Murray
[not found] ` <20090515201519.7C347BCE6-1EH7ZSm6cX1tFMQ1DeeEjrzXk6sypdOaHzxsA6J8rrk@public.gmane.org>
2009-05-17 17:25 ` Laurent Pinchart
[not found] ` <200905171925.23956.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-17 21:28 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0905171654500.20300-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-05-18 14:36 ` Laurent Pinchart
2009-05-18 8:39 ` Clemens Ladisch [this message]
[not found] ` <4A111EBC.2010606-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2009-05-18 14:47 ` Laurent Pinchart
[not found] ` <200905181647.41771.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2009-05-19 11:01 ` Clemens Ladisch
2009-05-14 13:45 Laurent Pinchart
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=4A111EBC.2010606@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=laurent.pinchart@skynet.be \
--cc=linux-usb@vger.kernel.org \
/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.