locus sonus > audio in art





locus sonus > Locustream Raspberry Pi

Last changed: 2014/05/30 15:09

 

Locustream PiBox (Raspberry Pi)



STREAMING THE NEW LOCUSTREAMBOX RASPBERRY PI (LOCUSTREAM PIBOX)




presentation :

With a Raspberry Pi mini computer (eg £27.86 from here), you can stream in mono or stereo, over ethernet or wifi. Setup takes a matter of minutes using our pre-configured SD Card. The system is designed for long-term trouble-free operation. Your stream will appear on the Locus Sonus Audio Soundmap ( http://locusonus.org/soundmap/ ) and will be included in all the Locustream projects.



What to do:

- Contact Locus Sonus to express an interest in setting up a stream:

post a message to Locus Sonus

or open directly an account at Locus Sonus Soundmap (Locustream project) (see below: First: Open a Locustream Account)



We will:

Send you detailed instructions and an equipment list.





FIRST: OPEN A LOCUSTREAM ACCOUNT

Before streaming, you must create an account for each microphone dedicated to the Locustream project. Each new account and registration is moderated by Locus Sonus.

create a Locustream account



You need to put in the settings for your Locus Sonus account so the stream is recognized by the Locus Sonus server and appears on the Locustream Soundmap.

configure your Locustream mountpoint



For troubleshootings or detailed information, please contact soundmap(at)locusonus.org





DOWNLOAD THE LOCUSTREAM SD CARD FOR RASPBERRY PI

To stream with a Raspberry Pi, you can download the pre-configured disk image (with Chrome or Firefox). The compressed file is around 890 MB, so this may take a while.


Download Raspberry Pi SD card disk image





INSTRUCTIONS TO SET UP THE LOCUSTREAM STREAMBOX RASPBERRY PI


Refer to these instructions to copy your SD card and get set up, or read the instructions below.





http://locusonus.org/documentation/img/PROJETSEXTERNES/smith/locustreambox_pi.png
Locustreambox Rasperry Pi



http://locusonus.org/documentation/img/PROJETSEXTERNES/smith/locustreambox_pi_niolon.jpg
Open microphone with Locustreambox Rasperry Pi, in Niolon by Peter Sinclair



LOCUSTREAM PI INSTRUCTIONS (Locusreveil example)

After downloading the disk image "locusreveil.img.gz", you need to uncompress it and copy it to a new 8 GB Class 10 SD Card.

Locate the file and double click to uncompress it.

NETWORK SETTINGS

If you plan to stream with WiFi, you need to enter the name and password for your own WiFi network: Insert the SD card in your computer's card slot or a USB SD Card reader. It appears as a disk called "boot". Open the file "wifi_settings.txt" with a text editor and put your wifi details into the fields ssid and psk, keeping the quotation marks. Save the file and close it and eject the disk.

If using an ethernet connection, you can go ahead with the next step.

Insert the SD card in your Raspberry Pi. Connect your WiFI adaptor (if using) and your USB soundcard and microphone.

Plug in the Pi using a 5V USB power supply, preferably with a rating of around 2100mA.

The Pi will boot and will appear in the Mac OSX Finder sidebar along with other devices on the network. You can make adjustments to the Pi's settings by clicking Connect and entering the username: pi and the password: raspberry

The main things you may want to do initially are adjust settings for the soundcard and microphones you are using. You may also want to adjust the gain on your soundcard. For some settings changes to take effect, the Pi needs to be restarted. See below.

STREAMING SETTINGS

Instructions to adjust your streaming settings:

The pre configured SD Card locusreveil comes with Darkice installed and set to connect and begin streaming when the Pi starts or restarts.

You need to put in the settings for your Locus Sonus account so the stream is recognized by the Locus Sonus server and appears on the Streammap.

With the disk inserted and the Pi up and running, it will appear in the OSX Finder window as "locusreveil".

Click Connect and log in with the Username "pi" and the Password "raspberry"

In "Home Directory/Desktop" locate the folder "stream_settings" containing the file "stream_configuration.cfg". Control-Click and choose to open it with Text Editor or another editing application.

(You may want to make a backup of this file: Choose File > Duplicate and Save the resulting copy as something like "stream_configurations_backup.cfg" in the same folder as the original, or somewhere convenient.)

The file "stream_configurations_cfg" contains a list of parameters for the stream generated by Darkice. You need to update the following:

Change the mountPoint currently "this_that.ogg" to the details of your stream: something like "london_camberwell.ogg".

If you want to stream in another format, such as MP3, the file extension will be ".mp3" and you will need to change the line "format" to "mp3" (currently "vorbis"). Otherwise, you can leave these as they are.

In the second paragraph of settings, labelled ^input^, you can start by choosing a basic configuration for either mono or stereo streaming.

For a Mono stream, you should set the line "channel" to "1". You should normally then set the line sampleRate to 44100.

For a stereo stream, the line "channel" should be set to "2". Using the Griffin iMic audio interface, we have had good results by setting the sampleRate to 22050.

In the "name" line, you can put your name, if you want to. The lines "description" and "genre" can also be adjusted optionally.

When you're done, Save the file and Close it.

For the changes to take effect, you need to restart the Pi. Simply unplugging the Pi can damage the SD card, so it is best to use more roundabout method, as described above.

Then restarting the Pi

Restarting and shutting down the Pi safely is a slightly involved process. Simply turning off the power can damage the SD Card, so it is advisable to use the following method.

The approach here involves interacting with the Pi remotely, rather than connecting the Pi to a monitor and keyboard. In some cases, including shutdown and restart, this means logging into the Pi using the Terminal. In case you are not a seasoned Terminal user, don't worry; it's simple.

Still connected to the Pi, use a text editor to open the file "Home Directory/Desktop/ip_address.txt" and copy the IP address of the Pi which is reported there.

Now open Terminal. In the Terminal window, give the following instructions to log into the Pi remotely via SSH. Type:

ssh pi@pastetheIPaddressofthePi

Then press Enter

You are asked if you are sure you wish to proceed. Type:

yes

Then press Enter

You will be asked for your password. Type:

raspberry

Press Enter

After a moment, the command prompt switches and you are now logged in to the Pi. From here you can do various things. For now we want to do one of two: restart the Pi or shut it down

To shut the Pi down, type:

sudo halt

Then Enter

You will be told that the Pi is shutting down. Wait for that to happen, and lights to stop flashing on the Pi, before disconnecting the power.

If, instead, you want to restart the Pi, type:

sudo reboot

Then press Enter

You will be told that the Pi is shutting down. Once that has completed, it will re-start.

To end your SSH session and log out of the Pi, type:

exit

Then press Enter

The command line changes to that of your local machine.

Once the Pi has restarted, it should appear again in the Finder sidebar, and the stream should appear on the Locustream SoundMap, http://locusonus.org/soundmap/ , and in the list of streams on the Locus Sonus server, available by clicking "i" then "server" on the upper right of the map.

If your stream does not appear, it may be because the details entered above do not match the ones in your account settings. You should have an email from locustream support listing your latest configuration. You can also check this by logging in to your account on the login page

For troubleshooting help, contact soundmap(at)locusonus.org

The final thing you may need to adjust is your sound settings. The Pi runs on Linux and uses the an audio system called Alsa to handle the incoming audio from the microphone and soundcard. You many need to confirm that your chosen soundcard is selected, and adjust the level of gain.

AUDIO SETTINGS

ALSA MIXER

Audio into the Pi is handled by the Linux application Alsa.

You may need to adjust your Alsa settings so that your soundcard is recognized and your gain levels match the sensitivity of your microphones and the volume of your sound environment.

Once again, these adjustments are best made remotely, via SSH.

If you are not already logged in, do this now:

As when restarting or shutting down the Pi, note or preferably copy the IP Address reported in the file "Home Directory/Desktop/ip_address.txt".

Now open Terminal. In the Terminal window, give the following instructions to log into the Pi remotely via SSH. Type:

ssh pi@pastetheIPaddressofthePi

Then press Enter

You are asked if you are sure you wish to proceed. Type:

yes

Then press Enter

You will be asked for your password. Type:

raspberry

Press Enter

After a moment, the command prompt switches and you are now logged in to the Pi.

At the command line, Type:

alsamixer

Then press Enter

A graphical interface appears:

http://locusonus.org/documentation/img/PROJETSEXTERNES/smith/alsamixer1.png

Press F6 to bring up a list of available soundcards, and use arrow keys to select your soundcard; then Enter.

Press F4 to select the Capture controls, which influence the incoming audio.

A graphical interface appears:

http://locusonus.org/documentation/img/PROJETSEXTERNES/smith/alsamixer3.png

Use the Arrow keys to select the control eg Gain, and then to adjust the level. You should be able to hear the effects of these changes if you listen to the stream on the Locustream SoundMap, http://locusonus.org/soundmap/ , or on the list of streams via the "i" and then "server" links on the upper right of the map. (There will be some seconds of delay.)

Pressing ESC saves the alsamixer settings. They will remain saved if the Pi is shut down and restarted.

EARTHING THE PI

Generally, the Pi is capable of streaming good quality audio. In some cases, especially for quiet environments where the Capture gain is high and/or the listener turns up the volume, they will hear an audible 'hiss'. This can sometimes be reduced by earthing the Pi. Reports on this are limited, and some commentators caution again interfering with the Pi's floating earth; but we have found a convenient way to do this is by connecting the video socket to earth. This produces a significant reduction in 'hiss' and we have not had an adverse effects.

CONNECTIONS ISSUES

The locusreveil SD card is configured so that Darkice will attempt to reconnect if it has connections issues. If, for some reason, Darkice crashes, it is set to relaunch and reconnect automatically.

Once you have done the initial setup procedure, you should have long term trouble free streaming from your Pi.

For troubleshooting or feedback, contact soundmap(at)locusonus.org