Re: Slightly OT: how to pipe output to look like a soundcard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Oops.  Forgot to reply to the list as well...)

I'm definitely not an ALSA expert, but I believe there's supposed
to be a way to do what you're asking.  There's a kernel module
called snd_aloop that creates one or more artificial sound cards.
You can play sound samples to it from one client and capture
sound samples from it with another client.  You can put options
for the loopback sound cards in /etc/modprobe.conf or similar and
then make sure to load the module when you boot (or later).

In this case, you could pipe the output of your SDR program into
aplay with appropriate options to set type (probably "-t raw"),
set format, and direct the samples to the loopback card with
something similar to "-D hw:2,0,0".  Then, connect one (or IIUC,
multiple) capture clients to something similar to "-D hw:2,1,0".

Unfortunately, there appears to be a problem with at least some
recent kernels.  On about February 23, I posted a problem and
question about behavior I notice on Mageia 2 where the loopback
sound card allows its input (playback) stream to run
significantly faster than the specified/accepted rate, and the
output (capture) stream gets overruns.  I have yet to hear an
answer or other reply to that problem/question.  I'm about to
file a bug report about the problem.

Fortunately for you, in your case, if your SDR sends at exactly
the right rate, you might be okay once the buffers all find their
pace and stride.

HTH

Robert


> To: alsa-user@xxxxxxxxxxxxxxxxxxxxx
> From: lists@xxxxxxxxxxxxxx
> Date: Sat, 2 Mar 2013 01:52:50 +0000
>
> Not exactly ALSA related, but I have software defined radio
> program that feeds an audio stream to stdout. Can I make it
> look like a /dev/dsp device so other programs can use it.  That
> is programs designed to read from soundcards?

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux