Project with PeppyMeter Screensaver Plugin for VOLUMIO v2.9xx and 3.0xx buster

Hi!

I installed vers 1.4 and everything works just as supposed! Great contribution!!
Thanks

Best Regards/ C

@2aCD i tried your configuration with modular alsa and spotify integration disabled but the problem of skipping traks is always the same…unfortunately the situation has worsened. as soon as a track starts playing you hear a noise for 1 second and no music and then it automatically goes to the next track

Ok that was only a try, not recommend. Is the sound the same as you enabled the Spotify integration with modular alsa?
And try to enable in ‘Playback Options’ the audio buffer size to 12MB.

@2aCD with modular alsa and spotify enbled the sound is Ok but the track skip but after random time playng…

Also with audio buffer = 12MB?
And please try the HDMI output.

A post was merged into an existing topic: Volumio x86 + PeppyMeter

@2aCD I tried the 12MB buffer and HDMI output, and Peppy + Spotify were ok, tracks don’t skip but my system doesn’t have an HDMI connection to my amp but the sound start from volumio on raspberry go to my SMSL C100 external dac by USB connection and finally goes to my amplifier by an RCA connection. But setting the HDMI output I cannot listen to music from my amplifier…but only from the speakers of my Waveshare display…Therefore this solution of setting HDMI out to solve the skipping problems is not good for me. can you still help me?

1 Like

Thanks for the great update @2aCD.

Made a small mod to the file “UIConfig.json” and “UIConfig_V0.json” to increase the time out to 86400 seconds.
Now I am able to control Peppy via my remote and/or GPIO to turn it on/off by using:
On:
bash /data/plugins/user_interface/peppy_screensaver/peppymeter/run_peppymeter.sh
Off:
rm /tmp/peppyrunning

as complete bash script with one button:
cd ~
nano peppy.sh

#!/bin/bash

# Check if volumio_peppymeter.py is running
if pgrep -f "volumio_peppymeter.py" >/dev/null; then
    # If it's running, kill both volumio_peppymeter.py and run_peppymeter.sh processes
    echo "volumio_peppymeter.py is running. Killing processes..."
    rm /tmp/peppyrunning
else
    # If it's not running, start run_peppymeter.sh
    echo "volumio_peppymeter.py is not running. Starting run_peppymeter.sh..."
    XAUTHORITY=~volumio/.Xauthority /data/plugins/user_interface/peppy_screensaver/peppymeter/run_peppymeter.sh &
fi

I thought to share it as it was requested multiple times over the last years. Since the impact on code is minimal. (or not even needed if people find 3600 enough)

Last addition, toggle through all the templates in your selected folder use a RC or GPIO button.
This will read the used template folder and al templates within it.

cd ~
nano templates.sh

#!/bin/bash


#!/bin/bash

# Path to the config file
config_file="/data/plugins/user_interface/peppy_screensaver/peppymeter/config.txt"

# Read the values of base.folder and meter.folder from the config file
base_folder=$(grep -oP 'base.folders*=\s*\K.*' "$config_file" | tr -d '[:space:]')
meter_folder=$(grep -oP 'meter.folder\s*=\s*\K.*' "$config_file" | tr -d '[:space:]')

# Build the path to the meters.txt file
meters_file="/data/INTERNAL/peppy_screensaver/templates/$base_folder/$meter_folder/meters.txt"

# Read the content of meters.txt and print everything between []
# Check if meters.txt exists
if [ ! -f "$meters_file" ]; then
    echo "Error: meters.txt does not exist at $meters_file"
    exit 1
fi

# Read content of meters.txt and strip []
meters_content=$(grep -o '\[.*\]' "$meters_file" | tr -d '[]')

# Place content of meters.txt in an array
readarray -t meters_array <<<"$meters_content"

# Print the elements of the array
echo "Contents of meters.txt:"
for meter in "${meters_array[@]}"; do
    echo "$meter"
done


# Path to the config file


# Get the current meter value from the config file
current_meter=$(grep '^meter =' "$config_file" | cut -d '=' -f2 | tr -d '[:space:]')

