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