Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
raspberry:audio_stream [2018/10/07 21:37] admin [Audio Stream] |
raspberry:audio_stream [2018/10/08 00:58] admin [Icecast] |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Audio Stream ===== | ===== Audio Stream ===== | ||
- | Streaming audio over internet using icecast | + | Streaming audio over internet using Icecast |
- | update: | + | |
+ | ---- | ||
+ | ==== Soundcard ==== | ||
+ | |||
+ | check the soundcard: | ||
+ | $ cat / | ||
+ | and | ||
+ | $ cat / | ||
+ | that could look like that: | ||
+ | 0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA | ||
+ | bcm2835 ALSA | ||
+ | 1 [K6 ]: USB-Audio - Komplete Audio 6 | ||
+ | Native Instruments Komplete Audio 6 at usb-3f980000.usb-1.5, | ||
+ | The ALSA Card ID is 0 and the USB-Audio Card ID is 1\\ | ||
+ | |||
+ | Identify the Soundcard Chip's Device ID | ||
+ | $ ls / | ||
+ | gives: | ||
+ | ALSA card0 card1 cards devices | ||
+ | means there are two sound cards 0 and 1 | ||
+ | $ ls / | ||
+ | gives: | ||
+ | id midi0 pcm0c pcm0p stream0 | ||
+ | Identify the device id: | ||
+ | $ cat / | ||
+ | give: | ||
+ | card: 1 | ||
+ | device: 0 | ||
+ | subdevice: 0 | ||
+ | stream: CAPTURE | ||
+ | id: USB Audio | ||
+ | name: USB Audio | ||
+ | subname: subdevice #0 | ||
+ | class: 0 | ||
+ | subclass: 0 | ||
+ | subdevices_count: | ||
+ | subdevices_avail: | ||
+ | and: | ||
+ | $ cat / | ||
+ | gives: | ||
+ | card: 1 | ||
+ | device: 0 | ||
+ | subdevice: 0 | ||
+ | stream: PLAYBACK | ||
+ | id: USB Audio | ||
+ | name: USB Audio | ||
+ | subname: subdevice #0 | ||
+ | class: 0 | ||
+ | subclass: 0 | ||
+ | subdevices_count: | ||
+ | subdevices_avail: | ||
+ | therefore in both cases the ID is 0.\\ | ||
+ | Install ALSA utilities: | ||
$ sudo apt-get update | $ sudo apt-get update | ||
- | install | + | $ sudo apt-get |
- | $ sudo apt-get | + | open ALSO mixer: |
- | if asked type in hostname | + | $ alsamixer |
- | | + | with F6 select the soundcard.\\ |
- | | + | Test the Sound Card Output: |
+ | $ speaker-test -Dplughw: | ||
+ | $ speaker-test -Dplughw: | ||
+ | |||
+ | |||
+ | ---- | ||
+ | ==== Darkice ==== | ||
+ | Install Darkice.\\ | ||
+ | update: | ||
+ | $ sudo apt-get | ||
+ | get the files and install them: | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | $ sudo apt-get install libmp3lame0 libtwolame0 | ||
+ | |||
+ | $ sudo dpkg -i darkice_1.0.1-999~mp3+1_armhf.deb | ||
+ | |||
+ | |||
change config: | change config: | ||
$ sudo nano / | $ sudo nano / | ||
to: | to: | ||
- | # this section describes general aspects of the live streaming session [general] | + | |
- | duration | + | |
- | reconnect | + | duration |
- | # this section describes the audio input that will be streamed | + | |
- | [input] | + | reconnect |
- | device | + | # this section describes the audio input that will be streamed |
- | sampleRate | + | [input] |
- | bitsPerSample = 16 # bits per sample. try 16 | + | device |
- | channel | + | sampleRate |
- | | + | bitsPerSample = 16 # bits per sample. try 16 |
- | # this section describes a streaming connection to an IceCast2 server | + | channel |
- | # 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] | + | # this section describes a streaming connection to an IceCast2 server |
- | bitrateMode | + | # there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7] |
- | bitrate | + | # these can be mixed with [icecast-x] and [shoutcast-x] sections |
- | format | + | |
- | quality | + | bitrateMode |
- | server | + | bitrate |
- | port = 8000 # port of the IceCast2 server, usually 8000 password | + | format |
- | mountPoint | + | quality |
- | name = pisound | + | server |
- | description | + | port = 8000 # port of the IceCast2 server, usually 8000 |
- | url = http:// | + | |
- | genre | + | mountPoint |
- | public | + | name = pisound |
- | # | + | description |
- | + | url = http:// | |
+ | genre | ||
+ | public | ||
+ | # | ||
---- | ---- | ||
- | [general] | + | ==== Icecast ==== |
- | duration | + | Install Icecast.\\ |
- | bufferSecs | + | update: |
- | reconnect | + | $ sudo apt-get update |
+ | install icecast2: | ||
+ | $ sudo apt-get install icecast2 | ||
+ | if asked type in hostname and password | ||
+ | hostname: localhost | ||
+ | password: ???? | ||
+ | start icecast2: | ||
+ | $ sudo service icecast2 start | ||
- | [input] | + | ---- |
- | device | + | ==== Stream |
- | sampleRate | + | just run: |
- | bitsPerSample | + | $ darkice |
- | channel | + | and then open in your browser: |
- | + | http://192.168.178.112:8000/pisound.mp3 | |
- | [icecast2-0] | + | Icecast2 Status one will find here: |
- | bitrateMode | + | |
- | quality | + | |
- | format | + | |
- | bitrate | + | |
- | server | + | |
- | port = 8000 # port for IceCast2 access | + | |
- | password | + | |
- | mountPoint | + | |
- | name = radio | + | |
- | | + | |
- | + | ||
- | run: | + | |
- | $ darkice | + | |
---- | ---- | ||
- | ==== Link ==== | + | ==== Links ==== |
- | [[https:// | + | [[https:// |
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[http:// | ||
---- | ---- |