Documentsplaylists

Playlists

The Playlists tab is where you sequence and group your content.

Pasted image

The playlists tab is where you choose what assets you want to group together and how you want to play them. Playlists primarily allow you to:

  1. Choose assets

    1. Configure some assets like PDF’s to play in presentation mode or Videos to play in mute

    2. Choose the duration of each asset

  2. Play around with the layout

    1. Split screen or single screen

    2. Select which assets are shown where on the screen

  3. Setup advanced settings like

    1. Advert content, domination content, etc

    2. Choose a schedule template

    3. Add RSS feeds and tickers

Creating a playlist

To create a playlist click on the ‘+ Create Playlist” button at the top of the playlist page. This should open a dialog to set the following

  1. Name of your playlist

  2. Emoji as a unique visual identifier to quickly find your playlist

  3. Description,Helpful indicators or instructions related to your playlist

  4. Type of playlist, regular works for most use cases but you could read more about types of playlists in the next section

  5. Category to help sort and filter your accounts artifacts.

Pasted image

Types of Playlists

There are 6 types of playlists in PiSignage. You can change and manage the playlist settings by clicking on the playlist and navigating to the settings tab.

Pasted imageRegular Playlist
A standard playlist with normal playback. Good for most usecases

Pasted imageAdvert Playlist
Assets in this playlist are inserted periodically (the interval can be set in settings) in-between any playlist scheduled for the same time.

Pasted imageDomination Playlist
This playlist over-rides any currently playing playlist and plays in one full cycle before handing control back to the scheduled playlist. The interval for the domination is as decided by the user in settings.

Pasted imageAudio Playlist
This playlist plays via the 3.5mm audio jack while any other playlist scheduled at the same time plays. Great for background music or radios.

Pasted imageEvent Playlist
This Playlist plays when the SIGUSR2 signal is received.

Pasted imageKeyPress Playlist
Like the event playlist but can be configured for any key being pressed on the keyboard or hardware.

Categories

Categories are tags that help organise and categorise your playlists. They are present throughout the platform (even in assets, groups, etc) to help categorise everything. Adding categories is as simple as clicking the relevant category to apply the same.

Pasted imageYou can find more information on categories in the Categories page.

Playlist directory

The directory gives you an overview of all of your playlists and helps you manage them at a glance. Here you can view the groups it is visible (Collaborators management is when this is relevant) and scheduled in, number of assets, total duration and more…

Pasted image

Search, Filter and sort

Pasted imageSearch through your playlist.

Pasted imageFilter using playlist types and categories.

Pasted imageSort your playlists by name or duration.

View

Pasted imageView playlist helps open the playlist detail page which is better explained below. It is where you can choose assets, change settings, define layouts and more

Duplicate

Pasted imageCreate a copy of your playlist with all of the same assets and settings applied

Bulk actions

Pasted imageHere you can select multiple playlists to bulk update categories, Assign them to a group (which makes them visible to the group, ref: Collaborators) Schedule them to a group, duplicate or delete.

Manage playlist

You can access the Playlist detail page by clicking on a playlist. Pasted image

Assets

Assets is where you can add assets to your playlist.

To add assets

simply click on the add assets button to open the assets pane. click on the assets to be added or drag and drop the same to add them
Pasted image
Pasted imageSearch, Filter and Sort
You can also use the filter options in the assets pane to narrows down or filter assets.

Pasted image

Configuring assets

Pasted image

Once added you will see a few options depending on the type of asset

  1. Play in full screen: This over-rides any layouts (explained in the next section) and plays the asset in fullscreen

  2. Duration tells the platform how long you want each asset to play in the playlist

  3. Text overlay adds a message to be displayed over an asset. It appears over the center of the asset

  4. Audio specific controls

    1. Play in background plays the asset as background audio while moving to the next asset
  5. Video specific controls

    1. Mute video will mute all audio from the video, youtube video, stream, etc
  6. PDF specific controls

    1. Play in presentation mode plays each page of the PDF for the duration spedified. The total duration of the PDF will still apply and may cut off the PDF from playing each page. i.e for a 10 page PDF playing at 5seconds per page, the totla duration must be 50 seconds else the pages will not display after the cut off.

