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

Fra...

Let's listning to pi r, and try this ::

Try to comment (#) out the line in /opt/bootlocal.sh (StartServer.sh) and save & reboot, to see if this makes a difference???

Then see if the player start's, (camilladsp & squeezelite) and if it's working?

Code:
#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.log
#pCPstop------

[B][COLOR="Red"]#/home/tc/StartServer.sh[/COLOR][/B]
sudo /usr/local/bin/squeezelite-cdsp.sh start &

Jesper.
 
pi r, Btw::

(By the way, the trailng "&" should not be needed for "squeezelite-cdsp.sh", and can be removed)

Can confirm it's working without "&"...

My "working" /opt/bootlocal.sh :: (Don't mind other stuff)

Code:
tc@TestRig:~$ cat /opt/bootlocal.sh
#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.log
#pCPstop------

/home/tc/StartServer.sh
sudo /usr/local/bin/squeezelite-cdsp.sh start
sudo /home/tc/SuperPlayer-daemon.sh start &

Jesper.
 
@ Jesper:
I think there is something fishy about the /home/tc/StartServer.sh script. When Fra8123 runs it manually, it doesn't finish and return to prompt. It waits for "CTRL+C to quit". That will cause a problem when the script runs on boot (form bootlocal.sh).
But - the script shouldn't act like that with a command ending with a "&" like you do (from your GitHub):
Code:
#!/bin/sh
# Script to start the CamillaDSP server  192.168.1.XX:5000 (with correct IP address)

su tc -c "/usr/local/bin/python3 /mnt/mmcblk0p2/tce/Camilla_Extensions/camillagui/main.py" &

exit
I haven't installed or tested this myself, and my only gess is that it is the "su" command that don't work with a trailing "&".
Maybe it works if you add a trailing "&" in /opt/bootlocal.sh?
Code:
#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.log
#pCPstop------
[COLOR=DarkRed]
/home/tc/StartServer.sh &[/COLOR]
 sudo /usr/local/bin/squeezelite-cdsp.sh start &
(By the way, the trailng "&" should not be needed for "squeezelite-cdsp.sh", and can be removed)


/ πr


Good morning Jesper,


I did what you suggested:


#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.log
#pCPstop------

#/home/tc/StartServer.sh
sudo /usr/local/bin/squeezelite-cdsp.sh start &
--------------------------------------------------------------------


I have saved and rebooted.


Please find the output:
tc@piCorePlayer:~$ ps aux | grep main.py
8520 tc 0:00 grep main.py


The webinterface is not working. It looks like the file bootlocal.sh setup is "bypassed" and not taken in account. Maybe the installation did not go well:confused:?
 
.../
The webinterface is not working. It looks like the file bootlocal.sh setup is "bypassed" and not taken in account. Maybe the installation did not go well:confused:?


That is as expected with the change you made in bootlocal.sh. The change disables the start of the web interface. Jesper forgot to mention that this change might result in a working squeezelite/camilladsp after boot.
So did it..?

/ πr
 
@ Jesper:
A script like the "startserver.sh" that I got from your GitHub "SuperPlayer-v3.0" and posted yesterday, doen't work properly if you don't run it as user root or with sudo. For non root users, the su command in the script will stop and ask for password to the tc user.

I believe the bootlocal.sh is run by user tc, and could be the reason it doesn't work. Question is why it works for you, and not for Fra8123..?

What is the content of your startserver.sh, Jesper & Fra8123?
Code:
cat /home/tc/StartServer.sh
 
Hi Jesper, Pi R,


I know nothing but I think you are right. At the end of the day the autoboot did not work, also with the SP v 1.0.


Please find below the outputs:


tc@piCorePlayer:~$ sudo /usr/local/bin/squeezelite-cdsp.sh status

Squeezelite player and CamillaDSP is not running.

tc@piCorePlayer:~$ cat /home/tc/StartServer.sh
#!/bin/sh
# Script to start the CamillaDSP server 192.168.1.XX:5000 (with correct IP address)

su tc -c "/usr/local/bin/python3 /mnt/mmcblk0p2/tce/Camilla_Extensions/camillagui/main.py" &

exit
tc@piCorePlayer:~$

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


My IP address is 192.168.2.....:5000. I do not know if it is an important things.


At this point I think you are getting close to find the issue, stay strong guys;). From my side I can just doing what you will tell me to do it.


So thanks for the support and interest!!!!
 
Hey you... & pi r, glad you join here :)

