Skip to content
project-owner edited this page Mar 2, 2024 · 9 revisions

Peppy Player can work either as a Streaming Server or Streaming Client or both. That's achieved by using streaming functionality of the mpd and vlc players.

stream

This chapter will explain how to configure audio and Peppy players in order to use streaming functionality. It will explain how specify HTTP as a streaming transport protocol and FLAC as a stream encoding. HTTP protocol was selected in order to play streams in browsers without any additional plugins. FLAC encoding was selected because the majority of my audio collection is in FLAC format. The combination of HTTP and FLAC allows to stream/playback lossless audio files.

Streaming Server

The additional audio output section should be defined in mpd.conf file in order to activate streaming server functionality in mpd player:

audio_output {
	type "httpd"
	name "flac stream"
	encoder "flac"
	port "8080"
	always_on "yes"
}

Here type defines HTTP protocol and encoder defines FLAC encoding. The property always_on ensures that connection will stay open all the time even when track changes. In order to connect to the streaming server its IP Address/DNS name and port defined in this section should be specified as a connection URL, for example:

http://localhost:8080

If you keep two audio output sections in mpd.conf file then player will playback and stream audio at the same time. If you need only streaming server functionality without playback then you have to comment out audio output which defines the playback functionality. If you need playback, streaming and VU Meter Screensaver functionality then you need to specify three audio output sections in mpd.conf file.

To make vlc player work as a streaming server the following property should be defined in the config.txt file:

use.stream.server = True

This will cause using of the following properties (defined in players.txt) during vlc player startup:

--sout=#transcode{acodec=flac}:std{access=http,mux=flac,dst=10.0.0.6:8080}

Here HTTP transport protocol and FLAC encoding have been defined as well. The port should be also defined in this line.

Currently vlc configured as a streaming server cannot playback audio locally.

Peppy Player working as a streaming server can be controlled using the same methods as during regular playback - remote control, web browser etc.

Streaming Client

In this mode Peppy player can playback streams received from a streaming server. This mode is not that much different from web radio playback functionality. The separate 'Stream' item was added to the Home menu to avoid mixing web radio and other streams. When selected it will bring Stream screen which by default contains just one example stream:

stream-screen

To add new stream to this menu the corresponding record should be made in file /home/pi/Peppy/streams/streams.m3u. It should contain two lines:

#Example Stream
http://kuow.streamguys1.com/kuow2-hi.mp3

The first line defines the name of the stream. It will be displayed in the title area of the screen. At the same time it specifies the filename of the stream image which will be displayed. If the file with such name doesn't exist the default image default-stream.png will be displayed instead.

The third line defines the stream URL.

The following properties should be defined in config.txt in order to use Peppy player web client as a streaming client:

use.browser.stream.player = True

Also the proper streaming server port number should be defined:

[stream.server]
stream.server.port = 8080

In this case Peppy web client will open one connection to Peppy web server (e.g. port 8000) for UI control and another to streaming server (e.g. port 8080) for audio playback. This will allow to playback lossless FLAC streams in browser. Currently only Firefox 51.0 (or higher) can playback streams this way (with two ports). Because of CORS restrictions (using two different ports) Chrome currently doesn't allow audio playback in Peppy web client.

<<Previous | Next>>

Clone this wiki locally