Discussion:
[linux-audio-dev] alsa ethernet streaming?
Garett Shulman
2005-06-16 17:38:24 UTC
Permalink
Hello, I would like push audio streams over ethernet and was wondering
what avenues people have tried. I intend to have two linux boxes (or
more). Box1 has the user interface and all of the audio data. Box2 has
no user interface and is plugged into an amplifier and speakers.
Eventually I would like to have many Box2's. I envision an application
with a server running on box2 and a client running on box1. Ideally the
client would create an ALSA input and the server would create an ALSA
output. Then, the client connects to the server, any ALSA enabled app
connects to the input created by the client, and audio is heard from the
speakers connected to the server. I have no expectations that such an
application actually exists. I'm curious as to what options do exists to
push audio over etherenet. -Garett
i***@replic.net
2005-06-16 18:14:28 UTC
Permalink
Post by Garett Shulman
Hello, I would like push audio streams over ethernet and was wondering
what avenues people have tried. I intend to have two linux boxes (or
more). Box1 has the user interface and all of the audio data. Box2 has
no user interface and is plugged into an amplifier and speakers.
Eventually I would like to have many Box2's. I envision an application
with a server running on box2 and a client running on box1. Ideally the
client would create an ALSA input and the server would create an ALSA
output. Then, the client connects to the server, any ALSA enabled app
connects to the input created by the client, and audio is heard from the
speakers connected to the server. I have no expectations that such an
application actually exists. I'm curious as to what options do exists to
push audio over etherenet.
sorry, not ALSA:

http://www.alphalink.com.au/~rd/sw/jack.html
http://linuxaudioblog.jawebada.de/software/jack/jack-udpsync-0-3.html




-Garett
Garett Shulman
2005-06-16 18:17:50 UTC
Permalink
Post by i***@replic.net
Post by Garett Shulman
Hello, I would like push audio streams over ethernet and was wondering
what avenues people have tried. I intend to have two linux boxes (or
more). Box1 has the user interface and all of the audio data. Box2 has
no user interface and is plugged into an amplifier and speakers.
Eventually I would like to have many Box2's. I envision an application
with a server running on box2 and a client running on box1. Ideally the
client would create an ALSA input and the server would create an ALSA
output. Then, the client connects to the server, any ALSA enabled app
connects to the input created by the client, and audio is heard from the
speakers connected to the server. I have no expectations that such an
application actually exists. I'm curious as to what options do exists to
push audio over etherenet.
http://www.alphalink.com.au/~rd/sw/jack.html
http://linuxaudioblog.jawebada.de/software/jack/jack-udpsync-0-3.html
Cool!
Post by i***@replic.net
-Garett
Asbjørn Sæbø
2005-06-17 07:10:56 UTC
Permalink
Post by Garett Shulman
Hello, I would like push audio streams over ethernet and was wondering
what avenues people have tried.
I have an interest in the same thing, but with an emphasis on low
latency. I did a little bit of looking around this fall, but did not
find much. There are of course the normal streaming solutions, like
Icecast, which seem to work well, but has to large a latency for my
purposes (distributed music playing).

What I ended up with was writing my own. (Currently with assistance
from Lee Revell.) It has not come very far, but I am able to stream
music from one computer to another. It also deals with transmission
problems (lost/duplicate/out of order/late packets) and drift
adjustment. I have plans to release it in the not to distant future.
See <URL: http://www.q2s.ntnu.no/~asbjs/ldas/ldas.html > for more
information.

Then there is jack.udp, which I discovered half a year after starting my
work. This seems like a good tool. It streams jack data between two
jackds running on different computers.


