PeppyMeter

I am trying to use PeppyMeter for a recording application with the Raspberry Pi and the Fe-PI audio board. As a first step, I wanted to see whether the playback works, and do not seem to be having any success, the 'aplay' command aborts with an error message with the '-D peppyalsa' option when trying to use the Fe-Pi audio board. However, it seems to work with the on-board audio. 'aplay' command by itself works fine with either. https://github.com/project-owner/PeppyMeter/issues/7 has all the details with screenshots. I would be grateful for any suggestions and expert feedback.
 
@phofman - you are right that it is a stereo/mono issue! I tried to play a stereo wav file and that worked well with the 'aplay -D peppyalsa' command, I could see the L/R vu-meter. So it looks like something in the library is expecting a stereo audio file and will not work with a mono audio file, but only with the hw:1 setting. Perhaps that could be checked and corrected?
 
Is such report in the github issue? aplay -D hw:0 mono.wav
If the .asoundrc file specifies card 1 as the default, is there a need to specify it again in the aplay command? But it is interesting that 'aplay -D hw:1 mono,wav' does show the same error about Channels count non available, while 'aplay mono,wav' does not, with a card setting of 1 in the .asoundrc file. I can hear the playback via the Fe-Pi board, so the audio is coming through. If the .asoundrc has 0 for the card, 'aplay' works fine with or without the '-D hw:0', no errors. I am assuming that the .asoundrc file is always used with or without the '-D peppyalsa' option.
 
But it is interesting that 'aplay -D hw:1 mono,wav' does show the same error about Channels count non available, while 'aplay mono,wav' does not, with a card setting of 1 in the .asoundrc file.
Your default device (no device in aplay corresponds to "-D default") as re-defined in your .asoundrc wraps the chain with the plug plugin, whereas -D hw:1 does no conversions. Always run aplay with -v (verbose) param to see what's going on. In this case you would see the plug plugin of the default device doing the conversion from mono to stereo since the raw device does not support mono.
 
Your default device (no device in aplay corresponds to "-D default") as re-defined in your .asoundrc wraps the chain with the plug plugin, whereas -D hw:1 does no conversions. Always run aplay with -v (verbose) param to see what's going on. In this case you would see the plug plugin of the default device doing the conversion from mono to stereo since the raw device does not support mono.
The intricacies of Linux are somewhat beyond my understanding! If I use '-D peppyalsa' with the aplay or arecord commands, and there is a special .asoundrc file for use with peppyalsa, shouldn't all this be transparent at the command level? Do I still have to specify hw:n separately in the aplay or arecord command when it is already defined in the file, and worry about the plug plugin, etc.?
 
Simple question.

I see lots of examples of ~/.asoundrc for peppy that look like the one at the end of this post.

I understand conceptually how it works and that I should point my players ALSA device to peppyalsa, noting my player is Kodi on LInux and I also have removed pulseaudio from my Linux image so ALSA is all there is.

Currently I select the ALSA device for my DAC in Kodi so my simple question is if Kodi is now pointed to peppyalsa what in the config below redirects the PCM stream to my DAC. I can only assume slave.pcm "hw:0,0" but none of these examples I see explain this vital point.

Thanks,

Bluck



pcm.!default {
type plug
slave.pcm "softvol_and_peppyalsa"
}

ctl.!default {
type hw
card 0
}

pcm.peppyalsa {
type meter
slave.pcm "hw:0,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/pi/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
 
Hi,

The idea is to split the signal into two streams and forward one to a hardware device (e.g. DAC etc) and the other to the meter/peppyalsa plugin.
Using the configuration file which you posted this command should work assuming that you have some hardware device with these parameters card:0 device:0
aplay -D default myfile.wav

Best regards
 
Thanks

So "slave.pcm" is the part that routes the stream to me DAC.

So if "aplay -l" shows my DAC as:

card 1: Balanced [D10 Balanced], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0


I assumes I use slave.pcm "hw:1,0"

What about the "card 0" references, do these change to "card 1"?

Yes I could bugger around with this but hopefully you can save me some agro.

Thanks again,

Bluck
 
Yes, if 'aplay -l' shows that your device is card:1, device:0 it should be changed everywhere in the configuration file where 'card' and 'device' are referenced. As you mentioned it should be 'hw:1,0' and 'card 1 '.

Best regards
 
I got my lazy butt out of bed (I am in NZ so its 9am here) before I saw your confirmation and installed peppy, changed the above config to what I thought was needed (as per my thoughts above), buggered around getting the right version of python as the default (used update-alternatives --install /usr/bin/python python /usr/bin/python3 1 in the end) and low and behold it worked first time.

Took all of 10 mins.

Now just need to configure which VU I want and setup devilspie to position it where I need it, force it above kodi and remove pygame info bar.

My only remaining question is I am using peppyalsa as my Kodi device and not softvol_and_peppyalsa.

I assume that if you selected the later that you could use the Linux GUI volume control but because I have removed pulseaudio, I dont have a volume control so used peppyalsa .

Many thanks for your tips.

No need to reply unless you really want to

Thanks

Bluck
 
To get rid of the window frame including the title bar you can set this property to True:
https://github.com/project-owner/Pe...98e0d07bc77587c25f75dda0c80018/config.txt#L26

It's not required to use volume control. Without it the meter will show values as if the volume would be in the max position.

If you will make it working, it would be great to have the list of steps required to make PeppyMeter working on Kodi. Ideally it could be a Kodi extension/plugin. But I touched Kodi last time about 7 years ago and don't want to work on such plugin especially if there is a way to make it working without that.

Best regards
 
So I have it now integrated fully into kodi noting I only use Kodi for music playback (albums or concert videos)

I use peppy for a "dark mode" screen when playing an album, with a grey scale, wide format "tube" VU without the tube picture.

It has a completely black background, the VU Meters, some basic playback controls (next/prev/pause/stop), slider control, playlist dropdown, an exit control and track name,track number.

This reduces ambient light from my 60" plasma TV when playing back an album.

Below are a couple of low rez/fuzzy images of the "dark mode" screen, the first without the playlist dropdown and the second with. I keep track of where I am browsing window wize, so the VU's will disappear/reappear as needed.

shot.png


shot1.png


However, it appears the VU's read too hot.. all my music albums are normalized to -1db so I tested this via a 1khz 0db calibration track and it read +6db.

Maybe this VU uses a different scale or maybe there is some config that can adjust this?

Thanks,

Peter
 
Last edited:
Of course, this could be my misunderstanding of OdbFS and what it is on an analogue VU meter.

Reading about this informs me that there are varying standards within the pro community and I am not suggesting that peppy is erroneous.

I did validate my test file in foobar and it showed the following:

foobar.png


Bluck