User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Tue Jan 07, 2020 6:09 am

Hi,

You have pretty advanced setup and your new planned features look very interesting. If you are experienced developer and if you could implement those features it would be very good addition to the player.

In order to start working on code you need to create a Github account if you don't have it already. Then you can try to create a separate branch from Peppy's master branch. After implementing and testing your changes you can make a Pull Request (PR) for reviewing the code. Then after approval it can be merged to the master branch. That's the procedure.

If you cannot create a separate branch you can create a fork and submit PR from that fork. Here is some info which can be helpful:
https://help.github.com/en/github/colla ... ll-request
https://help.github.com/en/github/colla ... rom-a-fork

If all that looks too complicated you can just make implementation and we will find a way to make it available on Github.

If you have any other questions please let me know either here or contact me at peppy.playerATgmail.com

Best Regards

ls48ju
Posts: 3
Joined: Mon Jan 06, 2020 4:01 pm

Re: Peppy player

Tue Jan 07, 2020 9:02 am

Hi,

ok, I'll fork your code and will create pull requests from my changes - my experience is more on the HTML/web/java side, but peppy gives me a good excuse to dive more into python than I did so far...

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Tue Jan 07, 2020 4:08 pm

Sounds good, just some comments before you start coding. Peppy is a free and open-source project distributed under GPL v3 license:
https://github.com/project-owner/Peppy/ ... er/LICENSE
You have to agree that your code will be distributed under this license.
Please place the corresponding license header to the new source files.

I can give a credit to you as a developer in Wiki pages in any form you prefer - your name, nickname, e-mail, link to your web page, projects etc.

Best Regards

ls48ju
Posts: 3
Joined: Mon Jan 06, 2020 4:01 pm

Re: Peppy player

Wed Jan 08, 2020 3:28 pm

Hello,

don't worry - I've been using Linux since 1991 (Dirk Hohndel was down the hall to help :-)), I am comfortable with the license and agree to it.

as for credit: I have to provide some code first... So far I forked it and cloned it locally, loaded it up in PyCharm.

Now I need to adapt my python environment (is there a reason you ship without a requirements.txt, or do I not yet understand the dependency management in python ?) and read up on the react used for the web part.

So far I found the code nicely structured and readable.

Regards

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Wed Jan 08, 2020 6:15 pm

Hi,

So far I was the only developer for this project therefore no need to provide any info for the dev env setup :)
The player is a cross-platform app that means you can make cross-platform development as well. My main development platform for the player is my Windows 10 desktop. You just need to install all required Python libraries/dependencies:
install pygame
python -m pip install tornado==4.5.3
python -m pip install discogs_client
python -m pip install pynanosvg
python -m pip install oauth2
python -m pip install feedparser
python -m pip install mutagen

Some Linux specific features don't work on Windows (ALSA, LIRC etc) in this case I just develop on Windows as much as possible then deploy and debug on Pi.

You can also setup PyCharm on Raspbian Buster Desktop. In this case the whole dev env will be in one place. You can connect to Pi using VNC in this case. I did that once but abandoned that env. Also you can use remote debugging functionality of the PyCharm - develop on Windows (or Mac), run player process on Pi and connect debugger to that process. It also works. Also for a long time I was using Python plugin for Eclipse.

It's up to you which IDE to use. Whatever is more comfortable for you. I ended up with MS VS Code. It's free, very fast IDE. It can be used for many different languages by installing add-ons/plugins. I use it to develop Python code as well as JS code. I would say this is de facto standard IDE for web development nowadays.

Feel free to contact me if you will face any issue or have any question.

Best Regards

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Wed Jan 08, 2020 6:54 pm

Regarding web development, you probably found web/server and web/client folders. It's pretty clear and obvious code separation. Under web/client there are two sub-folders: config and configdev. The former one is used in "production". It contains compiled/compressed code used during runtime in browser. The development code is in the web/client/configdev folder. You need to install node.js and run 'npm install' in that folder. It will install all libraries required for the development using the file package.json. If you made 'node' development before it should be familiar procedure for you.

