Personal tools

Difference between revisions of "Stream under Debian"

From Rivendell Wiki

Jump to: navigation, search
(Created page with "At first, this will cover streaming ogg vorbis streams using darkice and peercast. So, Rivendell will play to jack. Jack sits on alsa. Hook up the Rivendell outputs to the ja...")
 
(No difference)

Latest revision as of 11:06, 13 March 2018

At first, this will cover streaming ogg vorbis streams using darkice and peercast.

So, Rivendell will play to jack. Jack sits on alsa. Hook up the Rivendell outputs to the jack inputs. Jack encodes the stream and sends to peercast. People run peercast and tune in to your stream. Or, if you have the bandwidth, people can pull the stream direct from your peercast server like it was a shoutcast/icecast or icecast2 server.

Install Under Debian

Follow the instructions for installing under Debian.

Install a stream source

You can select one of these stream sources. The stream source will take the sound stream from the jack server, encode and send it to the broadcast server.

DarkIce

NOTE: Many people have not been able to get DarkIce to work properly. I seems like it sets up correctly. You can see it in jack and patch to it. Never generates any errors but in the end never works. See this wiki page on streaming for information on edcast-jack that does work.

Install DarkIce. You will need at least darkice 0.15 for jack support.

Configure

This is a config that I had working for darkice with jack: (darkice-public.cfg)

# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration        = 60        # duration of encoding, in seconds. 0 means forever
bufferSecs      = 0         # size of internal slip buffer, in seconds

# this section describes the audio input that will be streamed
[input]
device          = jack  # OSS DSP soundcard device for the audio input
sampleRate      = 48000     # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample   = 16        # bits per sample. try 16
channel         = 2         # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast server
# there may be up to 8 of these sections, named [icecast-0] ... [icecast-7]
# these can be mixed with [icecast2-x] and [shoutcast-x] sections
#[icecast-0]
#bitrateMode     = cbr       # constant bit rate
#bitrate         = 96        # bitrate of the mp3 stream sent to the server
#quality         = 0.8       # encoding quality
#server          = yp.yourserver.com
                            # host name of the server
#port            = 8000      # port of the IceCast server, usually 8000
#password        = hackme    # source password to the IceCast server
#mountPoint      = sample96  # mount point of this stream on the IceCast server
#name            = DarkIce trial
                            # name of the stream
#description     = This is only a trial
                            # description of the stream
#url             = http://www.yourserver.com
                            # URL related to the stream
#genre           = my own    # genre of the stream
#public          = yes       # advertise this stream?

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode     = abr       # average bit rate
format          = vorbis    # format of the stream: ogg vorbis
bitrate         = 32        # bitrate of the stream sent to the server
server          = localhost
                            # host name of the server
port            = 7144      # port of the IceCast2 server, usually 8000
password        = pass    # source password to the IceCast2 server
mountPoint      = /myradio1.ogg  # mount point of this stream on the IceCast2 server
name            = myRadio Radio
                            # name of the stream
description     = Mostly CC BY and BY-SA music
                            # description of the stream
url             = http://yp.peercast.org/?find=myRadio&Submit=Search
                            # URL related to the stream
genre           = myRadio music    # genre of the stream
public          = yes       # advertise this stream?

# this section describes a streaming connection to a ShoutCast server
# there may be up to 8 of these sections, named [shoutcast-0] ... [shoutcast-7]
# these can be mixed with [icecast-x] and [icecast2-x] sections
#[shoutcast-0]
#bitrateMode     = vbr       # variable bit rate mode
#quality         = 0.5       # encoding quality
#server          = yp.yourserver.com
                            # host name of the server
#port            = 8001      # source port of the ShoutCast server, usually 8001
#password        = hackme    # source password to the ShoutCast server
#name            = DarkIce trial
                            # name of the stream
#url             = http://www.yourserver.com
                            # URL related to the stream
#genre           = my own    # genre of the stream
#public          = yes       # advertise this stream?
#irc             = irc.yourserver.com
                            # IRC info related to the stream
#aim             = aim here  # AIM info related to the stream
#icq             = I see you too
                            # ICQ info related to the stream

Ices2

Install Ices2. You will need to use the ices-kh release which provides the jack support.

Note: ices-kh is very hard to find anywhere, if you can find it. See this wiki page on streaming for information on edcast-jack that is available on the oddsock.org website.

Configure

Here is a config that I had working: (ices-jack-public.xml)