The bootlocal doesen't seem's to be running at all on youre install; for us to be sure of this can you try to apply some lines, so it will look like this (remember to save & reboot)
When rebootet, please paste here the output of
Code:
ls -all /home/tc

Let it look excatly as this (/opt/bootlocal.sh) ::

Code:
#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.log
#pCPstop------

[B]touch /home/tc/DEBUG_1
sleep 1[/B]
/home/tc/StartServer.sh
[B]touch /home/tc/DEBUG_2
sleep 1[/B]
sudo /usr/local/bin/squeezelite-cdsp.sh start &
[B]touch /home/tc/DEBUG_3
sleep 1[/B]

Jesper.
 
Hi Jesper,


As you said I edited the bootlocal.sh



#!/bin/sh
# put other system startup commands here

GREEN="$(echo -e '\033[1;32m')"

echo
echo "${GREEN}Running bootlocal.sh..."
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$
#pCPstop------

touch /home/tc/DEBUG_1
sleep 1
/home/tc/StartServer.sh
touch /home/tc/DEBUG_2
sleep 1
sudo /usr/local/bin/squeezelite-cdsp.sh start &
touch /home/tc/DEBUG_3
sleep 1


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


Output:


tc@piCorePlayer:~$ ls -all /home/tc
total 48
drwxr-xr-x 7 tc staff 320 Jan 1 1970 ./
drwxr-xr-x 3 tc staff 60 Jan 1 1970 ../
drwxr-xr-x 2 tc staff 40 Jun 6 2020 .X.d/
-rw-r--r-- 1 tc staff 114 Jun 6 2020 .alsaequal.presets
-rw-rw-r-- 1 tc staff 8896 Jan 30 16:26 .ash_history
-rw-r--r-- 1 tc staff 1016 Jun 6 2020 .ashrc
drwxr-s--- 3 tc staff 60 Jan 6 2017 .local/
-rw-rw-r-- 1 tc staff 920 Jun 9 2019 .profile
-rw-r--r-- 1 tc staff 2061 Jan 20 20:39 CDSP-install-v1.0.zip
-rwxr-xr-x 1 tc staff 195 Jan 26 20:00 StartServer.sh
drwxrwxrwx 2 tc staff 60 Jan 1 1970 SuperPlayer-Extensions-CDSP-install-v1.0/
drwxrwxrwx 2 tc staff 60 Jan 1 1970 SuperPlayer-cdsp-samplerate-control-1.0/
drwxr-xr-x 5 tc staff 180 Jan 1 1970 camilladsp/
-rwxr-xr-x 1 tc staff 2135 Jun 6 2020 pcp-powerbutton.sh
-rwxr-xr-x 1 tc staff 713 Jun 6 2020 powerscript.sh
-rw-r--r-- 1 tc staff 7366 Jan 21 14:00 v1.0.zip
tc@piCorePlayer:~$


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


Cheers!!!!!!!!!!1
 
Strange...

When i do the same, the output in /home/tc is like this ::

tc@TestRig:~$ ls -all /home/tc
total 88
drwxr-xr-x 6 tc staff 520 Jan 30 16:32 ./
drwxr-xr-x 3 tc staff 60 Jan 1 1970 ../
drwxr-xr-x 2 tc staff 40 Jun 6 2020 .X.d/
-rw-r--r-- 1 tc staff 114 Jun 6 2020 .alsaequal.presets
-rw------- 1 tc staff 9833 Jan 30 16:32 .ash_history
-rw-r--r-- 1 tc staff 1016 Jun 6 2020 .ashrc
drwxr-s--- 3 tc staff 60 Jan 6 2017 .local/
-rw-rw-r-- 1 tc staff 920 Jun 9 2019 .profile
-rw-r--r-- 1 tc staff 3938 Jan 19 19:05 19012021_SuperPlayer-Controller.py
-rw-r--r-- 1 tc staff 4702 Jan 19 19:09 19012021_SuperPlayer-daemon.sh
-rw-r--r-- 1 tc staff 2061 Dec 23 07:55 CDSP-install-v1.0.zip
-rw-r--r-- 1 root root 0 Jan 30 16:32 DEBUG_1
-rw-r--r-- 1 root root 0 Jan 30 16:32 DEBUG_2
-rw-r--r-- 1 root root 0 Jan 30 16:32 DEBUG_3

