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

Fra8123 !

The camilladsp & squeezelite are not started before the start script is executed.

Snip from my instructions ::
When edited to your'e setup try to restart the samplerate control setup like this ::

c@TestRig:~$ camilladsp-config.sh -n example

- Setting CamillaDSP configuration to: example

- Creates or updates symbolic links in folder: /home/tc/camilladsp
44100.yml -> example/44100.yml
48000.yml -> example/48000.yml
88200.yml -> example/88200.yml
96000.yml -> example/96000.yml

Sending signal to CamillaDSP to apply configuration: example

Can you perhaps try to execute the script?
First (You must be in /home/tc/camilladsp folder) ::
Code:
camilladsp-config.sh example
And paste taht output here...

After that paste output of the start script ::
Code:
sudo /usr/local/bin/squeezelite-cdsp.sh start

Jesper.
 
Hi Jesper,


Please find below the outputs:


tc@piCorePlayer:~$ cat /opt/.filetool.lst
opt
home
etc/asound.conf
etc/group
etc/gshadow
etc/httpd.conf
etc/passwd
etc/shadow
usr/local/etc/pointercal
usr/local/etc/ssh/ssh_host_dsa_key
usr/local/etc/ssh/ssh_host_dsa_key.pub
usr/local/etc/ssh/ssh_host_ecdsa_key
usr/local/etc/ssh/ssh_host_ecdsa_key.pub
usr/local/etc/ssh/ssh_host_ed25519_key
usr/local/etc/ssh/ssh_host_ed25519_key.pub
usr/local/etc/ssh/ssh_host_rsa_key
usr/local/etc/ssh/ssh_host_rsa_key.pub
usr/local/etc/init.d/pcp_startup.sh
usr/local/etc/pcp
var/lib/alsa/asound.state
var/spool/cron/crontabs
usr/local/lib/python3.6/site-packages




tc@piCorePlayer:~$ camilladsp-config.sh -n example

- Setting CamillaDSP configuration to: example

- Creates or updates symbolic links in folder: /home/tc/camilladsp
44100.yml -> example/44100.yml
48000.yml -> example/48000.yml
88200.yml -> example/88200.yml
96000.yml -> example/96000.yml

CamillaDSP is not running. This config will be used next time CamillaDSP start.

tc@piCorePlayer:~$ sudo /usr/local/bin/squeezelite-cdsp.sh start
+ Starting Squeezelite player and CamillaDSP...
Squeezelite is already started by pCP.


Once again, I did all the steps in the guide, with the same order. If something is missing in the guide I missed it.


Thank you,
Francesco
 
Hey hey hey :)

I forgot to mention in my guide, that ::

Both squeezelite and CamillaDSP must be started by my script: /opt/camilladsp/cdsp-squeezelite.sh
And: pCP must be configured NOT to start squeezelite on boot.

It's only said in pi r's explanation on the setup... Sry...

Please when you reboot the PI, execute

2 times kill to be sure ::
Code:
sudo killall squeezelite
sudo killall squeezelite

Then start the starter-script
Code:
sudo /usr/local/bin/squeezelite-cdsp.sh start

If it's working, find in pCP webinterface a place where you disable squeezelite at boot.

Also please look here ::
SuperPlayer - The DSP_Engine (CamillaDSP) samplerate switching & ESP32 remote control

Jesper.
 
Hi Jesper,


Here you are:


tc@piCorePlayer:~$ sudo killall squeezelite
killall: squeezelite: no process killed
tc@piCorePlayer:~$ sudo killall squeezelite
killall: squeezelite: no process killed
tc@piCorePlayer:~$


It does not look to be the right solution :confused:


I do not have any skill of software programming. So I can just follow the instruction, but if the instruction skips the step, as a dummy I will skip the step.


I will keep monitoring the guide, hopefully you will have the time to amend the procedure. Hopefully in the near future CamillaDSP can be introduced in pCP as simple plugin. In Moode Player it will be introduced soon :D.



Thank you so much in any case. Your help is a lot appreciated.
 
We try one more...

Never give up :D

I think this could be the case ::
Try to execute ::
Code:
sudo rm /var/run/squeezelite.pid
It look's like the script thinks squeezelite is running, when it's not! Maybe it's the thing...
I think you can start the script after removing this .pid file (if it's exist, i think it does :))

Disable the squeezelite at boot... Then reboot the PI. (See attached picture)
Code:
sudo filetool.sh -b && reboot

Then goto /home/tc/camilladsp
Execute ::
Code:
camilladsp-config.sh example

And ::
Code:
sudo /usr/local/bin/squeezelite-cdsp.sh start

Jesper.
 

Attachments

  • Screenshot from 2021-01-25 19-11-15.png
    Screenshot from 2021-01-25 19-11-15.png
    39 KB · Views: 108
Member
Joined 2002
Paid Member
To check for pCP squeezelite status:
Code:
$ sudo /usr/local/etc/init.d/squeezelite status

To stop pCP squeezelite:
Code:
$ sudo /usr/local/etc/init.d/squeezelite stop

In development situations where the squeezelite process and the PID file get out of sync use:
Code:
$ sudo /usr/local/etc/init.d/squeezelite force

This should kill the squeezelite process and tidy up the PID files.

Usually you don't need these but sometimes when testing things they are necessary.

Disabling squeezelite and rebooting through the pCP GUI will avoid this situation.

To do a backup and reboot, this is easier:
Code:
$ pcp br
 
Dear All,


Unfortunately still not good news.


Please find below the output:


tc@piCorePlayer:~$ sudo rm /var/run/squeezelite.pid
tc@piCorePlayer:~$ sudo filetool.sh -b && reboot
Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz\
Done.
reboot: Operation not permitted
tc@piCorePlayer:~$ $ sudo /usr/local/etc/init.d/squeezelite force
-sh: $: not found
tc@piCorePlayer:~$ sudo /usr/local/etc/init.d/squeezelite force
Forcing a restart of Squeezelite...
Killed
tc@piCorePlayer:~$ pcp br
[ INFO ] Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz|
Done.
[ OK ] Backup successful.
[ WARN ] Your backup is a little large - 4919375 bytes.
[ INFO ] Be careful adding large files to /home/tc.
[ INFO ] If your backup takes a long time, piCorePlayer may fail to start properly.

-----------------------------------------------------------------------------------------------

tc@piCorePlayer:~$ cd /home/tc/camilladsp
tc@piCorePlayer:~/camilladsp$ camilladsp-config.sh example

- Setting CamillaDSP configuration to: example

- Creates or updates symbolic links in folder: /home/tc/camilladsp
44100.yml -> example/44100.yml
48000.yml -> example/48000.yml
88200.yml -> example/88200.yml
96000.yml -> example/96000.yml

CamillaDSP is not running. This config will be used next time CamillaDSP start.

Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz\
Done.
tc@piCorePlayer:~/camilladsp$ sudo /usr/local/bin/squeezelite-cdsp.sh start
+ Starting Squeezelite player and CamillaDSP...
+ Starting daemon /usr/local/bin/samplerate-daemon.py
ERROR - Could not start /usr/local/bin/camilladsp.


Cheers!!
 
Member
Joined 2002
Paid Member
Do you btw, working on some kind of camilladsp integration into pCP Greg?

Jesper.

I am keeping an eye on your threads, reading your GitHub instructions, but I think this quote really applies to me:

"Remember it's kind of complicated stuff, and somethings are hard to explain & understand."

I can read as much as I like, but my brain doesn't understand things until I do it hands on. I have been playing with sox to do resampling and apply various filters in the last few weeks, so I think I am making progress. Hopefully the light will switch on and I'll start understand the concept DSP. ;)
 
Dear All,


Unfortunately still not good news.


Please find below the output:


