volumio / Volumio2

Volumio 2 - Audiophile Music Player
http://volumio.org
Other
1.37k stars 316 forks source link

REST command 'next' beyond last breaks volumio #1156

Open heidou7p opened 7 years ago

heidou7p commented 7 years ago

Hello,

I was writing a remote control python script using REST API, and bumped into some issues. This one is about 'next'. I will report about another one about 'prev' soon after.

Confirmed on: Raspberry Pi 3B + Volumio 2.141

'Next' beyond last breaks volumio

Reproduce procedure:

  1. From web interface, go 'browse', choose a song and 'Clear and play'. I have chosen from my SMB mounted library. This creates a one-song queue.
  2. Ssh into volumio, and type: wget -O- http://localhost:3000/api/v1/commands/?cmd=next 2>/dev/null
  3. This prints something like {"time":1493606231667,"response":"next Success"}, with exit code 0. Music stops and web interface shows 'play' button insted of 'pause', which is unresponsive; pushing this button does nothing. Volumio becomes unable to play music unless you reboot it.

As a matter of fact, you can reproduce this without REST. Just push next on web interface and it shows same symptom.

Log from 'sudo journalctl -f': https://gist.github.com/heidou7p/717c8d5ba0909e814295effc3f8f4bdb

xipmix commented 7 years ago

I tried to reproduce this on rpi2+2.246+some recent ui work. I think this issue may be fixed now. If you have a test case that still breaks the interface, please post it.

First I tested with the web ui.

Next test:

Next:

Finally, tried the REST api, while playback was stopped.

$ wget -O- http://localhost:3000/api/v1/commands/?cmd=next 2>/dev/null
{"time":1504530115460,"response":"next Success"}
$

log file:

Sep 04 13:01:55 volumio volumio[17137]: info:
Sep 04 13:01:55 volumio volumio[17137]: [1504530115461] ---------------------------- Client requests Volumio next
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::volumioNext
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115466] CoreStateMachine::next
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115467] CoreStateMachine::stop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115467] CoreStateMachine::setConsumeUpdateService undefined
Sep 04 13:01:55 volumio volumio[17137]: UNSET VOLATILE
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115469] CoreStateMachine::updateTrackBlock
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115470] CorePlayQueue::getTrackBlock
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115471] CoreStateMachine::stPlaybackTimer
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115472] CoreStateMachine::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115473] CoreStateMachine::getState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115474] CorePlayQueue::getTrack 0
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::volumioPushState
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115478] interfaceApi::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115479] InterfaceWebUI::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115516] CoreStateMachine::serviceStop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115518] CorePlayQueue::getTrack 0
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::serviceStop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115521] ControllerMpd::stop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115522] ControllerMpd::sendMpdCommand stop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115529] sending command...
Sep 04 13:01:55 volumio volumio[17137]: info: Pushing Favourites {"service":"mpd","uri":"mnt/NAS/testu2/Rattle_and_Hum/03-Desire.flac","favourite":false}
Sep 04 13:01:55 volumio volumio[17137]: info: Mpd Status Update: player
Sep 04 13:01:55 volumio volumio[17137]: info:
Sep 04 13:01:55 volumio volumio[17137]: [1504530115613] ---------------------------- MPD announces state update
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115615] parsing response...
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115616] ControllerMpd::getState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115617] ControllerMpd::sendMpdCommand status
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115621] sending command...
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115624] CoreStateMachine::play index undefined
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115625] CoreStateMachine::setConsumeUpdateService undefined
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115626] CorePlayQueue::getTrack 1
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115635] parsing response...
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115637] ControllerMpd::parseState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115638] ControllerMpd::sendMpdCommand playlistinfo
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115639] sending command...
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115643] parsing response...
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115653] ControllerMpd::parseTrackInfo
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115656] ControllerMpd::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::servicePushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115660] CoreStateMachine::syncState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115661] CorePlayQueue::getTrack 0
Sep 04 13:01:55 volumio volumio[17137]: info: STATE SERVICE {"status":"stop","position":0,"seek":null,"duration":null,"samplerate":null,"bitdepth":null,"channels":null,"random":false,"updatedb":false,"repeat":false,"isStreaming":false,"title":"Desire","artist":"U2","album":"Rattle and Hum","uri":"NAS/testu2/Rattle_and_Hum/03-Desire.flac","trackType":"flac"}
Sep 04 13:01:55 volumio volumio[17137]: info: CURRENT POSITION 0
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115666] CoreStateMachine::syncState   stateService stop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115667] CoreStateMachine::syncState   currentStatus stop
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115669] CoreStateMachine::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115670] CoreStateMachine::getState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115671] CorePlayQueue::getTrack 0
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::volumioPushState
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115684] interfaceApi::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115686] InterfaceWebUI::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115716] No code
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115717] CoreStateMachine::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115718] CoreStateMachine::getState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115720] CorePlayQueue::getTrack 0
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::volumioPushState
Sep 04 13:01:55 volumio volumio[17137]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115725] interfaceApi::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115727] InterfaceWebUI::pushState
Sep 04 13:01:55 volumio volumio[17137]: info: [1504530115761] ------------------------------ 148ms
Sep 04 13:01:55 volumio volumio[17137]: info: Pushing Favourites {"service":"mpd","uri":"mnt/NAS/testu2/Rattle_and_Hum/03-Desire.flac","favourite":false}
Sep 04 13:01:55 volumio volumio[17137]: info: Pushing Favourites {"service":"mpd","uri":"mnt/NAS/testu2/Rattle_and_Hum/03-Desire.flac","favourite":false}

Try playing via REST

$ wget -O- http://localhost:3000/api/v1/commands/?cmd=play 2>/dev/null
{"time":1504530283170,"response":"play Success"}

Playback starts fine. pause/play work ok in the web ui.

Try stopping - that works too.

$ wget -O- http://localhost:3000/api/v1/commands/?cmd=stop 2>/dev/null
{"time":1504530350782,"response":"stop Success"}
xipmix commented 6 years ago

I think this could be closed.