News:

LATEST RELEASE:  FPP 9.5 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/9.5

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 17213
Latest: derekjmiller12
New This Month: 12
New This Week: 8
New Today: 0
Stats
Total Posts: 136934
Total Topics: 17302
Most Online Today: 211
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 197
Total: 197

Starting on the 5s

Started by shoopity, December 13, 2025, 12:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shoopity

Let me know if this is a built-in functionality that I'm just missing, but I've been working with AI to make a script so my songs start on the :05s (5:05, 5:10, 5:15, etc.), with a "background" song in between.  I initially tried scheduling the background playlist first, set to repeat, but it wasn't reliably going back to that when the main playlist stopped.  This script does mostly what I want, but you can see the next song start for a split second before stopping.  I think because the playlist moves to the next item even though the script is still running?  Shouldn't it wait until the script finishes before moving to the next item in the playlist?

I also noticed that, when starting a playlist at a particular item, the queue/current playlist becomes less than the original playlist.  Is that intentional?  As in, if I want to start a playlist at item 3, the current playing playlist starts with that item and continues to the last item, so items 1 and 2 are gone; like, you can see the playlist is shorter from the Status screen.  Not that the saved playlist has changed, but if your playlist is normally 5 items, but you start a playlist at the third item, then the playlist that's playing is only 3 items long.

My setup is thus:
The main playlist is:
Type: Both, Song A, Seq A
Script to start on the 5s
Type: Both, Song B, Seq B
Script to start on the 5s
... and so on

I also have a second, lower priority "background" playlist that is:
Type: Media, BG audio

The script works by:
  • Gets the name of the current playlist playing
  • Gets the "master" playlist with curl -s "http://localhost/api/playlist/${PLAYLIST_NAME}" | jq -r '.mainPlaylist | to_entries[] | "\(.key)|\(.value.type)|\(.value.sequenceName // .value.mediaName // .value.scriptName // .value.name)"'
  • Looks for the last played item that was stored in a "bookmark" txt file from the last time the script ran, e.g. song A played last
  • Finds the next item that's either a sequence, media, or both from the master list, that's after the bookmark item, e.g. song B
  • Changes the bookmark text file to the that song, so it sets the bookmark to song B as it assumes it's going to play
  • Calculates the time to the next :05 minute mark
  • Adjusts for the fact that Playlists start with a 0 index, but the API starts with a 1 index
  • Creates a start payload, a stop payload, and a start BG payload
  • Creates a nohup to schedule playing the current playlist at the next song (from the bookmark) using the start payload
  • Stops the currently running playlist using the stop payload
  • Starts the BG playlist using the start BG payload

Like I said, this script does what I want, I just notice that the next song starts before the script stops the playlist.  Is that normal?  Should I just add a "pause the current playing playlist" at the beginning of the script?  Am I stupid for doing this because this functionality is built-in to FPP already?

Here's the script:
FPP script to start songs on the next :05

Support FPP

+- Recent Topics

FPP 9.5-1 causing 192-168-8-1 for most WiFi IP by Sawdust
January 16, 2026, 03:39:52 PM

FPP driving P10 and also pixel outputs - several options by k6ccc
January 16, 2026, 03:23:49 PM

FPP MIDI plugin installed but wont trigger Playlist by MichaelGilley
January 13, 2026, 04:12:30 PM

SRx4 Long Range Quad SmartReceiver by tbone321
January 13, 2026, 03:32:30 PM

Pixel Port by LedMutt
January 13, 2026, 12:57:46 AM

Peace Stake material by LedMutt
January 12, 2026, 12:15:36 AM

Forbidden Error Port 80 by darylc
January 11, 2026, 10:24:48 PM

LoRa plugin. Is it worth pursuing in 2026 by k6ccc
January 11, 2026, 11:16:25 AM

Analog input by MikeKrebs
January 10, 2026, 10:28:19 PM

2025 Show Video by MikeKrebs
January 10, 2026, 10:20:00 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod