MPC / MPD stop and clear not working correctly

Some of the basic MPC commands seem to not work correctly.

For example if the music is paused but then
mpc stop
the music actually starts playing again.

Similarly the
mpc clear
command doesn’t clear and also resume the current playback.

I investigate this a little more - basically if I had a playlist loaded using the Volumio UI but have it stopped / paused but then try and load any music via MPC it behaves badly.

Its like the 2 API’s (the WebSocket / REST API that the UI uses ) is completely separate than the CLI based MPC / MPD API. Its a pity as this was a feature I liked - its easy to have scripts call MPC commands and while its similarly easy to have those scripts call CURL ‘REST’ GET calls - it becomes much more difficult / cumbersome to call REST ‘Post’ from CLI scripts.

Long story short its much more difficult to automated Volumio 3 IMO - the MPC CLI interface is both inconsistent with the UI but also does not work properly if the UI has already loaded some music or a playlist.

Can’t you just use volumio?

[[PLAYBACK STATUS]]

status                             Gives Playback status information
volume                             Gives Current Volume Information
volume <desired volume>            Sets Volume at desired level 0-100
volume mute                        Mutes
volume unmute                      Unmutes
volume toggle                      Mutes/Unmutes
volume plus                        Increases Volume of one step
volume minus                       Decreases Volume of one step
seek plus                          Forwards 10 seconds in the song
seek minus                         Backwards 10 seconds in the song
seek <seconds>                     Plays song from selected time
repeat                             Toggles repetition of queue
random                             Toggles randomization of queue


[[PLAYBACK CONTROL]]

play
pause
toggle                             Toggles between play/pause
next
previous
stop
clear

I want to automate loading specific playlists - the volumio command doesn’t allow loading of playlists and even the REST API doesn’t allow loading a playlist via a ‘simple’ CURL REST call.

Basically, I have automated triggering loading and start different playlists from both Alexa utterances and via Siri commands (using Homebridge) - super handy and were reliable up until recently.

it’s posible but you have to the right curl commands and right playlist name

http://192.168.1.110/api/v1/commands/?cmd=playplaylist&name=MediaMarkt Top40 2021 Week 35

is what i use for a playlist.

and if u use a computer i would replace curl with ps script ( works faster )

stop is :

http://192.168.1.110/api/v1/commands/?cmd=stop

You start your posting on the stop/clear commands. Now we move to playlist?

Please look at: WebSocket APIs - Volumio Documentation or
REST API - Volumio Documentation

The MPC load “playlist” command works fine - but the MPC “clear” which I would typically use to clear the current playlist doesn’t not clear it. It just starts playing the current playlist.

Then trying the MPC stop (to force a stop to the current playlist music) actually start playing the current playlist (even if its not playing).

Hence why it seems to be like some of the MPC / MPD commands do not work properly and specifically in my testing it was are MPC STOP and MPC CLEAR (when the UI had loaded a playlist).

If I state this correct, Volumio doesn’t run the native MPD/MPC but on a pipe/fork called Volumio.
You can do a dirty escape and use Volumio stop and volumio clear, or use mpc toggle.
Since you can’t do a stop when playing from a library, it seems that stop execute as next. Only a few services have a stop, the most is only play/pause.
Better is to move to the rest api or socket.