HowTo: Toniebox as Jukebox [mpd] [teddyCloud]

Since we have another “family” Toniebox in living room, which optional connected to Boombox 3, I was just wondering how can we not only play custom (music) tonies, but make it a real “juke box” experience. With the great feature of assigning “web streams” to a tonie, this dream just comes true :smiley: So, here is how I made it.

overview

  • There is a Raspberry Pi (Model 3b)
    • TeddyCloud running as docker
    • access to music library (smb, hdd)
  • Toniebox (flashed, connected to TeddyCloud)
    • (optional) connection to another speaker (e.g. Boombox)

install broadcaster

Lets just install a server software, which is able to stream/broadcast your music as a web stream, like any radio station is doing. The choice is “mpd”. In below steps, I assume that the IP-Address of RaspberryPi running mpd is “10.0.0.5”. So you put in what ever your IP would be.

sudo apt install mpd

Lets configure the software

sudo nano /etc/mpd.conf

and make at least the following changes:

...
music_directory "/media/path/to/all/your/music"
...
bind_to_address "10.0.0.5"
port "6600"
...
audio_output {
  type "httpd"
  name "My HTTP Stream"
  encoder "vorbis"
  port "5000"
  bind_to_address "10.0.0.5"
  bitrate "128"
  format "44100:16:1"
  max_clients "0"
}
...

and refresh the service

sudo service mpd restart

install “remote” controle

in my case, we have android smartphones…so just search for mpd in app store of your choice and install prefered app. My choice was “M.A.L.P.”

Just open the app, create a profile for your mpd server, with at least ip address (10.0.0.5) and port (6600). After connection you can go into Menu > Servereigenschaftenand hit Serverdatenbank aktualisieren. Once this process has finished, you can find all your music in this app Menu > Dateien. Just start playing some folder.

From this moment on - mpd is streaming music and broadcast this to the configured address http://10.0.0.5:5000/

Just use your app (M.A.L.P.) as your DJ / Jukebox mixing table :smiley:

connect to stream

Okay - since we have the “web radio” streaming, lets get some audio output. For testing purpose, I just opend up VLC player and entered the broadcast URL http://10.0.0.5:5000/ or http://10.0.0.5:5000/mpd.ogg. Once this is confirmed working, you are ready to go and assign this stream to a (custom) tonie tag.

I just opend teddycloud/content/default/1C7F9311/500304E0.json and placed following inside:

{
	"live":	true,
	"nocloud":	true,
	"source":	"http://10.0.0.5:5000/",
	"skip_seconds":	0,
	"cache":	false,
	"cloud_ruid":	"1c7f9311500304e0",
	"cloud_auth":	"0000000000000000000000000000000000000000000000000000000000000000",
	"cloud_override":	false,
	"tonie_model":	"",
	"_version":	5
}

Of course you would take a tag of your choice - not mine. So not only VLC player is able to playback your stream, but placing the (custom) tonie tag on your Toniebox will also start play your own web stream.

summary

With mpd, you just created your own broadcast station, which Toniebox can playback as of the great work from team revvox they made in providing webstream feature to teddycloud.

You can now create your never ending 24/7 music channel and predefined playlists and just play them with a custom tonie.

add on

As we have a Boombox 3 in livingroom, we just connect a “headphone to bluetooth” dongle into toniebox, so music experience is getting realy serious now :smiley:

known issue

When the paylists ends or you stop it manualy of course the stream interrupts on toniebox as well. Should be no problem, once you restart the stream, party can keep going on Toniebox.

Hope some one likes it … thanks for reading…and…

…have fun :slight_smile:

1 Like

Just as an addition if someone is interested in having multiple simultaneous streams e.g. “Mom’s Channel”, “Party Channel” and so on … this would also work with mpd:

Audio server for multiple simultaneous streams

So you can have different (custom) Tonie tags, each assigned to their own channel, for easy switching playlist or listen to different channels on different Tonieboxes :slight_smile:

1 Like

If anybody having same issue with aborting streams (Web stream TAF is too big in size · Issue #180 · toniebox-reverse-engineering/teddycloud · GitHub) for unknow reaseon / empty buffer…changing the mpd config from above to the following helped to solve this problem. Adjusting the encoding params from vorbis into lame as well as the format from 44.1KHz into 48KHz was the trick.

...
audio_output {
        type             "httpd"
...
        encoder      "lame"
        format         "48000:16:1"
...
}
...

Now, the playback of the mpd stream on toniebox runs as long as configured in teddycloud (Settings > Max stream filesize).

1 Like