-rw-r--r-- 1 tc staff 4736 Dec 29 21:52 RPI_BUILDIN_BLE_SuperPlayer-daemon.sh
-rw-r--r-- 1 tc staff 4281 Dec 28 09:00 RPI_buildin_BLE_SuperPlayer-Controller.py
-rwxr-xr-x 1 tc staff 195 Jan 29 20:02 StartServer.sh
-rw-r--r-- 1 tc staff 5305 Jan 29 18:58 SuperPlayer-Controller.py
drwxrwxrwx 2 tc staff 60 Jan 1 1970 SuperPlayer-Extensions-CDSP-install-v1.0/
-rwxr-xr-x 1 tc staff 2613 Jan 29 17:51 SuperPlayer-daemon.sh
-rw-r--r-- 1 tc staff 0 Jan 1 1970 battery.txt
-rw-r--r-- 1 tc staff 2 Jan 1 1970 bootcount.txt
drwxr-xr-x 6 tc staff 220 Jan 1 1970 camilladsp/
-rwxr-xr-x 1 tc staff 2135 Jun 6 2020 pcp-powerbutton.sh
-rwxr-xr-x 1 tc staff 713 Jun 6 2020 powerscript.sh
-rw-r--r-- 1 tc staff 27 Dec 29 21:16 scanner.txt

For us neerd's we also see, that bootlocal.sh is executed as user "root"

So Fra.

For some reason the /opt/bootlocal.sh isen't executed when your'e PI is booted.
I really must think now, as i never tried that before, and i also think it has nothing to do with the cdsp install (SuperPlayer)

Jesper.
 
Wait a minute...

Let's add some more DEBUG in the file!

After save & reboot show output of
Code:
ls -all /home/tc

Edit the file to include this too ::

#!/bin/sh
# put other system startup commands here
touch /home/tc/DEBUG_A
sleep 1

GREEN="$(echo -e '\033[1;32m')"
touch /home/tc/DEBUG_B
sleep 1

echo
echo "${GREEN}Running bootlocal.sh..."
touch /home/tc/DEBUG_C
sleep 1

#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$
#pCPstop------
touch /home/tc/DEBUG_D
sleep 1


touch /home/tc/DEBUG_1
sleep 1
/home/tc/StartServer.sh
touch /home/tc/DEBUG_2
sleep 1
sudo /usr/local/bin/squeezelite-cdsp.sh start &
touch /home/tc/DEBUG_3
sleep 1
 
@ Fra8123


Please post result of:
Code:
ls -al /opt
Ans a tip when writing posts:
To create a textbox like the one above, that maintains the format of the included text, use the "hash-button" # in the tool-bar, and paste your text in between the two
Code:
 tags.
(you need to use the "Go Advanced" button below, to get the full tool-bar)

/ [FONT=Arial]πr[/FONT]
 
Hi Pi R,


Many thanks for the tip, let's see if I fully got it.


Code:
fitness for a particular purpose, or non-infringement.
tc@piCorePlayer:~$ ls -all /home/tc
total 48
drwxr-xr-x    7 tc       staff          380 Jan  1  1970 ./
drwxr-xr-x    3 tc       staff           60 Jan  1  1970 ../
drwxr-xr-x    2 tc       staff           40 Jun  6  2020 .X.d/
-rw-r--r--    1 tc       staff          114 Jun  6  2020 .alsaequal.presets
-rw-rw-r--    1 tc       staff         8971 Jan 30 18:36 .ash_history
-rw-r--r--    1 tc       staff         1016 Jun  6  2020 .ashrc
drwxr-s---    3 tc       staff           60 Jan  6  2017 .local/
-rw-rw-r--    1 tc       staff          920 Jun  9  2019 .profile
-rw-r--r--    1 tc       staff         2061 Jan 20 20:39 CDSP-install-v1.0.zip
-rw-r--r--    1 root     root             0 Jan  1  1970 DEBUG_A
-rw-r--r--    1 root     root             0 Jan  1  1970 DEBUG_B
-rw-r--r--    1 root     root             0 Jan  1  1970 DEBUG_C
-rwxr-xr-x    1 tc       staff          195 Jan 26 20:00 StartServer.sh
drwxrwxrwx    2 tc       staff           60 Jan  1  1970 SuperPlayer-Extensions-CDSP-install-v1.0/
drwxrwxrwx    2 tc       staff           60 Jan  1  1970 SuperPlayer-cdsp-samplerate-control-1.0/
drwxr-xr-x    5 tc       staff          180 Jan  1  1970 camilladsp/
-rwxr-xr-x    1 tc       staff         2135 Jun  6  2020 pcp-powerbutton.sh
-rwxr-xr-x    1 tc       staff          713 Jun  6  2020 powerscript.sh
-rw-r--r--    1 tc       staff         7366 Jan 21 14:00 v1.0.zip
tc@piCorePlayer:~$


