chiark / gitweb /
Suppress IO buffering when running tests
[disorder] / README.streams
CommitLineData
da6f7693 1* Introduction
803f6e52 2
5f5fc693
RK
3This file describes DisOrder's relationship to several different things that
4get called 'streams'.
da6f7693
RK
5
6* RTP Streaming
7
8DisOrder is capable to transmitting RTP streams over a suitable network.
9
10** Server Setup
11
12To enable this make sure that all players use the speaker process, i.e. execraw
803f6e52 13rather than exec (or it won't work properly) and configure the network speaker
14backend:
15
bd8895a8 16 api network
803f6e52 17 broadcast 172.17.207.255 9003
18 broadcast_from 172.17.207.2 9002
19
da6f7693 20The destination address (broadcast) can be:
da6f7693
RK
21 - a broadcast address for a local network
22 - a multicast address
23
5f5fc693
RK
24The source address (broadcast_from) is optional but may be convenient in some
25cases.
803f6e52 26
da6f7693
RK
27If the destination is a multicast address then you should set the TTL, for
28instance:
29
30 multicast_ttl 10
31
5f5fc693
RK
32(The destination can also be a unicast address but that's not a tested
33configuration.)
34
da6f7693
RK
35** Playing The Stream
36
37To play, use the disorder-playrtp client. If the destination address was a
38unicast or broadcast address then:
803f6e52 39
5f5fc693 40 disorder-playrtp 9003
803f6e52 41
da6f7693
RK
42If the destination address was a multicast address then you must specify that,
43for instance:
44
45 disorder-playrtp 224.2.3.4 9003
46
47If the client machine has a DisOrder configuration file allowing disorder(1) to
48connect to the server then the parameters are unnecessary: disorder-playrtp
49will figure out the details automatically.
50
51** Disobedience
52
53Disobedience is capable of running disorder-playrtp in the background (provided
54it is installed); look for the speaker icon. If it detects that the server is
55using network play then its volume control will apply to the local volume, not
56the server's volume.
57
5f5fc693 58If you run into trouble look for *.log files in the ~/.disorder directory.
da6f7693
RK
59
60** Limitations
61
803f6e52 62Currently only 16-bit 44100Hz stereo is supported, which requires about
da6f7693
RK
631.4Mbit/s. At the time of writing I've found this to work fine on 100Mbit/s
64ethernet and had reports of success with 10Mbit/s ethernet, but have not had
65any success with wireless.
803f6e52 66
da6f7693
RK
67Possibly other lower-quality but lower-bandwidth encodings will be supported in
68future.
803f6e52 69
5f5fc693 70If you have a very recent version of sox you may need to set the sox_generation
da6f7693 71option. See disorder_config(5).
b3b157a8 72
803f6e52 73
da6f7693 74* Icecast Streaming
1fe9ef21 75
76This can be achieved using the speaker_command option and Icecast (see
77http://www.icecast.org/). It will only work if you use the speaker process,
78i.e. execraw for everything.
79
80I used:
81
82 speaker_command "ices2 /etc/disorder/ices.xml"
83
84where ices.xml is:
85
86 <?xml version="1.0"?>
87 <ices>
88 <background>0</background>
89 <logpath>/var/log/ices</logpath>
90 <logfile>disorder.log</logfile>
91 <loglevel>4</loglevel>
92 <consolelog>0</consolelog>
93 <stream>
5f5fc693
RK
94 <metadata>
95 <name>lyonesse</name>
96 <genre>Various</genre>
97 <description>lyonesse disorder output</description>
98 </metadata>
99 <input>
100 <module>stdinpcm</module>
101 <param name="rate">44100</param>
102 <param name="channels">2</param>
103 <param name="metadata">1</param>
104 <param name="metadatafilename">/var/disorder/icedata</param>
105 </input>
106 <instance>
107 <hostname>lyonesse.anjou.terraraq.org.uk</hostname>
108 <port>8000</port>
109 <password>SOURCE PASSWORD HERE</password>
110 <mount>/disorder.ogg</mount>
111 <reconnectdelay>2</reconnectdelay>
112 <reconnectattempts>5</reconnectattempts>
113 <maxqueuelength>80</maxqueuelength>
114 <encode>
115 <nominal-bitrate>64000</nominal-bitrate>
116 <samplerate>44100</samplerate>
117 <channels>2</channels>
118 <flush-samples>8820</flush-samples>
119 </encode>
120 </instance>
121 </stream>
1fe9ef21 122 </ices>
123
124This doesn't seem to get on very well with pausing but you're unlikely to want
125to pause a stream in any case. I used IceCast 2.3.1 and Ices 2.0.1. You can
126play the stream with XMMS or whatever. The total setup seems to play rather
127behind the 'current' time, watch this space for a fix (or contribute one!)
128
803f6e52 129If you have a too-recent version of sox you may need to set the sox_generation
130option.
1fe9ef21 131
5f5fc693
RK
132Mark Wooding contributed the original support for this but it's been modified
133enough that he probably shouldn't be blamed for any bugs in the current code.
134
1fe9ef21 135
da6f7693 136* DisOrder and Republishing Internet Streams
b3b157a8
RK
137
138DisOrder doesn't have any built-in support for playing streams but you can make
139it do so. I use the following in my configuration file:
140
141 player /export/radio/*.oggradio shell 'xargs ogg123 -q < "$TRACK"'
142 collection fs iso-8859-1 /export/radio
143
144After setting this up you'll need to re-read the config file and provoke a
145rescan:
146
147 disorder reconfigure rescan /export/radio
148
149/export/radio contains a file for each stream, containing the URL to use:
150
151 lyonesse$ cat /export/radio/CUR1350.oggradio
152 http://cur.chu.cam.ac.uk:8000/cur.ogg
153
154You'll probably want to prevent random play of streams:
155
156 disorder set /export/radio/CUR1350.oggradio pick_at_random 0
157
158You can then queue a stream like any other track. It won't automatically
159interrupt the playing track, you have to scratch it manually. Go back to
160normal play by scratching the stream.
161
162
460b9539 163Local Variables:
da6f7693 164mode:outline
460b9539 165fill-column:79
166End: