From: Takashi Iwai <tiwai@suse.de>
To: "Bryan Wu" <cooloney@kernel.org>
Cc: "ALSA devel" <alsa-devel@alsa-project.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Question] Can I open a substream in kernel space without attach to a file pointer?
Date: Wed, 19 Nov 2008 14:49:52 +0100 [thread overview]
Message-ID: <s5h63mjddvj.wl%tiwai@suse.de> (raw)
In-Reply-To: <386072610811190200l576d7735rb0188ab53f5185fa@mail.gmail.com>
At Wed, 19 Nov 2008 18:00:36 +0800,
Bryan Wu wrote:
>
> Hi Takashi,
>
> I am developing a USB gadget driver compliant to USB Audio Class Spec 2.0.
> So I want to open a PCM substream and do some playback of capture,
> then close them?
>
> I found snd_pcm_open_substream() is for opening a substream and attach
> it to a file.
> But in my application, there is no need to open a file before opening
> a substream.
>
> - Is there any interface for me to open a substream in kernel space
> without attach to a file?
> - How to playback and capture in kernel space, use snd_pcm_lib_write
> and snd_pcm_lib_read?
> - How to get the snd_pcm_hardware struct from low level driver,
> because I have to get the hardware configuration of the snd pcm
> device?
>
> And I am reading the code of OSS emulator in ALSA. It provides some
> info about the kernel space sound card programming.
Yes, OSS emulation code handles the PCM in the kernel.
But, basically I don't recommend you to do this -- it's not the job of
the sound card driver. The whole PCM stuff is handled by the PCM
middle layer, not the driver itself.
Any reason why you handle the PCM stuff completely in your driver
code?
Takashi
next prev parent reply other threads:[~2008-11-19 13:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-19 10:00 Bryan Wu
2008-11-19 13:49 ` Takashi Iwai [this message]
2008-11-19 15:42 ` Bryan Wu
2008-11-19 16:01 ` Takashi Iwai
2008-11-20 6:27 ` Bryan Wu
2008-12-11 10:40 ` Bryan Wu
2008-12-11 12:03 ` Takashi Iwai
2008-12-11 13:19 ` Bryan Wu
2008-12-11 13:24 ` Takashi Iwai
2008-12-11 14:12 ` Bryan Wu
2008-12-12 6:59 ` [alsa-devel] " Takashi Iwai
2008-12-12 8:49 ` Bryan Wu
2008-12-12 9:07 ` 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=s5h63mjddvj.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=cooloney@kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®