I usually make changes using configdev code. To start the dev web server you just need to run 'npm start' in that folder. It will start webpack dev server on port 3000. To connect to the Peppy player (Tornado web server) running on port 8000 there is proxy setting in package.json.

When the code is ready I run 'npm run build'. It creates compiled/compressed code in 'build' folder. Then I just copy that code to "production" folder 'config'.

All described steps are required only if you are going to make changes in the player's Configuration UI which is using React.js and React Material-UI frameworks. If you are going to make changes only in the Player UI you can use Tornado web server started by the player itself on port 8000. The files which should be changed in this case are located in the folder 'web/client' (e.g. controller.js etc). The Player UI is using plain Javascript, SVG and WebSocket frameworks. It doesn't use neither React nor Material-UI. Hence it doesn't need node.js installation.

Best Regards

meanmeech
Posts: 5
Joined: Sun Jan 06, 2013 7:24 pm

Re: Peppy player

Wed Jan 15, 2020 8:21 pm

Hi Pepper Player, on a tangent have a few questions:
I use a TA7318P module for my analogue VU meters. I can either pick off from the speaker binding posts or the source. (currently using the binding posts to see when the amp is being clipped).

Thinking about it and googling I came across your post. I want to convert from the anologue VU display to a digit, IE taking advantage of the 2 head displays you can now coonect to the pi4.

So my initial questions are;

Can you split your vu Gui? Left channel for one screen and right channel for another?

My next question is broader, not so much revolving around pepper player but maybe of interest never the less. If I wanted to generate a signal to you VU Gui, could I generate the values if I converted the RMS from the TA module via a ADC hat and plug that into your code?

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Wed Jan 15, 2020 10:04 pm

Hi meanmeech,

You touched very interesting and very large topic ;)
I’m afraid it’s impossible to realise your ideas using current code.

I hope you’ve seen the Peppy Meter wiki pages already:
https://github.com/project-owner/PeppyMeter.doc/wiki
It can give you some idea what could be currently done in terms of hardware.

Peppy Meter is a stand-alone software which has the same code base as VU Meter in the Peppy player.

Some time ago I was thinking about making some kind of Digital VU kit similar to TA7318P but based on Pi Zero (?) which could also include two small LCDs for left and right channels.

Back to your questions. Technically it’s possible to split the signal into left and right channels. Then separate signals can be sent either over Serial line or I2C lines. It was implemented already. There are even LCDs available which can receive and handle I2C signals. The problem is that they are slow like hell. Even LCDs with SPI interface which I used so far are very slow for VU Meter. To have the idea what I’m talking about watch this video of the Peppy Meter implemented by someone from Korea or Japan:
https://www.youtube.com/watch?v=B-4TfcwO6w0
You can see that there is a large ghosting.

The situation is much better with HDMI displays. There is no such lag like in SPI displays. Though such displays are usually more expensive. If there is the ghosting in HDMI display it’s caused mostly by the slowness of the software as it’s written in Python. I have never tried to use two HDMI outputs of the Pi 4. I’m not sure how that could be done from the software point of view. Hopefully it’s doable but the current Peppy Meter code doesn’t support that. Even if it’s doable the price of such VU Meter will be more than $100 for Pi4 and two HDMI LCDs.

If you need to add analog input then you should use some ADC, something like this:
https://www.hifiberry.com/shop/boards/h ... y-dac-adc/
Another cheaper option:
https://www.adafruit.com/product/1085
I hope it should be possible to configure ADC in such a way that it would send signal to ALSA peppyalsa plugin:
https://github.com/project-owner/peppyalsa.doc/wiki
That plugin sends audio signal to a named pipe and Peppy Meter picks that signal up from the other end of the pipe.

