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:25] admin |
raspberry:audio_stream [2018/10/08 00:09] admin [Link] |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Audio Stream ===== | ===== Audio Stream ===== | ||
- | Streaming audio over internet using icecast | + | Streaming audio over internet using Icecast |
+ | |||
+ | ---- | ||
+ | ==== 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 install alsa-utils | ||
+ | open ALSO mixer: | ||
+ | $ alsamixer | ||
+ | with F6 select the soundcard.\\ | ||
+ | Test the Sound Card Output: | ||
+ | $ speaker-test -Dplughw: | ||
+ | $ speaker-test -Dplughw: | ||
+ | |||
+ | |||
+ | ---- | ||
+ | ==== Darkice ==== | ||
+ | Install Darkice.\\ | ||
+ | update: | ||
+ | $ sudo apt-get update | ||
+ | |||
+ | |||
+ | change config: | ||
+ | $ sudo nano / | ||
+ | to: | ||
+ | |||
+ | # this section describes general aspects of the live streaming session | ||
+ | [general] | ||
+ | duration | ||
+ | bufferSecs | ||
+ | reconnect | ||
+ | # this section describes the audio input that will be streamed | ||
+ | [input] | ||
+ | device | ||
+ | sampleRate | ||
+ | bitsPerSample = 16 # bits per sample. try 16 | ||
+ | channel | ||
+ | # Only stereo mode is supported by pisound. | ||
+ | # 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 | ||
+ | bitrate | ||
+ | format | ||
+ | quality | ||
+ | server | ||
+ | port = 8000 # port of the IceCast2 server, usually 8000 | ||
+ | password | ||
+ | mountPoint | ||
+ | name = pisound | ||
+ | description | ||
+ | url = http:// | ||
+ | genre = hits # genre of the stream | ||
+ | public | ||
+ | # | ||
+ | |||
+ | ---- | ||
+ | ==== Icecast ==== | ||
+ | Install Icecast.\\ | ||
update: | update: | ||
$ sudo apt-get update | $ sudo apt-get update | ||
- | install icecast2 | + | install icecast2: |
- | $ sudo apt-get install icecast2 | + | $ sudo apt-get install icecast2 |
if asked type in hostname and password | if asked type in hostname and password | ||
hostname: localhost | hostname: localhost | ||
password: ???? | password: ???? | ||
- | change config: | ||
- | $ sudo nano / | ||
- | to: | ||
- | # this section describes general aspects of the live streaming session [general] duration | ||
- | # duration of encoding, in seconds. 0 means forever bufferSecs | ||
- | # size of internal slip buffer, in seconds reconnect | ||
- | # reconnect to the server(s) if disconnected | ||
- | # this section describes the audio input that will be streamed [input] device | ||
- | # Alsa soundcard device for the audio input sampleRate | ||
- | # sample rate in Hz. try 48000, 96000 or 192000 bitsPerSample = 16 | ||
- | # bits per sample. try 16 channel | ||
- | # channels. 1 = mono, 2 = stereo. | ||
- | # Only stereo mode is supported by pisound. | ||
- | # 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 | ||
- | # variable bit rate bitrate | ||
- | # format of the stream: mp3 quality | ||
- | # quality of the stream sent to the server server | ||
- | # host name of the server port = 8000 | ||
- | # port of the IceCast2 server, usually 8000 password | ||
- | # source password to the IceCast2 server mountPoint | ||
- | # mount point of this stream on the IceCast2 server name = pisound | ||
- | # name of the stream description | ||
- | # description of the stream url = http:// | ||
- | # URL related to the stream genre = my genre | ||
- | # genre of the stream public | ||
- | # advertise this stream? | ||
- | # | ||
- | # Record also to a file | ||
| | ||
- | run: | + | ---- |
- | $ darkice | + | ==== Stream ==== |
+ | just run: | ||
+ | $ darkice | ||
+ | and then open in your browser: | ||
+ | http:// | ||
+ | Icecast2 Status one will find here: | ||
+ | http:// | ||
---- | ---- | ||
- | ==== Link ==== | + | ==== Links ==== |
- | [[https:// | + | [[https:// |
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[http:// | ||
---- | ---- |