SuperPlayer - The DSP_Engine (CamillaDSP) samplerate switching & ESP32 remote control

And as expected my build-attempts fails with your makekfile as well.


How have you configured your Rpi to make building work?

Yes... Raspbian OS

Plain install and this :

Code:
sudo apt install git bc bison flex libssl-dev make

And this :

Code:
pi@raspberrypi:~/Squeezelite_GIT/squeezelite $ sudo apt -y update && sudo apt -y install git libasound2-dev libflac-dev libmad0-dev libvorbis-dev libmpg123-dev libfaad-dev libsox-dev libsoxr-dev libavformat-dev liblirc-dev wiringpi

I also tried to install the opus stuff, but didn't success :p

The binary i compiled, did you try it on real pPC/SuperPlayer ???

Jesper.
 
I can build..! - I can build..! :D
Thanks Jesper..!

Yes... Raspbian OS

Plain install and this :

Code:
sudo apt install git bc bison flex libssl-dev make
bc bison flex libssl-dev was missing in my install.

Code:
pi@raspberrypi:~/Squeezelite_GIT/squeezelite $ sudo apt -y update && sudo apt -y install git libasound2-dev libflac-dev libmad0-dev libvorbis-dev libmpg123-dev libfaad-dev libsox-dev libsoxr-dev libavformat-dev liblirc-dev wiringpi
Noting missing here...

The binary i compiled, did you try it on real pPC/SuperPlayer ???
Oh-Yes... The real thing - with sample rate switching.

Only that I just noted that I now here some soft pops and snaps every 5-20 seconds, with all sample rates. Almost like an old LP. I must switch back to the old squeezelite-custom to check...
 
@wineds..!

Now I'm confused. Your version of squeezelite is identical with Jesper's. Meaning same version no: v1.9.7-1218. I had expected 1.9.7-1278..?

I just downloaded and installed the version I posted yesterday and I get this with help :

Squeezelite v1.9.7-1278, Copyright 2012-2015 Adrian Smith, 2015-2020 Ralph Irving. See -t for license terms
Usage: ./squeezelite-custom [options]


And here are the build options :

Build options: LINUX ALSA EVENTFD RESAMPLE VISEXPORT RPI DSD SSL NO_SSLSYM LINKALL
 
I have a buildt a version of squeezelite-custom a'la lykkedk, with all the same build options as the squeezelite from piCorePlayer (according to this page).
Code:
Build options: LINUX ALSA EVENTFD RESAMPLE FFMPEG OPUS VISEXPORT IR GPIO RPI DSD SSL NO_SSLSYM
It has the same sample rate switching feature for camilladsp as lykkedk's version.
It also works well with Jivelite, just as lykkedk's last version.

Jesper, you can use this version in your GitHub repo if you like.
 

Attachments

  • squeezelite-custom-v1.9.7-1278-pcp.zip
    77.6 KB · Views: 97
squeezelite-custom "2.0"

Or more specific: A variant of squeezelite with a new sleeker method for sample rate switching with CamillaDSP.
(This version is intended to be used with piCorePlayer on a Raspberry Pi - ARM CPU only...)

This is a product of member: audiac, who posted a pdf with 3 suggested approaches, and example code, to improve the method. - I decided to implement the first one.

There is one main difference with this method compared to the one lykkedk use:
- We only need one single python script to send commands to CamillaDSP, to load a new config file for a new sample rate, regardless of sample rate.
This means a more tidy setup that is easier to maintain, compared to lykkedk's method that need one python script per sample rate.

My main contribution is to put it all together, building and testing. The python script needed an update to work with the present version of CamillaDSP.

I have also tried to harmonize the nomenclature in variables, file names, etc. to what Henrik uses for CamillaDSP. This means that this version don't fit as a direct replacement in lykkedk's setup. I have migrated to a new setup in a parallel folder that don't interfere with lykkedk's. So if you want to try this, you don't need to ruin your present setup.