Next output:


Code:
tc@piCorePlayer:~$ ls -al /opt
total 24
drwxr-sr-x    2 root     staff          160 Jan  1  1970 ./
drwxrwxr-x   17 tc       staff          360 Jan  1  1970 ../
-rw-rw-r--    1 root     staff          559 Jan 30 18:35 .filetool.lst
-rwxrwxr-x    1 root     staff          145 Jun  9  2019 .xfiletool.lst
-rwxrwxr-x    1 root     staff          522 Jan 30 18:35 bootlocal.sh
-rwxrwxr-x    1 root     staff          802 Jun  6  2020 bootsync.sh
-rwxrwxr-x    1 root     root           613 Feb 25  2020 shutdown.sh
-rw-rw-r--    1 root     staff           36 Jan  1  1970 tcemirror


Cheers!
 
Well done, Fra8123..!
Nice looking post, and easier to read too... :up:

I wanted to see the properties of the files, and all looks correct.

For some reason the bootlocal.sh script doesn't seem to execute (shown by the result of Jesper's test instructions), and I have no idea of why. Something in your system has probably got corrupted at some point, and it can be a tough challenge to figure out what, and how to fix it. And it might even be more problems that not has shown yet.

Maybe the fastest and easiest way is to start all over, and make a new installation beginning with a fresh SD-card image.


/ πr
 
Cool... good Fra.

We never get by this in bootlocal.sh ::

#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$
#pCPstop------

The DEBUG_D is not written in the /home/tc dir :att'n:... So bootlocal.sh are stopped in this process ::
Code:
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$

My advise is that you download a new image of pCP 6.10 and install from scratch.
Then apply the DEBUG_A ---> DEBUG_D lines before installing my SuperPlayer to see if it's working...

Jesper.
 
Hi Guys,


No problem to reinstall from the scratch. However this will be the forth time, and always had the same issue (without considering the attempt with the super player 1.0 and 2.0).



I suggest to amend the guide first, otherwise it will be 100% the same. With the amended guide we will be sure I followed all the steps correctly.



@Jasper, I am not sure I understood the instruction "Then apply the DEBUG_A ---> DEBUG_D lines before installing my SuperPlayer to see if it's working...".


Waiting for the amended instructions.
 
Hey...

Like this ::

#!/bin/sh
# put other system startup commands here
touch /home/tc/DEBUG_A
sleep 1
GREEN="$(echo -e '\033[1;32m')"
touch /home/tc/DEBUG_B
sleep 1
echo
echo "${GREEN}Running bootlocal.sh..."
touch /home/tc/DEBUG_C
sleep 1
#pCPstart------
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$
#pCPstop------
touch /home/tc/DEBUG_D
sleep 1

And then try with new install if the bootlocal.sh are working.
E.G. When done installing, apply the DEBUG_A ---> DEBUG_D lines save and reboot, then paste output from ~home E.G.
Code:
 ls -all /home/tc

This way we can see if this first step is working!

Jesper.
 
.../
The DEBUG_D is not written in the /home/tc dir :att'n:... So bootlocal.sh are stopped in this process ::
Code:
/usr/local/etc/init.d/pcp_startup.sh 2>&1 | tee -a /var/log/pcp_boot.l$
.../
A misshapp: The command line above is truncated!
I hope, and guess that Fra8123 did not change that line in bootlocal.sh
That would cause an error, but not a halt (I guess) as it seems.


Fra8123, what happens if you execute:
Code:
sudo /opt/bootlocal.sh
And is there any output from:
Code:
cat  /var/log/pcp_boot.log
This is the log output from the (complete) command line above. Without a functional bootlocal.sh, much of the functions in PiCorePlayer is lost...
So if you do a new install, verify this before installing Jesper's stuff.


/ πr