There are a couple of reasons I didn't switch to jack.udp myself. As
far as I have understood (and I may well have misunderstood), jack.udp
does not do drift adjustment, so it will have synchronisation problems
if you want to use it between two computers with un-synched soundcard
clocks driving jackd. It will work well if one of the jackds is a
"slave" jackd, though. (Somebody please correct me if I'm wrong here.)

Also, the jack format keeps samples as 32bit floats. Although I do not
care that much for bandwidth issues, I found that doing away with half
of this, using 16 bit PCM, was valuable when transmitting over the
Internet in general.

Asbjørn
Garett Shulman
2005-06-17 17:27:14 UTC
Permalink
Asbjorn, LDAS looks perfect. Can you give more detail about the status?
-Garett
Post by Asbjørn Sæbø
Post by Garett Shulman
Hello, I would like push audio streams over ethernet and was wondering
what avenues people have tried.
I have an interest in the same thing, but with an emphasis on low
latency. I did a little bit of looking around this fall, but did not
find much. There are of course the normal streaming solutions, like
Icecast, which seem to work well, but has to large a latency for my
purposes (distributed music playing).
What I ended up with was writing my own. (Currently with assistance
from Lee Revell.) It has not come very far, but I am able to stream
music from one computer to another. It also deals with transmission
problems (lost/duplicate/out of order/late packets) and drift
adjustment. I have plans to release it in the not to distant future.
See <URL: http://www.q2s.ntnu.no/~asbjs/ldas/ldas.html > for more
information.
Then there is jack.udp, which I discovered half a year after starting my
work. This seems like a good tool. It streams jack data between two
jackds running on different computers.
There are a couple of reasons I didn't switch to jack.udp myself. As
far as I have understood (and I may well have misunderstood), jack.udp
does not do drift adjustment, so it will have synchronisation problems
if you want to use it between two computers with un-synched soundcard
clocks driving jackd. It will work well if one of the jackds is a
"slave" jackd, though. (Somebody please correct me if I'm wrong here.)
Also, the jack format keeps samples as 32bit floats. Although I do not
care that much for bandwidth issues, I found that doing away with half
of this, using 16 bit PCM, was valuable when transmitting over the
Internet in general.
Asbjørn
Asbjørn Sæbø
2005-06-20 08:26:18 UTC
Permalink
Post by Garett Shulman
Asbjorn, LDAS looks perfect. Can you give more detail about the status?
-Garett
Did you read the info I linked to?
<URL: http://www.q2s.ntnu.no/~asbjs/ldas/ldas.html >

It is, it must be said, still in early development. But some basic
functionality is present, and it has (almost?) reached a stage where it
will be useful for me.

LDAS consists of a sender and a receiver. It is, currently, capable of
quite reliable one-way transmission of two channels of audio.
(More than two channels should also work, but has not been tested in
this version.)

(I also just did some testing that indiciated that full duplex may be
achieved by running both sender and receiver on both computers. This
may serve as a stopgap until I get around to merge the sender and the
receiver into a full duplex version.)

Audio is taken from the analog input of the sending computer, and
delivered to the the analog output of the receiving computer.

The sender is very simple, it is mainly a loop reading data from the
sound card and writing them to a network socket.

The receiver is a bit more elaborate. It has two threads, one receiving
data from the network and queueing them, the other thread
transferring data from the queue to the sound card. The purpose of the
queue is to deal with lost/late/out of order/duplicate packets. There
is also a very simple mechanism (skip/reuse samples) to deal with
sampling frequency drift. (The sender and the receiver will not have
exactly equal clock frequencies.)

The latency is currently four sound card periods plus queue
length, network transmission time and A/D and D/A conversion time and
some processing time. With a good sound card and a short network
distance, latencies suitable for music playing should be attainable.
(I have measured this version to between 70 and 80 milliseconds, but
that was with 10 ms periods and a queue of three periods.)


It is still a bit early. But if you don't mind trying early code, I'll
send you the sources so you can see if it fits your needs.

Asbjørn

Continue reading on narkive:
Search results for '[linux-audio-dev] alsa ethernet streaming?' (Questions and Answers)
15
replies
what kind of laptop should i get?
started 2007-11-16 15:09:49 UTC
laptops & notebooks
Loading...