My music player project – Quarantine 19 (started during my quarantine…)

I am using photon 3.4 for the peppy meter and pygame package . you can install other python versions as you like without any conflicts with the Volumio installed version.

Thanks for answering.
Interesting solutions.
The last solution … if you use a ssd it would limit the storage capacity a bit, although you gain some more things like low power requirement on the HDD and more silence. Interesting.
So … the toroidal transformer is always on? It would be interesting to design a system with a relay to turn everything off.

off course there is… also a relay to turn it off completely as I wrote, trigged by my external DAC.
for SSD, the prices these days are low , I put a 2TB SSD seems to be more than enough .
it is more silence, faster and smaller so it worth it. most of my big files are DSD. the rest of the music is Tidal so no need to store.

Regarding the peppy meter, if I install python 3.4 and do the step from the github it will work? because I di not find the asound conf file, and I have only dev fb1 not Fb0, sgould I exchange this to fb1 in configuration files…
My display is a dsi bit hdmi.
Thanks for your suport.

the asound.config is an optional file so if it is missing just create it In the etc directory.

Hi,
This wekend I will try to install again.

  1. First step. Install python 3.5 it is ok this tutorial Python 3

I have installed that version.
Now I have python vers3 and ver 3.5. When I run python3 - - version I receive is python 3.5.2.
Now I am installing the pygame but when I started import pygame from python3 or python 3.5 interpreter I receive : no module named pygame. How should I continue?

Update :also libpeppyalsa.so is not installed in /usr/local/lib when I want to install peppyalsa plugin.
So many issues :frowning:
Thanks

Hello ofiras ,

Please help with next topic:
I have digged and I have observed that pygame should be run from a system with a monitor connected . Since volumio is a headless system I receive the error form above . How do you overcome this issue ?

volumio@volumio:~/PeppyMeter$ python3 peppymeter.py Traceback (most recent call last): File "peppymeter.py", line 224, in <module> pm.init_display() File "peppymeter.py", line 132, in init_display pygame.display.init() pygame.error: Unable to open a console terminal

I have also executed the command below and I have sound . I have configured the plughw instead of hw in asound.conf file from /etc , but I guess for my specific setup I should configure other things ?

aplay -D peppyalsa audio_file.wav

I use plughw 5,0 because i have a USB DAC

Thanks

Hi ,

I saw on the peppymeter wiki page that the vumeter will be displayed only on a HDMI , LCD monitors and through VNC .
That means that on DSI display will not work ? if this is the case I will stop :frowning:
Thanks

It should work . If you see volumio UI in this display you will see Peppy meter also.
Just install the volumio touch plugin

Hi,
I have installed Touch plugin, i see the volumio UI on display but when I start the the python peppymeter.py I receive the above error: could not open terminal console.
I guess I am. Missing some configuration but I can realize
Thanks for your help.

try edit the peppymeter.py file:
def init_display(self):
self.screen_w = self.util.meter_config[SCREEN_INFO][WIDTH]
self.screen_h = self.util.meter_config[SCREEN_INFO][HEIGHT]
self.depth = self.util.meter_config[SCREEN_INFO][DEPTH]

    os.environ["SDL_FBDEV"] = "/dev/fb1"
    os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
    os.environ["SDL_MOUSEDRV"] = "TSLIB"

    if not self.util.meter_config[OUTPUT_DISPLAY]:

        os.environ["SDL_VIDEODRIVER"] = "dummy"
        os.environ["DISPLAY"] = ":0"
        pygame.display.init()
        pygame.font.init()
        self.util.PYGAME_SCREEN = pygame.display.set_mode((1,1), pygame.NOFRAME|pygame.DOUBLEBUF, self.depth)
        return

    if "win" not in sys.platform:
        os.environ["DISPLAY"] = ":0"
        pygame.display.init()
        pygame.mouse.set_visible(False)
    else:
        pygame.init()
        pygame.display.set_caption("Peppy Meter")

    self.util.PYGAME_SCREEN = pygame.display.set_mode((self.screen_w, self.screen_h), pygame.NOFRAME|pygame.DOUBLEBUF, self.depth)
    self.util.meter_config[SCREEN_RECT] = pygame.Rect(0, 0, self.screen_w, self.screen_h)

Hello ofiras,
I have modified, I have added noframe, also I have comment the one line above. and I open the script with openvt - s - - python-3 peppymeter and it worked. How do you open it and close it ?
Now if I start music the vumeter is not updating.
I have modified the mpd.conf to use peppyalsa but no reaction. Also I have observed that on reboot the mpd.conf is rewritten.
If I execute a play - D peppyalsa /usr/share/sounds/alsa/ file. Wav the vumeter is fully functional.
Another issue that I have now if I kill the peppymeter process in display I see the vumeter, it does not switch to volumio UI.
Tu he User rpi from diy audio helo me on this and is still help me.
Thanks