Re-order the assets

By dragging and dropping the assets with the drag handles. The assets play in the order that they are in (left to right or top to bottom based on the view selected).
Pasted image

Layout1

Layouts help configure your playlist to show multiple assets on the same screen by splitting the screen as desired. Template Designer allows you to create your own custom layouts.

In any layout the screen is divided into zones. These zones are where you configure and place assets. An example of one such layout is below. PiSignage supports upto 6 zones in a layout

Pasted image

Choosing a layout

By default the chosen layout will be “1” which is a single zone layout. You can click on “Change” layout which will show you all available layouts. Pasted image

Once selected the rows below will begin showing the zones as indicated by the layout.Pasted image

Configuring asset rows

Now that you have everything setup it is time to select what plays where and when.

The play in fullscreen option has the asset in the “Main Zone” override the layout and play in full screen.

Pasted imageClicking on an empty zone will open the Assets pane and allow you to choose an asset from the same. On choosing the asset it will now appear in that zone.

Pasted imagePasted imagePasted imageOnce configured all empty zones below inherit the last chosen asset in that zone. i.e even though the main zone asset changes the side zone continues to show the same asset through it all. You can click on an inherited asset to replace the same.

Pasted imageThe rows give you a good indication of all of how the zones will look like on the screen (eg: empty zones will appear black as shown in the UI).

Settings

Basic information

Modify the name, description or emoji associated with the playlistPasted image

Playlist type

Set the properties specific to your playlist type. Namely as below

Regular playlist: None

Advert playlist:

  1. Number of assets to be played during the interruption

  2. Interval between ads is where the main playlist plays before the next ad break

  3. Do not play the ad in the main zone: Ensures that your assets are restricted to only zones outside the main zone (side, bottom, etc). Read layouts[1] above for more information.

Domination playlist:

  1. Play after this many minutes is interval where the main playlist is interrupted every ‘x’ minutes

Audio playlist:

  1. Volume level of the playlist.

  2. Play in random order randomises all of the audio from the assets.

  3. Play on HDMI port as well plays the audio on the 3.5mm audio jack and the HDMI port playing the same as the background audio on the TV as well.

Event playlist:
This Playlist plays when the SIGUSR2 signal is received.

What is SIGUSR2

The SIGUSR2 signal is a user-defined signal used for simple interprocess communication in Linux environments, including on a Raspberry Pi running Raspberry Pi OS (a Debian-based Linux distribution). It has no default system action other than process termination, so you must explicitly define a signal handler in your code to use it effectively. 

Below are examples in Python and C.

Python Example

This Python script demonstrates how to set up a signal handler for SIGUSR2 in one process and trigger it from another, or from the terminal.

signal_handler.py (The Receiving Process):

python

import os
import signal
import time

Define the signal handler function

def receive_sigusr2(signal_number, frame):
print(f"\nReceived signal: {signal_number} (SIGUSR2)")
print("Performing custom action (e.g., reloading config, toggling a GPIO pin)...")

Register the SIGUSR2 signal handler

signal.signal(signal.SIGUSR2, receive_sigusr2)

print(f"My PID is: {os.getpid()}")
print("Waiting for SIGUSR2... (Press Ctrl+C to exit)")

Keep the program running indefinitely

while True:
time.sleep(1)

How to run it:

  1. Save the code above as signal_handler.py on your Raspberry Pi.

  2. Open a terminal and run the script:

    bash

    python3 signal_handler.py
    
  3. Note down the PID (Process ID) printed by the script (e.g., My PID is: 12345).

Sending the signal:
Open a second terminal and use the
 kill command to send the SIGUSR2 signal to the noted PID: 