<?xml version="1.0"?>
<ices>
    <background>1</background>  <!-- run in background? (unimplemented) -->
    <realtime>1</realtime>      <!-- disable realtime, enabled by default -->
    <user>root</user>           <!-- user to change to when started as root -->
    <logpath>/var/log/ices</logpath>     <!-- where log goes. -->
    <logsize>2048</logsize>     <!-- the size the log has to get to before cycling -->
    <logfile>ices.log</logfile>
    <loglevel>4</loglevel>      <!-- 1=error,2=warn,3=info,4=debug -->
    <consolelog>0</consolelog>  <!-- logfile is ignored if this is set to 1 -->
    <pidfile>/var/ices/ices.pid</pidfile> <!-- file to write process id to -->

	<stream>
        <!-- global settings for all streams - optional-->
        <name>myRadio Radio</name>
        <genre>myRadio music (mostly)</genre>
        <description>Mostly CC BY and BY-SA music</description>

	<!-- input module -->
        <!-- This example uses the 'jack' module. It takes input from the -->
        <!-- jack ports and processes it for live -->
        <!-- encoding. If metadatafilename is set then at start and on USR1 -->
        <!-- the file is read and the comments are added into the stream -->
		<input>
			<module>jack</module>
			<param name="channels">2</param>        <!-- number channels that will be available as jack ports-->
			<param name="clientname">ices</param>   <!-- jackclient name  -->
			<param name="connect">rivendell_0:playout_0L,rivendell_0:playout_0R,rivendell_0:playout_1L,rivendell_0:playout_1R</param> <!-- Comma-separated list of ports to connect to at startup.(optional, it is also possible to use tools like jack.plumbing to take care of the connections)  -->
			<param name="metadatafilename">/root/icesmeta</param>
		</input>
        <!-- more input section can be stated here, and can be switched manually -->
        <!-- by USR2 or whenever the previous input finishes. The order is       -->
        <!-- dictated in here and loops aronnd to the first one listed -->

        <!-- A runner is a thread that applies the input data to each outgoing -->
        <!-- stream instance defined within it.  Multiple runners can be stated -->
        <!-- for use on multiple processors. -->
        <runner>
            <!-- stream instance,  used to associate a set of encoding settings -->
            <!-- with output.  At the moment 2 outputs can be used, shout and  -->
            <!-- savestream. Any number or combination of these outputs can be used -->
            <instance>
                <!-- per instance setting, overriding the global settings - optional-->
                <!-- <name>test transmission</name>
                <genre>various</genre>
                <description>low bandwidth stream</description>
                -->     
                <!-- You define hostname and port for the server here, along with -->
                <!-- the source password and mountpoint.  If you miss them out  -->
                <!-- then any processing will still occur but it won't be sent to -->
                <!-- icecast, useful for encode to file only -->
                <shout>
                    <hostname>localhost</hostname>
                    <port>7144</port>
                    <password>mypassword</password>
                    <mount>/bysa1.ogg</mount>
                </shout>

                <!-- resample input to the stated samplerate  - optional
                     the input can change samplerate so this can be used to fix it
                     at a certain rate -->
                
		<resample>
                    <out-rate>22040</out-rate>
                </resample>
		

                <!-- stereo->mono downmixing, enabled by setting this to 1 - optional -->
                <downmix>1</downmix>
                <!-- Live encoding/reencoding: -->
                <encode>  
                    <quality>0.7</quality>
                    <!-- usual options for encoding, except from samplerate and chanels -->
                    <!-- they are set from input/resample/downmix setting -->
                </encode>
            </instance>

            <instance>
                <!-- per instance setting, overriding the global settings - optional-->
                <!-- <name>test transmission</name>
                <genre>various</genre>
                <description>low bandwidth stream</description>
                -->     
                <!-- You define hostname and port for the server here, along with -->
                <!-- the source password and mountpoint.  If you miss them out  -->
                <!-- then any processing will still occur but it won't be sent to -->
                <!-- icecast, useful for encode to file only -->
                <shout>
                    <hostname>localhost</hostname>
                    <port>8000</port>
                    <password>mypassword</password>
                    <mount>/bysa2.ogg</mount>
                </shout>

                <!-- resample input to the stated samplerate  - optional
                     the input can change samplerate so this can be used to fix it
                     at a certain rate -->
                
		<resample>
                    <out-rate>22040</out-rate>
                </resample>
		

                <!-- stereo->mono downmixing, enabled by setting this to 1 - optional -->
                <downmix>1</downmix>
                <!-- Live encoding/reencoding: -->
                <encode>  
                    <quality>0.7</quality>
                    <!-- usual options for encoding, except from samplerate and chanels -->
                    <!-- they are set from input/resample/downmix setting -->
                </encode>
            </instance>

        </runner>


	</stream>
</ices>



Install a broadcast server

You can select one of these broadcast servers. It will receive the encoded stream from the source stream and provide it to the public listeners.

You can choose classic broadcast servers (like Icecast2) or peer-to-peer broadcast solutions (like PeerCast or FreeCast).

PeerCast

Install PeerCast. Current version (as of May 18/2005) is PeerCast v0.1211

Configure

FreeCast

Install the FreeCast debian package available on the Tryphon Debian Archiver.

IceCast

Install the IceCast streaming server using the instructions and source code found at IceCast.

Icecast2/Shoutcast Meta Data from Rivendell

  • RD Stream was written by J Hoff. (shoutcast version).
  • Modified for Debian & icecast2 by drew Roberts.
  • Also adapted from icecast2 as follows
  • Written by Miquel van Smoorenburg.
  • Modified for Debian by Ian Murdock.
  • Further modified by Keegan Quinn for use with Icecast 2


The package rdstream-dR.tgz can be downloaded in two places for the Rivendell email list archive.

Download site 1

Download site 2

However please note the following about downloading.

At the bottom of the post you will see:

Attachment: rdstream-dR.tgz Description: application/tgz

and if you click on it it will download a file

binRgmAnEv4LJ.bin or binWcibLHuH4n.bin (depending on the link you choose above)

download this and rename it to:

rdstream-dR.tgz

and you should be good to go with the package as intended.

Other Useful Wiki pages

For other options on getting meta data (now & next playing) out of Rivendell to Icecast and Shoutcast and other systems see the wiki page Streaming from Rivendell and also Rivendell Loadable Modules SDK