Hello,
Could you please tell me how you have configured the asound.conf and mpd.conf, on my side is not working at all.
It is working only if I play a particular file with aplay…
Thanks.

run from shell : aplay -l
show me your output and also your mpd.config and asound.config files

Hello

I use an USB DAC . I have configured plughw 5.0 as my output.
My display is waveshare 4.3 inch DSI
For displaying the peppymeter I use /dev/input/event0 because I do not have a /dev/input/touchscreen

  1. aplay -l

Blockquote
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 3/3
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
card 5: E30 [E30], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

  1. mpd.conf from /etc
    Here in the audio output I have configured peppyalsa :

Blockquote
volumio@volumio:~$ cat /etc/mpd.conf

Volumio MPD Configuration File

# Files and directories #######################################################
music_directory         "/var/lib/mpd/music"
playlist_directory              "/var/lib/mpd/playlists"
db_file                 "/var/lib/mpd/tag_cache"
log_file                        "/var/log/mpd.log"
#pid_file                       "/var/run/mpd/pid"
#state_file                     "/var/lib/mpd/state"
#sticker_file                   "/var/lib/mpd/sticker.sql"
###############################################################################

# General music daemon options ################################################
user                            "mpd"
group                          "audio"
bind_to_address         "any"
#port                           "6600"
#log_level                      "default"
gapless_mp3_playback                    "no"
#save_absolute_paths_in_playlists       "no"
#metadata_to_use        "artist,album,title,track,name,genre,date,composer,performer,disc"
auto_update    "yes"
#auto_update_depth "3"
###############################################################################
# Symbolic link behavior ######################################################
follow_outside_symlinks "yes"
follow_inside_symlinks          "yes"
###############################################################################
# Input #######################################################################
#
input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}
###############################################################################

# Decoder ################################################################





###############################################################################

# Audio Output ################################################################

resampler {
                plugin "soxr"
                quality "high"
                threads "1"
}

audio_output {
                type            "alsa"
                name            "alsa"
                device          "peppyalsa"
                dop                     "no"




}





audio_output {
    type            "fifo"
    enabled         "no"
    name            "multiroom"
    path            "/tmp/snapfifo"
    format          "44100:16:2"
}

#replaygain                     "album"
#replaygain_preamp              "0"
volume_normalization            "no"
###############################################################################

# MPD Internal Buffering ######################################################
audio_buffer_size               "2048"
buffer_before_play              "10%"
###############################################################################


# Resource Limitations ########################################################
#connection_timeout             "60"
max_connections                 "20"
max_playlist_length             "81920"
max_command_list_size           "81920"
max_output_buffer_size          "81920"
###############################################################################

# Character Encoding ##########################################################
filesystem_charset              "UTF-8"
id3v1_encoding                  "UTF-8"
###############################################################################
audio_output {
        type            "fifo"
        name            "mpd_oled_FIFO"
        path            "/tmp/mpd_oled_fifo"
        format          "44100:16:2"
  1. I have understood that Volumio overwrittes the mpd.conf at restart so I have add the config also here :

Blockquote
sudo nano /volumio/app/plugins/music_service/mpd/mpd.conf.tmpl

Blockquote
volumio@volumio:~$ cat /volumio/app/plugins/music_service/mpd/mpd.conf.tmpl


# Volumio MPD Configuration File

# Files and directories #######################################################
music_directory         "/var/lib/mpd/music"
playlist_directory              "/var/lib/mpd/playlists"
db_file                 "/var/lib/mpd/tag_cache"
log_file                        "/var/log/mpd.log"
#pid_file                       "/var/run/mpd/pid"
#state_file                     "/var/lib/mpd/state"
#sticker_file                   "/var/lib/mpd/sticker.sql"
###############################################################################

# General music daemon options ################################################
user                            "mpd"
group                          "audio"
bind_to_address         "any"
#port                           "6600"
#log_level                      "default"
gapless_mp3_playback                    "${gapless_mp3_playback}"
#save_absolute_paths_in_playlists       "no"
#metadata_to_use        "artist,album,title,track,name,genre,date,composer,performer,disc"
auto_update    "yes"
#auto_update_depth "3"
###############################################################################
# Symbolic link behavior ######################################################
follow_outside_symlinks "yes"
follow_inside_symlinks          "yes"
###############################################################################
# Input #######################################################################
#
input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}
###############################################################################

