GPIO playback control and read songs from UBS stick

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
Posts: 1
Joined: August 1st, 2019, 7:27 pm

GPIO playback control and read songs from UBS stick

Post by dezmob »

Hi there, and thanks in advance for taking the time to read my message.

I’m trying to find a way to make an MP3 player out of a RPi using buttons controls so I can playback musics from any random flash drive I stick to the pi.

The thing is that I’m really struggling with mpc.

The only working prototype was using a nodejs wrapper for the mpg321 player.

But I was facing performances issues when I tried adding an OLED display (SSD1306)...

Anyway I’m now trying to make a python script using mpd mpc instead of mpg321 (since there isn’t any descent python wrapper for it unfortunately)

but apparently I can’t just tell mpc to play a song... I first need to create a queue or a playlist (can’t understand the difference) and then play that playlist...

What would be the best way to approach this ?

Thanks a lot
Forum team
Posts: 1254
Joined: January 15th, 2013, 3:43 pm

Re: GPIO playback control and read songs from UBS stick

Post by max »

If you're writing a Python script, then why are you using mpc and not one of the MPD client libraries for Python? That would save a good amount of overhead.

Now about the queue thing vs "just play": unlike mpg321, MPD isn't a "one-shot" player. The idea is that you put all the songs you wish MPD to play in a queue, and MPD will play that queue (and of course you can still edit the queue during playback).

To turn MPD into something like mpg321, you can do for example "mpc clear && mpc add foo/bar.mp3 && mpc play" (simplified - with Python, you could send those 3 commands as one, which would be a lot faster). I doubt that you really want that, but MPD gives you the power to do that. And much more.
Posts: 7
Joined: February 8th, 2018, 2:09 pm

Re: GPIO playback control and read songs from UBS stick

Post by Sogeking »

Well the difference between queue and playlist is pretty simple.

The queue is the group of songs ready to be played in row. Next and previous will move between that.

A playlist is a file which store references to a group of songs. and you can save it or load it. If you load a playlist it will be your new queue.

hope this help.
Post Reply