alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Information request - writing a driver for a virtual soundcard
@ 2010-08-18 17:53 Olof
  2010-08-18 19:15 ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Olof @ 2010-08-18 17:53 UTC (permalink / raw)
  To: alsa-devel

Hi!

Maybe this is the wrong place to ask, but I kinda feel that I'm out of options.

My goal is to write a dummy driver which makes the PCM data available
as a character device though /dev/whatever. Of course I start with the
dummy pcm driver. However I find it difficult to understand how the
driver shall poll PCM data from the ALSA framework. I've read the
how-to-write-a-driver doc and studied the hda driver but I don't
understand how it all fits together with substreams, reading from
intermediate buffers, the PCM memory management functions etc.

Could someone please help me out with some pointers to additional
documentation, a suitable piece of driver code to study or any thing
that might help?

Kind Regards,
Olof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Information request - writing a driver for a virtual soundcard
  2010-08-18 17:53 Information request - writing a driver for a virtual soundcard Olof
@ 2010-08-18 19:15 ` Daniel Mack
       [not found]   ` <AANLkTi=EO295r9BpmR105gYLRsjFhG3_kiD81mHTSLKP@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2010-08-18 19:15 UTC (permalink / raw)
  To: Olof; +Cc: alsa-devel

On Wed, Aug 18, 2010 at 07:53:29PM +0200, Olof wrote:
> Maybe this is the wrong place to ask, but I kinda feel that I'm out of options.

ALSA allows rerouting of audio material to arbitary userspace plugins,
which sounds like what you're looking for. PulseAudio also give you
similar options, so it seems unnecessary to hack around in kernel space.

What exactly are you trying to do?

Daniel


> My goal is to write a dummy driver which makes the PCM data available
> as a character device though /dev/whatever. Of course I start with the
> dummy pcm driver. However I find it difficult to understand how the
> driver shall poll PCM data from the ALSA framework. I've read the
> how-to-write-a-driver doc and studied the hda driver but I don't
> understand how it all fits together with substreams, reading from
> intermediate buffers, the PCM memory management functions etc.
> 
> Could someone please help me out with some pointers to additional
> documentation, a suitable piece of driver code to study or any thing
> that might help?
> 
> Kind Regards,
> Olof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Information request - writing a driver for a virtual soundcard
       [not found]   ` <AANLkTi=EO295r9BpmR105gYLRsjFhG3_kiD81mHTSLKP@mail.gmail.com>
@ 2010-08-18 19:33     ` Daniel Mack
  2010-08-18 19:44       ` Olof
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2010-08-18 19:33 UTC (permalink / raw)
  To: Olof; +Cc: alsa-devel

(please never remove any people from the list of recipients when
 replying, and please do not top-post)

On Wed, Aug 18, 2010 at 09:27:36PM +0200, Olof wrote:
> I want to connect my smartphone to my amplifier and then use it as a
> virtual soundcard. The actual sound data shall be transmitted over
> wireless TCP/IP from my laptop to the smartphone, enabling me to move
> around in the flat without wiring.

I still don't understand where the actual audio material has its origin,
or where it should be sent to, respectively.

> Thought a virtual soundcard was a
> good idea since it the whole system then would be independent of
> application playing sound on the laptop. I intended to do the
> compressing & transmission in user space, but perhaps everything can
> be done in user space? I wasn't aware of the possibility. Where can I
> read more?

I think the easiest API to access your existing sound cards and to
create virtual sinks and sources is offered by PulseAudio:

  http://pulseaudio.org/wiki/DeveloperDocumentation

In case your distribution uses PulseAudio natively, you souldn't even
need to set up anything.

HTH,
Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Information request - writing a driver for a virtual soundcard
  2010-08-18 19:33     ` Daniel Mack
@ 2010-08-18 19:44       ` Olof
  2010-08-18 20:00         ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Olof @ 2010-08-18 19:44 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel

> I still don't understand where the actual audio material has its origin,
> or where it should be sent to, respectively.

Origin is anything the user would choose to play on a "normal" system.
Pure sound from CD, mp3, ogg, wma played with xmmls, totem movie
player etc. Any application used to play sound on a Linux box. The PCM
stream would be compressed and transmitted over TCP/IP to the
smartphone which would play it on its output.

Thanks,
Olof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Information request - writing a driver for a virtual soundcard
  2010-08-18 19:44       ` Olof
@ 2010-08-18 20:00         ` Daniel Mack
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2010-08-18 20:00 UTC (permalink / raw)
  To: Olof; +Cc: alsa-devel

On Wed, Aug 18, 2010 at 09:44:05PM +0200, Olof wrote:
> > I still don't understand where the actual audio material has its origin,
> > or where it should be sent to, respectively.
> 
> Origin is anything the user would choose to play on a "normal" system.
> Pure sound from CD, mp3, ogg, wma played with xmmls, totem movie
> player etc. Any application used to play sound on a Linux box. The PCM
> stream would be compressed and transmitted over TCP/IP to the
> smartphone which would play it on its output.

Jup. You can easily do that by capturing the PulseAudio master monitor
and do whatever you like with the data inside your PulseAudio client.

Another option - in case you have full control over the code running on
the smart phone - is to make the phone act as PulseAudio network
service, so multiple other network members could send audio to it, or
receive audio from it. With or without authentication, compressed or
uncompressed and all that, depending on your implementation.

Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-18 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-18 17:53 Information request - writing a driver for a virtual soundcard Olof
2010-08-18 19:15 ` Daniel Mack
     [not found]   ` <AANLkTi=EO295r9BpmR105gYLRsjFhG3_kiD81mHTSLKP@mail.gmail.com>
2010-08-18 19:33     ` Daniel Mack
2010-08-18 19:44       ` Olof
2010-08-18 20:00         ` Daniel Mack

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).