# Decoder ################################################################

"${ffmpeg}"

"${sacdiso}"

###############################################################################

# Audio Output ################################################################

${sox}

audio_output {
                type            "alsa"
                name            "alsa"
                device          "peppyalsa"
                dop                     "${dop}"
                ${mixer}
                ${format}
                ${special_settings}

}





audio_output {
    type            "fifo"
    enabled         "no"
    name            "multiroom"
    path            "/tmp/snapfifo"
    format          "44100:16:2"
}

#replaygain                     "album"
#replaygain_preamp              "0"
volume_normalization            "${volume_normalization}"
###############################################################################

# MPD Internal Buffering ######################################################
audio_buffer_size               "${audio_buffer_size}"
buffer_before_play              "${buffer_before_play}"
###############################################################################


# Resource Limitations ########################################################
#connection_timeout             "60"
max_connections                 "20"
max_playlist_length             "81920"
max_command_list_size           "81920"
max_output_buffer_size          "81920"
###############################################################################

# Character Encoding ##########################################################
filesystem_charset              "UTF-8"
id3v1_encoding                  "UTF-8"
###############################################################################
audio_output {
        type            "fifo"
        name            "mpd_oled_FIFO"
        path            "/tmp/mpd_oled_fifo"
        format          "44100:16:2"
}
4. I have alo copy the asound.conf from /etc to /home/volumio/.asoundrc

> Blockquote
volumio@volumio:~$ cat .asoundrc
pcm.!default {
        type plug
        slave.pcm "softvol_and_peppyalsa"
}

ctl.!default {
        type hw
        card 0
}

pcm.peppyalsa {
        type meter
        slave.pcm "plughw:5,0"
        scopes.0 peppyalsa
}

pcm.softvol_and_peppyalsa {
        type softvol
        slave.pcm "peppyalsa"
        control {
                name "PCM"
                card 0
        }
}

pcm_scope.peppyalsa {
        type peppyalsa
        decay_ms 400
        meter "/home/volumio/myfifo"
        meter_max 100
        meter_show 0
        spectrum "/home/pi/myfifosa"
        spectrum_max 100
        spectrum_size 30
}

pcm_scope_type.peppyalsa {
        lib /usr/local/lib/libpeppyalsa.so
}

pcm.dsp0 peppyalsa

5.If I run the command

Blackquote
aplay -D peppyalasa /usr/share/sounds/alsa/Front_Left.wav

the VUmeter is fully functionally

Starting and stopping the peppymeter.py

1.I start the peppymeter.py with

Blockquote
openvt -s – python3 peppymeter.py

It is working only after I have added Noframe in the line you have mentioned and lso commented the line above that in peppymeter.py.

2.Stopping the peppmeter.py does not switch to Volumio UI on the display
Fort stopping the peppymeter I search for the process then kill with kill -9 PID.
But after killing the process the Volumio UI does not apper on the display . Somehow the pepymeter meter picture is hanging . If I search for peppymeter process I can not find it meaning that it is stopped

Have you configured a push button for switching the Volumio UI to pepymeter then back ?

Many thanks for your help
Florin

change in mpd.config the name peppyalsa:
:audio_output {
type “alsa”
name “peppyalsa”
device “peppyalsa”

also change in the sound.conifg the card numbers to 5

ctl.!default {
type hw
card 5
}

pcm.peppyalsa {
type meter
slave.pcm “hw:5,0”
scopes.0 peppyalsa
}

pcm.softvol_and_peppyalsa {
type softvol
slave.pcm “peppyalsa”
control {
name “PCM”
card 5
}
}

1 Like

Hello ofiras ,
Unfortunelly Is not working

/etc/asound.conf
asound.conf
pcm.!default {
type plug
slave.pcm “softvol_and_peppyalsa”
}

ctl.!default {
type hw
card 5
}

pcm.peppyalsa {
type meter
slave.pcm “hw:5,0”
scopes.0 peppyalsa
}

pcm.softvol_and_peppyalsa {
type softvol
slave.pcm “peppyalsa”
control {
name “PCM”

/etc/mpd.conf

/etc/mpd.conf
audio_output {
type “alsa”
name “peppyalsa”
device “peppyalsa”
dop “no”

Thanks for your help

Hello ,

Kindly please lets move the discussion here, because I do not want to polutte your post


Thanks

Hi Ofiras, I really like your project. I would like to do it but I’m still a raspberry neophyte. Is it possible to share your project such as construction diagram, complete material used and software installation? Sorry for my little English. Thank you so much.

1 Like