tc@piCorePlayer:~$ sudo rm /var/run/squeezelite.pid
tc@piCorePlayer:~$ sudo filetool.sh -b && reboot
Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz\
Done.
reboot: Operation not permitted
tc@piCorePlayer:~$ $ sudo /usr/local/etc/init.d/squeezelite force
-sh: $: not found
tc@piCorePlayer:~$ sudo /usr/local/etc/init.d/squeezelite force
Forcing a restart of Squeezelite...
Killed
tc@piCorePlayer:~$ pcp br
[ INFO ] Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz|
Done.
[ OK ] Backup successful.
[ WARN ] Your backup is a little large - 4919375 bytes.
[ INFO ] Be careful adding large files to /home/tc.
[ INFO ] If your backup takes a long time, piCorePlayer may fail to start properly.

-----------------------------------------------------------------------------------------------

tc@piCorePlayer:~$ cd /home/tc/camilladsp
tc@piCorePlayer:~/camilladsp$ camilladsp-config.sh example

- Setting CamillaDSP configuration to: example

- Creates or updates symbolic links in folder: /home/tc/camilladsp
44100.yml -> example/44100.yml
48000.yml -> example/48000.yml
88200.yml -> example/88200.yml
96000.yml -> example/96000.yml

CamillaDSP is not running. This config will be used next time CamillaDSP start.

Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz\
Done.
tc@piCorePlayer:~/camilladsp$ sudo /usr/local/bin/squeezelite-cdsp.sh start
+ Starting Squeezelite player and CamillaDSP...
+ Starting daemon /usr/local/bin/samplerate-daemon.py
ERROR - Could not start /usr/local/bin/camilladsp.


Cheers!!

Okay... here we go again guy's :p

Can you look at the example files ?
E.G::

Code:
cat /home/tc/camilladsp/44100.yml

At the top look for ::

capture:
type: File
channels: 2
filename: /dev/stdin
format: S32LE
playback:
type: Alsa
channels: 2
device: "hw:0,0"
format: S32LE

We have to make sure your'e dac support S32LE, or S16LE or whatever you use here!
It looks like camilladsp is not started now.
Is it possible that the fault is there?

Jesper.
 
Greg :D

You say
I can read as much as I like, but my brain doesn't understand things until I do it hands on. I have been playing with sox to do resampling and apply various filters in the last few weeks, so I think I am making progress. Hopefully the light will switch on and I'll start understand the concept DSP.

I see we are much alike... my switch is sometimes slow to engage :)

Jesper.
 
Another thing...

This is much fun to make this Bluetooth LE remote...
It's in real world test phase now :eek:

It can do the following now ::

* Play/Pause toggle (Commands send directly to LMS)
* Volume (Either LMS or Camilladsp)
* Display volume on 4 x 7 segment display
* Display "SLEP" -- I now i now SLEP = Sleep :D on display when ESP32 is in "deep sleep mode"

I dropped using the RPI as Bluetooth reciever, as it's not working very good when placed inside a metal/alu' chassis like in mine DAC... The range goes very low, say less than 2 meters like that... NoGo!... So i used another ESP32 as reciever insted; this reciever sends through usb/serial to the RPI, and is catched by a python script, which also handles the display on the 7 segments led's...

The display is on the reciever part... It's possible to have this on the remote too, but duo to batteriuse we have to make some switch or like to cut off when not used... I find it much better on reciever end, always on and supplied from my PI in my DAC.

Jesper..
 

Attachments

  • IMG_8100.jpg
    IMG_8100.jpg
    713.2 KB · Views: 120
  • IMG_8101.jpg
    IMG_8101.jpg
    583.2 KB · Views: 133
  • IMG_8102.jpg
    IMG_8102.jpg
    616.6 KB · Views: 132
  • IMG_8104.jpg
    IMG_8104.jpg
    551.3 KB · Views: 134
  • IMG_8105.jpg
    IMG_8105.jpg
    484.7 KB · Views: 114
  • IMG_8097.jpg
    IMG_8097.jpg
    659.5 KB · Views: 64
  • IMG_8098.jpg
    IMG_8098.jpg
    858.7 KB · Views: 70