Using that cheaper ADC version the system could look like this: ADC sends left channel signal over I2C to one Pi Zero connected to one HDMI LCD and another Pi Zero could handle the right channel with another HDMI LCD. This system could cost about $15+($5+$25)*2 = $75 if 3.5" HDMI LCD is in use ($25 on Amazon). I'm not sure if Pi can work as I2C receiver, it should be verified.

Some discussion about PeppyMeter and peppyalsa plugin can be found here:
https://www.diyaudio.com/forums/pc-base ... meter.html
https://www.diyaudio.com/forums/pc-base ... yzers.html

Best Regards

meanmeech
Posts: 5
Joined: Sun Jan 06, 2013 7:24 pm

Re: Peppy player

Thu Jan 16, 2020 8:54 am

Cheers for replying so promptly Peppy, you have largely confirmed the requirements for this potential project.

At the moment I still fact finding and also a little daunted as to whether or not I have the skill-set to pull this project this off.

The core parts have been ordered, IE HDMI displays, Pi4 and various over bits and bobs, so though this is overkill I'd rather that than upgrading.

The one issue which I was planing on navigating around is the fact that you can't run multiple sound-cards on a single pi? (Correct me if I'm wrong?) I posed this question to HifiBerry team, to which they replied -

"Hi,

Unfortunately, it's not possible to combine multiple sound cards on a single Pi.

Best regards,
Daniel"

This bump in the road initially buggered my plans as I require ADC for the TA vu module and DAC for the output. Then I got thinking, are all ADC all the same? And if this really does become a problem due to the I2c protocol the I'll either have to get a CODEC for a little extra logic or maybe having AES as the output will circumnavigate this? So my question is, have you tried a "Digipi+AES TOSLINK TCXO Digital Interface AES/EBU"?

Sorry, last point/questions.

Your Meter GUI, can you have 2?

Once again, thank you for your time. I plan of devouring your code in due course (no that I have a clue :shock: )

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Thu Jan 16, 2020 5:28 pm

Hi Daniel,

What's the size/resolution of the HDMI displays which you've ordered?

In all Peppy Player disk images which I distribute I use console mode for UI which is based on Raspbian Lite OS. It means that the player's UI is the only UI and there is no desktop UI. At the moment I don't know how to output two different UIs (for left and right channels) to two HDMI displays connected to Pi 4 using lite OS. This needs investigation.

Having two PeppyMeter UIs running on the same Pi can consume too much CPU. Therefore the idea with separate Pi Zero per channel looks very attractive as the main Pi will be off-loaded. Pi Zero is very cheap - $5 (version w/o Wi-Fi):
https://www.adafruit.com/product/2885?g ... gK81vD_BwE
and it has HDMI output. The only question - can Pi work as I2C receiver? That also needs investigation. If it can then the hardware looks pretty straightforward:
- Pi Zero listens for I2C signal and running PeppyMeter modified for I2C input (right now it has only named pipe input)
- HDMI display connected to Pi Zero

This can be pretty generic kit. So you could feed it with I2C data either from "main" Pi 4 or from ADC which can output I2C. You can connect such "channels" as many as you want. I2C supports many devices over the same line.

The overall system setup could look like this:
- Main Pi 4
- DAC or Digi or Amp on top of the main Pi
- Two "channel" kits connected to the main Pi through I2C. One kit includes one Pi Zero and one HDMI display.

LCD provides additional benefits - you can display Spectrum Analyzer in addition to VU Meter. I even thought about Peppy Player version with two or three LCDs ;) One could be used for main player UI and two others for VU Meter/Spectrum Analyzer.

I'm not sure I understand the issue which you described - using ADC and DAC together.

So two open questions are:
- How to output two different pictures to two HDMI displays connected to Pi 4 using Pygame library and Raspbian Lite OS. This actually is not required if the idea with I2C channels is in use.
- Can Pi work as I2C receiver? Posted question here: https://www.raspberrypi.org/forums/view ... 8#p1596548

Best regards