# Find the index of the current_meter value in the array
current_index=-1
for ((i=0; i<${#meters_array[@]}; i++)); do
    if [[ "${meters_array[i]}" == "$current_meter" ]]; then
        current_index=$i
        break
    fi
done

# Calculate the next index in the array
next_index=$(( (current_index + 1) % ${#meters_array[@]} ))

# Get the next meter value from the array
next_meter=${meters_array[next_index]}

# Overwrite the line in the config file with the next meter value
sed -i "s/^meter =.*/meter = $next_meter/" "$config_file"

echo "volumio_peppymeter.py is running. Killing processes..."
rm /tmp/peppyrunning
XAUTHORITY=~volumio/.Xauthority /data/plugins/user_interface/peppy_screensaver/peppymeter/run_peppymeter.sh	

@Roberto_Grieco
I know, HDMI is not an alternative for a DAC. It was only a try to locate the problem. Do you have also try your DAC with 12mb audio buffer?

Using dac as output, buffer 12 mb either with modular alsa either with dsd native… Nothing to do, Spotify skips :sob:using Dac as output, buffer 12 mb, dsd native and disabling Spotify integration music doesn’t skip but the needles of the vumeters are stationary, they do not move

hey @Wheaten
I have made two little changes in code for a better control of external start/stop.
with call of run_peppymeter.sh is a file created and its deleted if peppy stop

/tmp/peppyrunning 

I need this also, to check if it always running. You can check: if exist, then peppy is running.
The first change in code is now. You can delete this file manually in your code and peppymeter ist stopping regular, without a kill process.

The second change is, you can set the timeout to 0. then no screensaver is start automatically.
to test this, replace two files:
peppymeter.zip (1.7 KB)

It’s only for test. If this what you want, I would implement it.

best regards
2aCD

Yes, I’ve seen this one.
Was struggling to start Peppy from outside the plugin.
As normal user it failed on access rights om "/tmp/peppyrunning "
As sudo nothing happened, so ended with XAUTHORITY=~volumio/.Xauthority

I will run some test tomorrow with your code and see if it works.

To be sure,
I replace both files from the zip
Check if “/tmp/peppyrunning” is present.

if present then delete "/tmp/peppyrunning"
else start Peppy

On the “0”. If set to “0” peppy won’t start by itself, is that correct?

hey @Roberto_Grieco,
I suspected that. Its the combination of your USB-DAC and Spotify + PeppyMeter alsa configuration.
Do you install an overlay driver for this DAC or how it is defined as output device?
The problem is, I can’t reproduce that exactly. With the most DAC’s the current configuration is working.
We can only try some things.

please download again. I have set now the permission of this file for all.
and yes, if set 0 then peppy won’t start by itself

Ok I will,

When testing is complete I will update the code to toggle through the templates by reading config.txt to extract the template folder and scan meters.txt so the array is populated automatically.

When this works as expected it could be integrated into peppy and called directly via a node call.
(Same logic as done by @Old_Duffer for the randomizer plugin).

When this is done, Volumio is fully inline with the more expensive brands on functionality.

The dac is defined in output as “Smsl usb audio”.
I don’t know how to install on raspberry and if there is another driver for my smsl. I found a driver on smsl site…but i suppose that it is for Windows.

@2aCD

Hi Falk,

Modified the code and Yes it works.
Checked if the pid’s where gone and they are.

volumio@volumio-rpi5-allo:~/scripts$ ps ax | grep 'run_peppymeter.sh' | grep -v grep | awk '{print $1}'
volumio@volumio-rpi5-allo:~/scripts$ ps ax | grep 'volumio_peppymeter.py' | grep -v grep | awk '{print $1}'
volumio@volumio-rpi5-allo:~/scripts$

Updated the code above. Also included a dynamic read of meters.txt, for all template names.
So now I can use mu RC or GPIO to switch between Now playing and Peppy and switch between all templates in that folder. I am a happy baster.

And no, I can’t wait till tomorrow … :joy:

Hello… Kindly help me how to add additional peppy skins to the new version of peppy meter.

Is it just me or do the WeTransfer links for Gelo’s skins expired?

1 Like