Last edited:
Okay... here we go again guy's :p

Can you look at the example files ?
E.G::

Code:
cat /home/tc/camilladsp/44100.yml
At the top look for ::

capture:
type: File
channels: 2
filename: /dev/stdin
format: S32LE
playback:
type: Alsa
channels: 2
device: "hw:0,0"
format: S32LE

We have to make sure your'e dac support S32LE, or S16LE or whatever you use here!
It looks like camilladsp is not started now.
Is it possible that the fault is there?

Jesper.




Hi Jesper,


I have a khadas tone board, as far as I know it can handle 32 bits. However it was working with the SP ver.1.



If you think it can be helpful for the test, I can try to reinstall pCP one more time, but just if you can amend the guide with the all steps in the correct order, as I did three times so far without any success.


Not sure if it is important, I have a RPI 4 with 2 GB of RAM.


Thank you so much.
 
Hi...

I will eventually rewrite my "howto", but let's try to start camilladsp on youre setup without anything else ::

Code:
sudo squeezelite-cdsp.sh stop
Gives me the output ::
Code:
  CamillaDSP is stopped.
  Squeezelite is stopped.
  samplerate-daemon.py is stopped.

Then execute ::
Code:
/usr/local/bin/camilladsp /home/tc/camilladsp/44100.yml -vv -p 1234
Gives me the output ::
Code:
2021-01-28 17:26:47.708 DEBUG camilladsp - Read config file Some("/home/tc/camilladsp/44100.yml")
2021-01-28 17:26:47.710 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 17:26:47.710 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 17:26:47.710 DEBUG camilladsp - Config is valid
2021-01-28 17:26:47.710 DEBUG camillalib::socketserver - Start websocket server on 127.0.0.1:1234
2021-01-28 17:26:47.710 DEBUG camilladsp - Wait for config
2021-01-28 17:26:47.710 DEBUG camilladsp - Config ready
2021-01-28 17:26:47.711 DEBUG camillalib::filters - Build new pipeline
2021-01-28 17:26:47.711 DEBUG camillalib::filters - Build from config
2021-01-28 17:26:47.711 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 17:26:47.711 DEBUG camillalib::filters - Build from config
2021-01-28 17:26:47.711 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 17:26:47.711 DEBUG camillalib::processing - build filters, waiting to start processing loop
2021-01-28 17:26:47.712 DEBUG camilladsp - Capture thread ready to start
2021-01-28 17:26:47.863 DEBUG camillalib::alsadevice - Opening audio device "hw:0,0" with parameters: HwParams { channels: Ok(2), rate: "Ok(44100) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(1024) frames", buffer_size: "Ok(8192) frames" }, SwParams(avail_min: Ok(1024) frames, start_threshold: Ok(3072) frames, stop_threshold: Ok(8192) frames)
2021-01-28 17:26:47.863 DEBUG camillalib::alsadevice - Audio device "hw:0,0" successfully opened
2021-01-28 17:26:47.863 DEBUG camilladsp - Playback thread ready to start
2021-01-28 17:26:47.863 DEBUG camilladsp - Both capture and playback ready, release barrier
2021-01-28 17:26:47.864 DEBUG camillalib::filedevice - starting captureloop
2021-01-28 17:26:47.864 DEBUG camillalib::filedevice - starting captureloop
2021-01-28 17:26:47.864 DEBUG camillalib::alsadevice - Starting playback loop
Etc...
Etc..
Etc.
--
-

This way we hunt, if camilladsp will run on your'e setup.

Jesper.
 
Hi Jesper,


Please find the output:


tc@piCorePlayer:~$ sudo squeezelite-cdsp.sh stop

CamillaDSP was not running.
Squeezelite was not running.
samplerate-daemon.py was not running.