P.S. Cheaper versions of the same ADC can be found on Amazon and eBay:
https://www.amazon.com/s?k=ADC+I2C
https://www.ebay.com/sch/i.html?_nkw=ADC%20I2C

perl21
Posts: 4
Joined: Thu Jan 16, 2020 2:56 pm

Re: Peppy player

Wed Feb 12, 2020 6:38 pm

Hi.

Does the Peppy player also works with a Raspberry 4b board?
Thanks .

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Thu Feb 13, 2020 12:36 am

I didn't try it myself (still have several RPi 3), so I cannot say for sure but I don't see any reason why it would not work. If anybody tried please let me know. Thank you!

BenjaminF
Posts: 6
Joined: Fri Sep 27, 2013 9:59 am

Re: Peppy player

Thu Feb 13, 2020 7:36 am

Im currently running it on a 2GB RPi4. 3.5 inch Waveshare screen. No issues, apart from still trying to build a case which meets with approval at home... :oops:

perl21
Posts: 4
Joined: Thu Jan 16, 2020 2:56 pm

Re: Peppy player

Thu Feb 13, 2020 11:13 am

Hi,
i tried the 5 inch image cranach-waveshare.5.0 , with a Raspi 4 4GB
and a WaveShare Display 5inch HDMI LCD (B).
But the booting stops, and there are graphic errors ("moving Strips").
Any idea ?

User avatar
peppy.player
Posts: 245
Joined: Mon Mar 07, 2016 6:10 am

Re: Peppy player

Thu Feb 13, 2020 3:59 pm

Waveshare has several models of the 5" display. The disk image works with the model which looks like this:
https://images-na.ssl-images-amazon.com ... L1158_.jpg

If you have different model then you need to install the Headless disk image then install display driver on top of it.
Here is the procedure which I follow to create the disk image for 5" display. Just make sure that you use driver
for your display:

----------------------------- Install Headless image ---------------------------------------------

----------------------------- Configure display ---------------------------------------------

nano Peppy/config.txt
width = 800
height = 480
hdmi = True
headless = False

nano Peppy/screensaver/peppymeter/config.txt
screen.size = large

------------------------------------ Configure LCD -------------------------------------------------

sudo nano /boot/config.txt
add:
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1
disable_splash=1

wget https://www.waveshare.com/w/upload/3/34 ... 331.tar.gz
tar xzf LCD-show-180331.tar.gz
cd LCD-show/
chmod +x LCD5-show
./LCD5-show
reboots itself

------------------------------------------------------ Create the rules file ----------------------------------------------

sudo nano /etc/udev/rules.d/95-ads7846.rules
with content:
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="ADS7846 Touchscreen", SYMLINK+="input/touchscreen"
sudo reboot

------------------------------------------------------ Calibrate ----------------------------------------------

sudo apt-get install libts-bin
calibrate:
sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

------------------------------------------------------ Disable boot messages ----------------------------------------------

to disable boot messages:
sudo nano /boot/cmdline.txt
add fbcon=map:2

------------------------------------------------------ Add Splash screen ----------------------------------------------

sudo apt-get install fbi
wget https://raw.githubusercontent.com/proje ... sh.service
nano splash.service
change in splash.service /dev/fb1 to /dev/fb0
change splash.png -> splash-800.png
sudo mv splash.service /etc/systemd/system
sudo systemctl enable splash
sudo systemctl start splash

-------------------------------------------- Add code to start player on boot --------------------------------------------------

sudo nano /etc/rc.local
add:
su pi -c 'cd /home/pi/Peppy; openvt -s -- python3 peppy.py'

Hopefully it will help.
Last edited by peppy.player on Thu Feb 13, 2020 5:49 pm, edited 1 time in total.

perl21
Posts: 4
Joined: Thu Jan 16, 2020 2:56 pm

Re: Peppy player

Thu Feb 13, 2020 4:33 pm

Thank you for the help.
I will try it tonight.

Return to “Media centres”