From 6ce5147f1b669e15dd078f0b3a1901c30c6a3393 Mon Sep 17 00:00:00 2001 From: Abhay Rana Date: Thu, 3 Dec 2015 18:02:52 +0530 Subject: [PATCH] [audio] Shifts to pulseaudio, sets up streaming. - Using pulseaudio + darkice + icecast. - icecast is proxied via apache - The admin url is restricted via apache, so I can commit the password --- files/audio/.darkice.cfg | 36 ++++++ files/audio/.icecast.xml | 243 +++++++++++++++++++++++++++++++++++++++ files/cmus/.cmus/rc | 5 +- files/i3/.i3/config | 11 +- 4 files changed, 290 insertions(+), 5 deletions(-) create mode 100644 files/audio/.darkice.cfg create mode 100644 files/audio/.icecast.xml diff --git a/files/audio/.darkice.cfg b/files/audio/.darkice.cfg new file mode 100644 index 0000000..c4362c4 --- /dev/null +++ b/files/audio/.darkice.cfg @@ -0,0 +1,36 @@ +# this section describes general aspects of the live streaming session +[general] +duration = 0 # duration of encoding, in seconds. 0 means forever +bufferSecs = 15 # size of internal slip buffer, in seconds +reconnect = yes # reconnect to the server(s) if disconnected +realtime = yes # run the encoder with POSIX realtime priority +rtprio = 3 # scheduling priority for the realtime threads + +# this section describes the audio input that will be streamed +[input] +device = pulse # OSS DSP soundcard device for the audio input +sampleRate = 44100 # 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 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 = cbr # average bit rate +format = mp3 # format of the stream: ogg vorbis +bitrate = 320 # bitrate of the stream sent to the server +server = 127.0.0.1 + # host name of the server +port = 8000 # port of the IceCast2 server, usually 8000 +password = nautilus_music # source password to the IceCast2 server +mountPoint = listen.mp3 # mount point of this stream on the IceCast2 server +name = Music from Nautilus + # name of the stream +description = Live broadcast of what nemo is listening to + # description of the stream +url = http://me.captnemo.in + # URL related to the stream +genre = music # genre of the stream +public = no # advertise this stream? +localDumpFile = dump.mp3 # local dump file \ No newline at end of file diff --git a/files/audio/.icecast.xml b/files/audio/.icecast.xml new file mode 100644 index 0000000..31f907c --- /dev/null +++ b/files/audio/.icecast.xml @@ -0,0 +1,243 @@ + + + 20,000 Leagues under the sea + me@captnemo.in + + + + + 5 + 2 + 524288 + 30 + 15 + 10 + + 1 + + 65535 + + + + + nautilus_music + + nautilus_music + + + nemo + nautilus_music + + + + + + + + + me.captnemo.in + + + + 8000 + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + /usr/share/icecast + + + /home/nemo/logs/icecast + /usr/share/icecast/web + /usr/share/icecast/admin + /tmp/icecast.pid + + + + + + + + + + access.log + error.log + + 3 + 10000 + + + + + + 0 + + nobody + nobody + + + diff --git a/files/cmus/.cmus/rc b/files/cmus/.cmus/rc index ad96a7d..d45b4b8 100644 --- a/files/cmus/.cmus/rc +++ b/files/cmus/.cmus/rc @@ -31,7 +31,4 @@ bind -f common mouse_scroll_up win-up set lib_sort=albumartist album discnumber tracknumber title filename set status_display_program=~/projects/scripts/cmus-current-track.sh -set output_plugin=alsa -set dsp.alsa.device=default -set mixer.alsa.channel=Master -set mixer.alsa.device=PCH \ No newline at end of file +set output_plugin=pulse diff --git a/files/i3/.i3/config b/files/i3/.i3/config index 0f4ea38..d7fb9f4 100644 --- a/files/i3/.i3/config +++ b/files/i3/.i3/config @@ -17,7 +17,16 @@ exec --no-startup-id volumeicon exec --no-startup-id redshift-gtk exec --no-startup-id compton --config ~/.compton.conf exec --no-startup-id nm-applet -exec urxvtd -q -f -o #terminal + +# Stream my pulseaudio via icecast +# -c is for config location +exec --no-startup-id darkice -c ~/.darkice.cfg +# Start icecast as well. This runs on port 8000 +# -b = background +# -c = config location +exec --no-startup-id icecast -b -c ~/.icecast.xml +#terminal +exec urxvtd -q -f -o # Set default backlight exec xbacklight -set 15