From: James Courtier-Dutton <James@superbug.co.uk>
To: Roger Villars <roger.villars@fhso.ch>
Cc: 'Takashi Iwai' <tiwai@suse.de>, alsa-devel@lists.sourceforge.net
Subject: Re: Userspace ALSA Soundcard
Date: Fri, 15 Oct 2004 13:59:36 +0100 [thread overview]
Message-ID: <416FC9B8.6020308@superbug.co.uk> (raw)
In-Reply-To: <MEMPHISWYTZiAXCKe570000000d@Memphis.stud.so.fhnw.ch>
Roger,
pcm_jack lets alsa-lib talk to the jackd daemon.
So, you implement your own bluez daemon, and then implement a plugin for
alsa-lib that talks to it.
You just need to think of the problem slighly differently.
If you look at any standard alsa application, it does:
open()
set_params()
read_write_samples()
close()
With an alsa-lib plugin, at the open() step, it could talk to the bluez
daemon, and see if the bluez connections are up, and if so, allow the
open, otherwise, fail the open() call.
The current ALSA API does not allow for more complicated audio devices.
You have to use extra other apis to implement what you want.
e.g. A headset with volume up/down buttons. The buttons arrive via the
kernel input/events api, and the sound goes via ALSA.
For an application to use a bluetooth headset, the application will
first have to talk to the bluetooth api to set up the bluetooth specific
connections, and then once bluetooth is set up, it would open an ALSA
device in order to send sound to the device.
Roger Villars wrote:
> Thanks for your answer!
>
> I looked at pcm_jack a bit closer and it seems to be
> some sort of plugin for ALSA. Actually, this is not exactly
> what I need. I thought about something like this:
>
> int main(......)
> {
> create a new soundcard
> connect to the headset using blueZ
> while(true) {
> get the audio stream from blueZ
> give the audio stream to the soundcard
> same thing, other direction
> }
> remove the soundcard
> }
>
> (programming could be so easy ;-) )
>
> That's why I mentioned the deamon. With this, I can use the headset
> with the program running in the background without the need to change
> any kernel stuff. But it seems to me that ALSA is not made for this.
> So it would be very complicated, don't you think?
>
> Roger
>
> -----Original Message-----
> From: alsa-devel-admin@lists.sourceforge.net
> [mailto:alsa-devel-admin@lists.sourceforge.net] On Behalf Of Takashi Iwai
> Sent: Thursday, October 14, 2004 5:36 PM
> To: Roger Villars
> Cc: alsa-devel@lists.sourceforge.net
> Subject: Re: [Alsa-devel] Userspace ALSA Soundcard
>
> At Thu, 14 Oct 2004 09:32:52 +0200,
> Roger Villars wrote:
>
>>
>>Hello
>>
>>I'm new to the ALSA Framework and I'm trying to program a "virtual"
>>soundcard for a Bluetooth Headset that is running completely in
>>userspace. No kernel modules or something.
>>
>>You should only start a deamon program and then every ALSA beware
>>program can "see" a new Soundcard.
>
>
> Even the daemon wouldn't needed, I guess.
> Well, the mixer might be problematic in some cases.
>
>
>>First Question: Do you think this is possible?
>
>
> Yes.
>
>
>>Second Question: How?
>
>
> A good question :) There is no real documentation for this.
> As you wrote below, jack_pcm.c is the best example to rerfer to.
>
>
>>I heard that there is a file called pcm_jack.c in ALSA that is doing
>>exactly what I need. But as I'm new to ALSA I don't know how and where
>>in the code it is doing it.
>>
>>Would be nice if somebody can give me some Know-how.
>
>
> Basically, you need to write dozen of callbacks for each pcm operation. The
> most cryptical part is the PCM configuration.
> The PCM layer calls hw_params, hw_refine, and sw_params callbacks for
> querying and setting up the proper configuration.
>
>
> Takashi
>
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
next prev parent reply other threads:[~2004-10-15 12:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-14 7:32 Userspace ALSA Soundcard Roger Villars
2004-10-14 15:35 ` Takashi Iwai
2004-10-15 11:53 ` Roger Villars
2004-10-15 12:59 ` James Courtier-Dutton [this message]
2004-10-18 9:05 ` Roger Villars
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=416FC9B8.6020308@superbug.co.uk \
--to=james@superbug.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
--cc=roger.villars@fhso.ch \
--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.