To test this you need to:

  • download and unzip squeezelite-custom_exec.zip attached below
  • create a new folder for the setup: /home/tc/camilladsp
    • save the file: update_config.py, into the new folder
    • run: chmod +x /home/tc/camilladsp/update_config.py
  • copy your config.yml files into a new sub-folder /home/tc/camilladsp/config
    • rename the config files like: 44100.yml, 96000.yml etc.
      (remove the prefix: "null_")
  • backup your present: squeezelite-custom, located in: /mnt/mmcblk0p2/tce/
    • replace it with the new squeezelite-custom
    • run: chmod +x /mnt/mmcblk0p2/tce/squeezelite-custom
  • backup your present file: /home/tc/CamillaDSP.sh
    • edit it and change line 23, to: OPTIONS="-p1234"
  • run: sudo filetool.sh -b
    (to permanently save your new files)
  • restart camilladsp and squeezelite
    (or reboot)
  • play some good music...
As an option to edit your file: /home/tc/CamillaDSP.sh, you can temporarily start camilladsp manually with a command like:
sudo /home/tc/camilladsp/camilladsp -p1234 -v /home/tc/camilladsp/config/44100.yml &
squeezelite must not run when camilladsp starts.

This version of squeezelite (v1.9.7-1278) is built with the same build options as the version from piCorePlayer. So, it should be "fully compatible"... :rolleyes: - but with Zero guaranties... :D
For more details, see the attached build-files.


And for Jesper: This is of course free for you to pick up to your GitHub if you like it. I hope you do...


Edit: I pikced a wrong file to the attached file squeezelite-custom-exex. Replaced with squeezelite-custom-exex2.zip
 

Attachments

  • squeezelite-custom_build-files.zip
    9 KB · Views: 139
  • squeezelite-custom-exex2.zip
    77.9 KB · Views: 139
Last edited:
pi r, audiac :)

I'am looking at the hack audiac did in the code ::

// Define path to sample rate switching script for CamillaDSP
#define CONFIG_CMD_PATH "/home/tc/camilladsp/update_config.py"

I see you Sweedish hacker's :D are way better coder's than myself!
Well, i think it would be really cool if we can make an option in squeezelite to give the configpath... E.g.
squeezelite -n testplayer -J /home/tc/DSP_Engine/newfilters
I will help if i can, but i think audiac are the guy which maybee can do this ???
Or perhaps another?

Jesper.
 
I liked the hard-coded path to the python script. I would like it to be more flexible, and was thinking in terms of a config file or a system variable. But using a command line option is really smart.
My C is terrible, but I'm good at copy-paste... :p I can have a look at it, but I guess it might be over my head.
 
Hi.

I have been looking in some of the pull req. over at the original squeezelite; plugging some of it out and tried to make some work :D
So far so good... I tried to build it with the new update_config.py stuff also btw...

I didn't do any more than making an option for -J for now :)

Without -J option ::
pi@raspberrypi:~/V2B/SuperPlayer-squeezelite $ ./squeezelite -n testbuild -o sound_out
sh: 1: /home/tc/camilladsp/update_config.py: not found
[15:54:35.980106] alsa_open:373 Could not set sample rate 44100

And with -J option at start::
pi@raspberrypi:~/V2B/SuperPlayer-squeezelite $ ./squeezelite -J -n testbuild -o sound_out
SuperPlayer test if squeezelite -J works

sh: 1: /home/tc/camilladsp/update_config.py: not found
[15:54:43.156932] alsa_open:373 Could not set sample rate 44100

Build options now shows:
LINUX ALSA EVENTFD RESAMPLE FFMPEG VISEXPORT IR SPLAYER GPIO RPI DSD NO_SSLSYM

Nevermind the error's, this machine i am using for build is not setup for camilladsp/squeezelite combo!

I created a new branch, to switch to it, do as follows:
git clone GitHub - Lykkedk/SuperPlayer-squeezelite: Lightweight headless squeezebox player for Logitech Media Server
cd SuperPlayer-squeezelite
git checkout V2B_SuperPlayer-squeezelite

I removed the -OPUS option, because i cannot build with that right now :)

What we need now is to have the code to execute audioac's and pi r's code only when giving the option -J /path/to/directory_where_config_is...
Otherwise start squeezelite without the hack... could be cool if we could make that work!

Jesper.