tc@piCorePlayer:~$ ^C
tc@piCorePlayer:~$ /usr/local/bin/camilladsp /home/tc/camilladsp/44100.yml -vv -p 1234
2021-01-28 18:44:25.776 DEBUG camilladsp - Read config file Some("/home/tc/camilladsp/44100.yml")
2021-01-28 18:44:25.798 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 18:44:25.798 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 18:44:25.798 DEBUG camilladsp - Config is valid
2021-01-28 18:44:25.798 DEBUG camillalib::socketserver - Start websocket server on 127.0.0.1:1234
2021-01-28 18:44:25.799 DEBUG camilladsp - Wait for config
2021-01-28 18:44:25.799 DEBUG camilladsp - Config ready
2021-01-28 18:44:25.799 DEBUG camillalib::filters - Build new pipeline
2021-01-28 18:44:25.799 DEBUG camillalib::filters - Build from config
2021-01-28 18:44:25.799 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 18:44:25.799 DEBUG camillalib::filters - Build from config
2021-01-28 18:44:25.799 DEBUG camillalib::biquad - a1=-1.9806297 a2=0.98072064 b0=0.5031917 b1=-0.9926435 b2=0.48954293
2021-01-28 18:44:25.799 DEBUG camillalib::processing - build filters, waiting to start processing loop
2021-01-28 18:44:25.800 DEBUG camilladsp - Capture thread ready to start
2021-01-28 18:44:25.802 ERROR camilladsp - Playback error: ALSA function 'snd_pcm_hw_params_set_format' failed with error 'EINVAL: Invalid argument'
2021-01-28 18:44:25.802 DEBUG camilladsp - Error while starting, release barrier
2021-01-28 18:44:25.802 DEBUG camilladsp - Wait for capture thread to exit..
2021-01-28 18:44:25.802 DEBUG camillalib::filedevice - starting captureloop
2021-01-28 18:44:25.802 DEBUG camillalib::filedevice - starting captureloop
2021-01-28 18:44:25.802 DEBUG camillalib::filedevice - Exit message received, sending EndOfStream
2021-01-28 18:44:25.802 TRACE camillalib::processing - AudioMessage::EndOfStream received
2021-01-28 18:44:25.802 DEBUG camilladsp - Restarting with new config
2021-01-28 18:44:25.802 DEBUG camilladsp - Wait for config
2021-01-28 18:44:25.802 DEBUG camilladsp - No config and not in wait mode, exiting!
tc@piCorePlayer:~$


Cheers!!
 
Hi...

It seem's like problem is here ::
Code:
2021-01-28 18:44:25.802 ERROR camilladsp - Playback error: ALSA function 'snd_pcm_hw_params_set_format' failed with error 'EINVAL: Invalid argument'
2021-01-28 18:44:25.802 DEBUG camilladsp - Error while starting, release barrier

I got this output ::
Code:
2021-01-28 19:18:39.371 DEBUG camillalib::alsadevice - Opening audio device "hw:0,0" with parameters: HwParams { channels: Ok(2), rate: "Ok(44100) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(1024) frames", buffer_size: "Ok(8192) frames" }, SwParams(avail_min: Ok(1024) frames, start_threshold: Ok(3072) frames, stop_threshold: Ok(8192) frames)
2021-01-28 19:18:39.371 DEBUG camillalib::alsadevice - Audio device "hw:0,0" successfully opened
2021-01-28 19:18:39.371 DEBUG camilladsp - Playback thread ready to start
2021-01-28 19:18:39.371 DEBUG camilladsp - Both capture and playback ready, release barrier
2021-01-28 19:18:39.371 DEBUG camillalib::alsadevice - Starting playback loop
2021-01-28 19:18:39.371 DEBUG camillalib::filedevice - starting captureloop
2021-01-28 19:18:39.372 DEBUG camillalib::filedevice - starting captureloop

Will investigat some more :)
But sure we have a problem with your'e HW somewhere!

Jesper.