From 803f6e5279ec2531f5073d351009f1e105420d25 Mon Sep 17 00:00:00 2001 Message-Id: <803f6e5279ec2531f5073d351009f1e105420d25.1714973842.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 24 Sep 2007 16:57:53 +0100 Subject: [PATCH] docs updates Organization: Straylight/Edgeware From: rjk@greenend.org.uk <> --- CHANGES | 8 ++++---- README.streams | 37 ++++++++++++++++++++++++++++++------- doc/disorder-playrtp.1.in | 5 +++-- doc/disorder_config.5.in | 4 +++- server/speaker-network.c | 9 +++++---- 5 files changed, 45 insertions(+), 18 deletions(-) diff --git a/CHANGES b/CHANGES index c95c17e..ab023a3 100644 --- a/CHANGES +++ b/CHANGES @@ -38,10 +38,10 @@ crash when random play was enabled has been fixed. A new configuration option 'queue_pad' allows the number of random tracks kept on the queue to be controlled. -New configuration options 'speaker_command', 'sample_format' and -'sox_generation' direct the speaker process to send audio data to a -subcommand instead of straight to the sound card, for instance for -broadcasting over a network. +** Network Play + +DisOrder can broadcast audio over a network, allowing it to be played on +multiple client machines. See README.streams for details. ** disorderfm diff --git a/README.streams b/README.streams index 82226d6..aa4c26b 100644 --- a/README.streams +++ b/README.streams @@ -26,8 +26,34 @@ interrupt the playing track, you have to scratch it manually. Go back to normal play by scratching the stream. -Creating A Stream Of DisOrder Output -==================================== +RTP Streaming +============= + +DisOrder is now capable to transmitting RTP streams over a suitable network. +To enable this make sure that allplayers use the speaker process, i.e. execraw +rather than exec (or it won't work properly) and configure the network speaker +backend: + + speaker_backend network + broadcast 172.17.207.255 9003 + broadcast_from 172.17.207.2 9002 + +broadcast_from is optional but may be convenient for some cases. + +To play, use the disorder-playrtp client. + + disorder-playrtp 0.0.0.0 9003 + +Currently only 16-bit 44100Hz stereo is supported, which requires about +1.4Mbit/s. Possibly other lower-quality but lower-bandwidth encodings will be +supported in future. + +If you have a too-recent version of sox you may need to set the sox_generation +option. + + +Icecast Streaming +================= This can be achieved using the speaker_command option and Icecast (see http://www.icecast.org/). It will only work if you use the speaker process, @@ -83,11 +109,8 @@ to pause a stream in any case. I used IceCast 2.3.1 and Ices 2.0.1. You can play the stream with XMMS or whatever. The total setup seems to play rather behind the 'current' time, watch this space for a fix (or contribute one!) -Other DisOrder options you can set are sox_generation which you should set to -if you have a sufficently recent version of sox, due to an incompatile change -in its command syntax; and sample_format which determines what format is -supplied to the speaker_command. See disorder_config(5) for further -information. +If you have a too-recent version of sox you may need to set the sox_generation +option. Local Variables: diff --git a/doc/disorder-playrtp.1.in b/doc/disorder-playrtp.1.in index 8600517..18ca149 100644 --- a/doc/disorder-playrtp.1.in +++ b/doc/disorder-playrtp.1.in @@ -28,8 +28,6 @@ disorder-playrtp \- play DisOrder network broadcasts .SH DESCRIPTION \fBdisorder-playrtp\fR plays a network broadcast sent from the specified address. -.PP -It is currently a work in progress! .SH OPTIONS .TP .B --device \fIDEVICE\fR, \fB-D \fIDEVICE\fR @@ -49,6 +47,9 @@ Specifies the maximum buffer size in frames. If there are this many frames in the buffer then reading from the network socket will be suspended. The default is four times the \fB--buffer\fR value. .TP +.B --rcvbuf \fIBYTES\fR, \fB-R \fIBYTES\fR +Specifies socket receive buffer size. +.TP .B --help\fR, \fB-h Display a usage message. .TP diff --git a/doc/disorder_config.5.in b/doc/disorder_config.5.in index be922d2..cc8bd39 100644 --- a/doc/disorder_config.5.in +++ b/doc/disorder_config.5.in @@ -350,7 +350,9 @@ is specified, or (currently) on non-Linux systems. .TP .B network Transmit audio over the network. This is the default if -\fBbroadcast\fR is specified. +\fBbroadcast\fR is specified. You can use +.BR disorder-playrtp (1) +to receive and play the resulting stream on Linux and OS X. .RE .TP .B sox_generation \fB0\fR|\fB1 diff --git a/server/speaker-network.c b/server/speaker-network.c index 3d3bbc0..fab81a8 100644 --- a/server/speaker-network.c +++ b/server/speaker-network.c @@ -103,6 +103,11 @@ static void network_init(void) { socklen_t len; char *sockname, *ssockname; + /* Override sample format */ + config->sample_format.rate = 44100; + config->sample_format.channels = 2; + config->sample_format.bits = 16; + config->sample_format.byte_format = AO_FMT_BIG; res = get_address(&config->broadcast, &pref, &sockname); if(!res) exit(-1); if(config->broadcast_from.n) { @@ -139,10 +144,6 @@ static void network_init(void) { /* Select an SSRC */ gcry_randomize(&rtp_id, sizeof rtp_id, GCRY_STRONG_RANDOM); info("selected network backend, sending to %s", sockname); - if(config->sample_format.byte_format != AO_FMT_BIG) { - info("forcing big-endian sample format"); - config->sample_format.byte_format = AO_FMT_BIG; - } } /** @brief Play over the network */ -- [mdw]