the pCP toolbox

(Latest update: Feb-05-2021)

I was thinking of how to get the whole Audio Streaming Series a bit more structured. Simply to make sure that everything ends up as being intended. It turned out that many of the measures I've been describing and proposing would make a nice small set of tools.

It'd be much easier and probably much more comfortable to manage several of the tuning measures and modifications.  Beside that having such tools at hand makes the whole task much less prone to errors.

And finally. Even fellows without in-depth computer skills can easily get things done with such a toolbox at hand.

And all this then led to 

The piCorePlayer Toolbox (Beta)

Any happy-testers out there? Fill free to give the beta-version toolbox a try. Any feedback is welcome and highly appreciated.

The pCP Toolbox provides a small set of tools to customize and enhance the piCorePlayer base OS.
All tools are supporting RPi3, RPi4 and related CM modules. The toolbox supports 32-bit and 64-bit pCP versions.

All tools have to be executed from a pCP terminal. Many of you know the process of how to access such a terminal via ssh by now.  If not, have a look at the official pCP documentation  described over@pCP  first.  I know you'll manage!

Once you're in, you simply have to enter a single command to get any of the jobs done.

Let see what we have. In case you're wondering further down: pCPt stands for pCP Toolbox 😉.

All pCPt sources a stored on github. There's nothing to hide.

Before using the toolbox. Make sure you have a look at The Audio Streaming Series to have your system, prepared and properly up'n running before you use the toolbox. Beside that you'll get the idea where all this is coming from.

As usual. Run a backup before you start the exercise!

Let's see how the pCP toolbox gets installed. 

The next step has only to be done only once. Somehow we need to get the program to initialize the toolbox downloaded from github. Once that is done the toolbox is stored on the system and all further tasks are initiated locally. Of course you'll need an up'n running internet connection.

Let's get started.

Just log yourself in to your RPi via ssh and copy/paste below commands:

url="https://raw.githubusercontent.com/klslz/pcptoolbox/main/pCPt-toolbox-manager.sh"
f=$(mktemp); wget -q -O - "$url" >$f;chmod 700 $f;$f


The toolbox manager will appear. I guess you already know what to choose - "1". 😉




Once installed. The system will reboot. You need to login again. Now you can access the toolbox tools by entering below commands. 



The bold headings below reflect the commands for starting the tools.

pCPt-toolbox-manager.sh

This tool installs, you've just been using it updates and removes the pCP Toolbox.
After installed the toolbox all tools are stored on the system persistent.

Removing the toolbox just removes the toolbox tools! To roll-back each of the following
modifications you'd have to do it from inside the respective tools.


While installing the toolbox-manager some other - minor  - things will also be added alongside.


pCPt-custom-squeezelite.sh

The pCPt-custom-squeezelite.sh tool you know from The Custom Engine project.
The tool 

  • offers, 
  • builds and 
  • installs
 different 

  • customized (e.g. soundcheck's linear volume control, multiprocessor resampler (MP) ) 
  • stripped down and 
  • optimized (platform,architecture)
variants of squeezelite.

And beside that it automatically configures OS related settings,

  • system CPU isolation 
  • task affinity (assigning squeezelite to each of the isolated CPUs)






A whole bunch of things happen with the measure. IMO a must!

Before you start the tool make sure you have 100MB free space. On a fresh installation it is sufficient to increase the filesystem to 200MB.

Note: I did run into download issues - driving me nuts - several times. That's the answer I received from the pCP team, pretty much confirming the shaky behavior of their download servers. A workaround is to try the mirror server (inside the WEB-UI at the bottom right is a toggle-area called pCP Main Repo) to see if that works better.

Finally.

Do not forget to try the linear volume control feature ( 1dB/click) that comes with the soundcheck binary! 

You enter "-X" for linear internal volume control or "-Y <your-mixer-control>" for external linear control in the pCP WEB-UI under squeezelite settings/various options field. E.g.




pCPt-led-manager.sh

This tool disables and re-enables the two RPi main LEDs (ACT and PWR) and ethernet port LEDs.

It lowers

  • RPi activity
  • power consumption
  • light pollution



The tweak is a nice option. It's been discussed in the advanced base setup article.


pCPt-tweaks

This tool runs several system optimizations tasks. It's an enhancement over the Kill-The-Daemons tweaks introduced in the Advanced Base setup article. 

What it does. It

  • disables the still active idle network interface (ethernet or WLAN)
  • assigns proper squeezelite affinity settings. (workaround for pCP flaw (stat Feb-2021) )
  • kills the daemons (after 180s) (WEB interface, dhcp, ssh access)
  • ...more to come


The tool is not supposed to be executed manually. pCP will autostart it at system boot. During the pCPt toolbox installation all related configurations were done already.

You'll find the situation as shown below.

What's left to do by you is to activate the tool.



Just remove the "#" in the Tweaks/User commands section. Save it and initiate a Reboot from the pCP Main page.




To pause the tool-launch at boot, in case you'd like to run some configurations or changes to pCP from your side, you have to reenter the #, save it and reboot. Make sure you do that during the 180s grace period before the Web-UI gets killed. Keep in mind after the 180s - as log as the tool execution is activated - there'll be neither WEB-access nor ssh access. And do not forget to re-enable the tweak and reboot once you're done with your changes!


The pCPt-tweaks part IMO is one of the key measures!

 

Now.

Other goodies

psp 

Introducing an advanced ps (process state) command and a new alias. The vastly stripped down default pCP "ps" Linux command (busybox) is pretty useless when it comes to looking up your process situation. 

Now. The pCP toolbox installs a small package (procps-ng) that offers the full featured ps. The toolbox installer installs also a very useful alias that runs ps with some useful options.

By typing psp in a terminal, you'll get the full picture, about processes, threads, priorities and affinities. This way you can easily verify if all related settings and tweaks are working.

It's actually been me who just recently talked pCP-Paul into getting the procps-np package into the pCP repo (Thx Paul for acting so quick). Background: There's been a recent discussion over at squeezebox forums where certain flaws remained undiscovered because of the lack of such a tool. (I hope the pCP team can make this - my setup - default).
 


What you can see here is, is that a squeezelite-custom version runs @priority 47. And just the output thread runs  @prio48. You also see that all threads except the output thread (CPU3) are attached to CPU2. That's basically how it looks if everything is properly pCP-Toolbox-like configured.

You can try this command once you're done with the whole setup and tweaking. 



Coming Soon

pCPT-converter.sh 

This tool will offer you a selection of highest quality samplerate conversion presets.




1 comment:

  1. Hi Klaus,
    Works great on a AlloBridge with a Rpi 3CM module.
    I did have to extend file system to 500Mb, but after that smooth install and great sound.
    Thanks!

    Remco

    ReplyDelete