bash

kill -SIGUSR2 <PID>
# or using the signal number (SIGUSR2 is typically 12)
kill -12 <PID>

You will see the message "Received signal: 12 (SIGUSR2)" in the first terminal each time you send the signal.


C Example

This C program shows how to use sigaction (a more reliable way to handle signals than signal()) to catch SIGUSR2. 

sigusr2_example.c (The Receiving Process):

c

#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>

void signal_handler(int signum) {
if (signum == SIGUSR2) {
printf("\nReceived SIGUSR2 signal!\n");
printf("Performing some action...\n");
}
}

int main() {
struct sigaction sa;

// Zero out the structure
memset(&amp;sa, 0, sizeof(sa));

// Set the handler function
sa.sa_handler = signal_handler;

// Install the signal handler for SIGUSR2
if (sigaction(SIGUSR2, &amp;sa, NULL) == -1) {
    perror(&quot;sigaction&quot;);
    return 1;
}

printf(&quot;My PID is: %d\n&quot;, getpid());
printf(&quot;Waiting for SIGUSR2...\n&quot;);

// Keep the program running
while (1) {
    sleep(1);
}

return 0;

}

How to run it:

  1. Save the code as sigusr2_example.c.

  2. Compile it using GCC:

    bash

    gcc sigusr2_example.c -o sigusr2_example
    
  3. Run the compiled program in one terminal:

    bash

    ./sigusr2_example
    
  4. Note the printed PID.

Sending the signal:
In a second terminal, send the signal using
 kill and the PID: 

bash

kill -SIGUSR2 <PID>
  1. Duration of the event is the duration of time the playlist is to be played after the event is triggered. 0 and 1 are special values as defined below. All other values are taken in seconds.

    1. 0 Plays the playlist till the next event takes place

    2. 1 Plays the playlist once

  2. Play only once plays the entirety of the playlist in one cycle before resetting the usual content

  3. Play until next event: plays the event playlist until the event is detected again

Key Press playlist:

  1. Key-code to trigger playlist: Every Key pressed corresponds to a code value. You can directly configure the playlist to play on receiving a certain code value. PLEASE MAKE SURE TO ENTER THE SAME IN DECIMAL AND NOT HEX VALUES.
    some examples for a standard keyboard are as below https://developer.mozilla.org/en-US/docs/Web/API/UI\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Events/Keyboard\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\event\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\code\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\values

  2. Use GPIO22 as the key: Configure your custom hardware to connect to the Raspberry Pi GPIO22 Pin. You can configure the key code and enter the same.

  3. Play only once will play the playlist in its entirety once pressed.

Play when online

This ensures if the playlist is configured to play along with a fall back in Groups , it plays only when the player has a connection to the internet. This is great for playlists with livestreams, youtube videos, weblinks and other online assets

Pasted image

Categories

You can select and configure Categories attached to the player here.

Pasted image

Groups

Configure the groups the playlist is visible (Collaborators management is when this is relevant) and scheduled in

Pasted image

Ticker

Add a RSS or message based ticker to the bottom of your screen. You can choose between 3 kinds of tickers here

  1. Text associated to the asset (text overlays, etc)

  2. Messages

  3. RSS text

Pasted imageConfigure the scroll direction, Ticker speed, Ticker height along with optional CSS to change its styling.

When using an RSS, you can choose between the description or title field. To display an RSS feeds images along with text refer to Assets 

Below is an example of what an RSS ticker looks like.

Pasted image

Schedule

Schedule templates allow you to add a template that will then apply as the default schedule for the playlist whenever added to a Groups
Schedules include

  1. A start and end date

  2. Specific time window it plays during

  3. Selected days or dates that can be chosen as a window to be played (eg, A specific playlist for whenever the 2nd falls on a wednesday)

  4. Play in cycles of 3,4,5 weeks

Pasted image