MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.33k stars 395 forks source link

Spotify Edition - Single File Playback Working / Folder Playback not working #1480

Open aradhir opened 3 years ago

aradhir commented 3 years ago

Dear all,

I just installed the Spotify Edition on a Raspberry Pi 2 B. Installation happened via the automatic, guided installer from the current repository. After configuring audio output, I am struggling with folder playbacks.

System Raspian Buster RPi-Jukebox-RFID, Spotify Edition, vers. 2.3 2425890 - master

The following things are working

What is not working? When trying to start playback of a whole folder (both manually and via RFID), the player shows "XXX is playing", but nothing happens, and also the playlist shown in the web inteface is not refreshed.

Logs I simulated the scenario with basically the same file, once played via the folder play button, once via the file play button:

Folder playback:

########## SCRIPT rfid_trigger_play.sh (2021-08-13.00:13:27) ##
# Attempting to play: /home/pi/Music/Meister Eder und sein Pumuckl/Die Gummiente
# Type of play $VALUE: 
$FOLDER set, not empty and dir exists: /home/pi/Music/Meister Eder und sein Pumuckl/Die Gummiente
  Var $LASTFOLDER: Meister Eder und sein Pumuckl/Die abergläubische Putzfrau
  Var $LASTPLAYLIST: Meister Eder und sein Pumuckl % Die abergläubische Putzfrau
Checking 'recursive' list? VAR $VALUE: 
recursive? NO
/home/pi/RPi-Jukebox-RFID/scripts/playlist_recursive_by_folder.php --folder "Meister Eder und sein Pumuckl/Die Gummiente" > "/home/pi/RPi-Jukebox-RFID/playlists/Meister Eder und sein Pumuckl % Die Gummiente.m3u"
  Var $SECONDSWIPE: RESTART
  Var $PLAYLISTNAME: Meister Eder und sein Pumuckl % Die Gummiente
  Var $LASTPLAYLIST: Meister Eder und sein Pumuckl % Die abergläubische Putzfrau
We must play the playlist no matter what: $PLAYPLAYLIST == yes
  VAR FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
  VAR PLAYLISTPATH: /home/pi/RPi-Jukebox-RFID/playlists/Meister Eder und sein Pumuckl % Die Gummiente.m3u
########### SCRIPT playout_controls.sh (2021-08-13.00:13:28) ##
VAR COMMAND: playerstop
VAR VALUE: 
current file: /home/pi/Music/file:///home/pi/Music/Meister-Eder-und-sein-Pumuckl/Der-verstauchte-Daumen.mp3
chapters file: /home/pi/Music/file:///home/pi/Music/Meister-Eder-und-sein-Pumuckl/Der-verstauchte-Daumen.chapters.json
chapters for extension enabled: 0
chapters for duration enabled: 0
   playerstop
#START##### SCRIPT resume_play.sh (2021-08-13.00:13:28) ##
VAR AUDIOFOLDERSPATH: /home/pi/Music
VAR COMMAND: savepos
VAR VALUE: 
VAR FOLDER: 
  content of /home/pi/Music//folder.conf
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
  Now doing what COMMAND wants: savepos
VAR FOLDER from settings/Latest_Folder_Played: Meister Eder und sein Pumuckl/Die abergläubische Putzfrau
  savepos FOLDER: Meister Eder und sein Pumuckl/Die abergläubische Putzfrau
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
#END####### SCRIPT resume_play.sh (2021-08-13.00:13:28) ##
remove playing.txt
########### SCRIPT playout_controls.sh (2021-08-13.00:13:28) ##
VAR COMMAND: playlistaddplay
VAR VALUE: Meister Eder und sein Pumuckl % Die Gummiente
current file: /home/pi/Music/file:///home/pi/Music/Meister-Eder-und-sein-Pumuckl/Der-verstauchte-Daumen.mp3
chapters file: /home/pi/Music/file:///home/pi/Music/Meister-Eder-und-sein-Pumuckl/Der-verstauchte-Daumen.chapters.json
chapters for extension enabled: 0
chapters for duration enabled: 0
   playlistaddplay playlist name VALUE: Meister Eder und sein Pumuckl % Die Gummiente
   playlistaddplay FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
mpc load Meister Eder und sein Pumuckl % Die Gummiente
## SCRIPT single_play.sh (2021-08-13.00:13:29) ##
VAR AUDIOFOLDERSPATH: /home/pi/Music
VAR COMMAND: single_check
VAR VALUE: 
VAR FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
  content of /home/pi/Music/Meister Eder und sein Pumuckl/Die Gummiente/folder.conf
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
  Now doing what COMMAND wants: single_check
  entering: single_check with value OFF
## SCRIPT shuffle_play.sh (2021-08-13.00:13:29) ##
VAR AUDIOFOLDERSPATH: /home/pi/Music
VAR COMMAND: shuffle_check
VAR VALUE: 
VAR FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
# found content in folder.conf:
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
  Now doing what COMMAND wants: shuffle_check
  entering: shuffle_check with value OFF
# new content in folder.conf:
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
mpc load Meister Eder und sein Pumuckl % Die Gummiente && /home/pi/RPi-Jukebox-RFID/scripts/resume_play.sh -c=resume -d=Meister Eder und sein Pumuckl/Die Gummiente
#START##### SCRIPT resume_play.sh (2021-08-13.00:13:29) ##
VAR AUDIOFOLDERSPATH: /home/pi/Music
VAR COMMAND: resume
VAR VALUE: 
VAR FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
  content of /home/pi/Music/Meister Eder und sein Pumuckl/Die Gummiente/folder.conf
CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
  Now doing what COMMAND wants: resume
  savepos FOLDER: Meister Eder und sein Pumuckl/Die Gummiente
  entering: resume with value OFF
  entering: single with value OFF
#END####### SCRIPT resume_play.sh (2021-08-13.00:13:29) ##
  echo Meister Eder und sein Pumuckl/Die Gummiente > /home/pi/RPi-Jukebox-RFID/scripts/../settings/Latest_Folder_Played
  VAR Latest_Folder_Played: Meister Eder und sein Pumuckl/Die Gummiente
  # end playout_controls.sh playlistaddplay
  Command: /home/pi/RPi-Jukebox-RFID/scripts/playout_controls.sh -c=playlistaddplay -v="Meister Eder und sein Pumuckl % Die Gummiente" -d="Meister Eder und sein Pumuckl/Die Gummiente"`

Single file playback: ########### SCRIPT playout_controls.sh (2021-08-13.00:13:37) ## VAR COMMAND: playsinglefile VAR VALUE: /home/pi/Music/Meister Eder und sein Pumuckl/Die Gummiente/Die-Gummiente.mp3 current file: /home/pi/Music/ chapters file: /home/pi/Music.chapters.json chapters for extension enabled: 0

I tried to browse the issues for my topic, but I think it is not related to any of the other issues.

Best Aradhir

UPDATE: Changed format for better reading

simontiffert commented 3 years ago

I am new to the project and it looks like I am having the folder issue as well. I thought it is a sound issue, but after opening a folder in the web ui and clicking on the test mp3, it played without any issues.

Spotify Edition installed today with one-line-installer.

aradhir commented 3 years ago

Anyone any idea where the problem might be? Should / Can I provide additional information that might help?

s-martin commented 3 years ago

What’s the output of journalctl -u mopidy?

aradhir commented 2 years ago

Sorry, just saw, that I tried with a different file/folder, but it shouldn't matter for the debugging. I recorded the follow logs:

1) directly after startup and the "startup sound" before starting any playback 2) after trying to start the playback via the "play folder" button 3) after starting the playback via the "play single file" button

Note: I know, that my Spotify credentials are wrong. Currently I do not have a subscription, because I wanted to do the testing first. I assumed so far, that playing local files with the Spotify Edition (even without subscription) should be possible at any time, or am I wrong?

Log No.1 mopidy_1.txt

Log No.2 mopidy_2.txt

Log No.3 mopidy_3.txt

robinjoerke commented 2 years ago

I experienced the same issue (Folder did not play, web UI & RFID, but clicking the singe file worked). Try the following. open web interface and go to Folders & Files. At the very Bottom of the screen click the Scan Music Library Button. I could playback the folder afterwards (both card and RFID ) even though the label on the button indicates this is only for Track info in web UI

aradhir commented 2 years ago

I experienced the same issue (Folder did not play, web UI & RFID, but clicking the singe file worked). Try the following. open web interface and go to Folders & Files. At the very Bottom of the screen click the Scan Music Library Button. I could playback the folder afterwards (both card and RFID ) even though the label on the button indicates this is only for Track info in web UI

Thanks for the hint, but it did not work for me.

bwa- commented 2 years ago

I'd just like to chime in and say that I have the same problem as OP. Scanning the library didn't help me either. I'm running the very same version on a Pi 4B. Spotify playback (with RFID or from web interface) works, everything else is the same as described above.

bwa- commented 2 years ago

So I've made some progress on this:

After taking a look at some of the Mopidy logs and trying to figure out what's wrong, I decided to try and play these files with mpc directly. After messing around with the syntax for a bit, I found out that, while the playlist existed, it did not contain any files. I found this out by running mpc playlist $FOLDER_NAME_IN_WEBINTERFACE. You can also show existing playlists with mpc lsplaylists.

So much for the straightforward part, now it gets weird: After figuring this out, I created a new directory in the shared/audiofolders dir with a simple name and moved one mp3 over to make sure the filenames didn't have anything to do with this. To make Mopidy pick this dir up, I then hit 'Scan Music Library'. After that. for some reason, the files that had been missing were suddenly part of the playlist that was empty before.

Now I've also found out that the playlists apparently are created when you first hit that 'Play Folder' button for the first time. So if you're wondering where your playlist is, this may be why it's missing. Also, you can browse the files Mopidy knows about with 'mpc ls'. I found all my files after that restart with mpc ls 'Local media/Tracks'

Hope this helps somebody - ever since restarting after messing around in the local audio directory my problems have vanished for some reason.

mr-gosh commented 2 years ago

I can confirm these problems - i can play a single onlineradio stream via rfid card that is linked to an .m3u playlist link. I can play files directly via webinterface. I can play Spotify stuff I did a fresh install.

I created a folder with files without symbols or spaces in the whole path - which didn`t help. The playlists are generated when I push the play folder button but they look a little empty (how are the files listed normally? I don't remember that):

CURRENTFILENAME="filename"
ELAPSED="0"
PLAYSTATUS="Stopped"
RESUME="OFF"
SHUFFLE="OFF"
LOOP="OFF"
SINGLE="OFF"
simontiffert commented 2 years ago

@bwa- Thanks, your hints helped to fix the mp3 playback of folders. Not sure about the order but I tried different things. Overall working with mpc on command line helps to identify and fix the issues.

As the Spotify playback didn't work as well, I looked into the log files and Mopidy seems to start before the network was available. Changed the settings (https://discourse.mopidy.com/t/spotify-authentication-works-only-after-server-restart/3617/6) and now it is working (with a slower start).

Lippsson commented 2 years ago

Try the following. open web interface and go to Folders & Files. At the very Bottom of the screen click the `Scan Music

Thank you - That help me when i forced this issue