(Latest update: Nov-19-2021)
I was thinking of how to get the whole Audio Streaming Series (using a RPi4 and piCorePlayer as base), a bit more condensed and most important: easier to apply - and that, for all people.
Simply to make sure that everything ends up satisfactory for you. And it should also end up as being intended and explained. It shouldn't take the user more than an hour to get going.
After looking into it, it turned out that many of the measures I've been describing and proposing would make a nice small set of tools. (similar to my first Squeezebox Touch Toolbox project).
Even fellow audio-enthusiasts lacking in-depth computer skills would be able to get things done that way.
And this then finally led to
(soundcheck's tuning Kit)
sKit provides a small set of tools to customize and enhance the piCorePlayer base OS for best possible audio performance.
For now sKit supports a streaming-client setup, just squeezelite and no LogitechMediaServer!
A combined client-server setup (standalone player) would require a different tuning profile.
All sKit tools are supporting and focussing on my highly recommended HW platform a Raspberry Pi4. (RPi3 and related CM modules might also work - no promises made - I won't test them and I won't support them - because the RPI3 platform is IMO simply not recommend for the purpose).
The sKit toolset supports 32-bit and 64-bit pCP versions. sKit has been tested on pCP > 7.0.
sKit currently neither supports USB boot scenarios nor netboot scenarios. (a pCP shortcoming)
All sKit tools have to be executed from a pCP linux terminal. Many of you meanwhile know the process of how to access such a terminal via ssh by now. If you don't know how to do that, have a look at the official pCP documentation to be found over@pCP first. I know you - all of you - will manage!
Once you're logged in to your RPi via ssh, you simply have to enter one of the further down listed commands to get this or that job done. A piece of cake! No hacking!
All sKit sources a stored on github. There's nothing to hide. You'll be on the safe side. You can lookup the source about what's actually done.
Before using the sKit tuning kit. Make sure you have a look at The Audio Streaming Series to have your system, prepared and properly up'n running. Not all recommended settings are covered by the tuning kit (yet). Beside that you'll get the idea what this is all about.
Several fellow sKitters have been facing serious pCP repo-server download issues,
which made it impossible to build and install the sKit provided custom squeezelite binary. MeToo.
Support from the pCP team can not be expected. The clunky server performance is known for years and they won't do anything about it.
I now (Nov-19-2021) released an update of sKit-custom-squeezelite.sh. You can load it using the sKit-manager.sh "update" function.
The new version tries everything to make sure the download is gonna be successful.
To accomplish that the updated version won't use the pCP supplied package download tool anymore - I wrote my own procedure.
Two more hints:
- Try to avoid busy weekends or potentially busy repo-server hours for download
- Better avoid the sourceforge.com mirror - that one IMO performs extremely bad
I'd highly appreciate to let me know how it works. I'll remove the beta status as soon as I have received a couple of confirmations.
To be prepared for sKit after a fresh pCP install, you need to have at least following bullets ticked off:
- increase the filesystem to at least 200MB (we need ~100MB free space for sKit)
- run a patch-, minor- and full-update
- enable your audio device
- disable RPi built-in audio
- disable bluetooth and HDMI - and Wifi (if you go wired - what I highly recommend!)
- configure the squeezelite parameters as I suggested for your audio device
- test your base setup incl. running some audio tracks
- run a backup of this configuration, you might have to restore it later on, or
you can easily do some before/after testing.
Just to mention it once more, the pCP ssh-login default credentials:
Sounds OK and manageable so far!?!?
Let's get sKit installed.
The next step has only to be done once. Somehow we need to initialize the toolbox by downloading the installer from github. Once that is done sKit is stored on the system and all further tasks are initiated locally on your system. You'll need an up'n running internet connection to make it all happen!
Let's get started.
Log yourself in to your RPi via ssh.
Now copy/paste below command:
Once more: This action has to be done only once!
During the installation you should see this:
Once sKit is properly installed the system will reboot. You again have to ssh-login to continue the process.
By now you'll have the system already nicely shaped! Quite some sKit measures will already be in place.
What's left to do then!?!?
You'd just have
- to install a custom squeezelite and
- turn off the LEDs
Note: The bold headings ending with .sh on this page reflect the program names (commands) for starting the sKit tools from the ssh command line interface.
Just copy/paste these strings into your ssh terminal.
Now, from time to time there'll be sKit tool updates. Use the update function to get the tools updated.
Only the sKit tools will be updated. Not the tuning measures!!! Therefore it can very well happen that you need to start with a fresh pCP install and a fresh install of sKit! I'll inform you about it in the respective release notes. For that you need to start the sKit-manager.sh
If you're NOT happy with sKit or if I issue a sKit upgrade that requires a fresh sKit installation, you can get sKit removed via the sKit-manager.sh.
c-s output priority: OK if between 45 and 50
The sKit-custom-squeezelite.sh tool you know from The Custom Engine project.
- builds and
- customized (e.g. soundcheck's linear volume control, multiprocessor resampler (MP) )
- stripped down and
- optimized (platform, architecture)
Beside that the tool automatically configures OS related settings, such as
- system CPU isolation
- task affinity (assigning squeezelite to each of the isolated CPUs)
A whole bunch of things happen with this measure. Before you start the tool, make sure you have 100MB of free space - the tool bails out it there's not enough space. On a fresh installation it is sufficient to increase the file-system to 200MB. The 100MB consists mainly of the pCP compile environment that we store on the SD-card. The 100MB gets only temporary loaded into RAM - only during binary build time.
Note: I did run into pCP extensions 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 to see if that works better.
Do not miss the linear volume control feature (1dB/click) that comes with the my version of squeezelite! Most volume controls show rather random behaviour, all coming with different attenuation curves. My squeezelite version goes up'n down with 1dB/click.
You have to 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.
would assign the output-thread to CPU3 (-A) and would enable the internal linear volume control.
This tool disables and re-enables the two RPi main LEDs (ACT and PWR) and ethernet port LEDs.
- RPi activity
- power consumption
- light pollution
Turning the LEDs OFF saves a little power and stops light pollution in the room. It's been introduced in the advanced base setup article. Just do it. ;)
This tool is NOT supposed to be executed manually from a terminal. pCP will autostart the tool at system boot. During the sKit installation all related configurations were done already.
I am still listing it, because it applies some key measures I'd like to explain.
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 several daemons (after 180s) (WEB interface, dhcp, ssh access)
- ...more to come
You'll find the situation as shown below after the sKit installation . This way the tool is active and being started @ boot time.
To deactivate the tool you need to add a # in front of the sleep command, as shown below, and
press SAVE afterwards. Once saved, initiate a Reboot from the pCP Main page.
To simply 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 insert the #, save it and reboot.
After 180s - while sKit-tweaks is activated - there'll be neither WEB-access nor ssh access. Make sure you do your changes during that 180s grace period right after boot.
And do not forget to re-enable the sKit-tweaks and reboot once you're done with your changes!
If you login via ssh during the 180s grace-period, the sKit-tweaks tool will automatically be stopped!
In this case you wouldn't have run the insert/remove "#" action. There wouldn't 't be a lockout anymore!
The sKit-tweaks part IMO is one of the key tuning measures! Make sure you got it activated!
The tool provides you easy access to highest quality sample-rate conversion. Keep in mind. What matters if you do digital signal processing (DSP) are the settings of the filters that are being used. squeezelite with libsoxr gives you the framework. We need to get it going.
Now. You're the driver. It's your job to get the horsepowers on the street.
To give you a headstart the sKit-src-manager.sh tool offers a selection of a few sample-rate conversion (SRC) presets that I consider worth trying.
As outlined in the Audio Streaming Series - The converter and in the Resampling - If you can't avoid it article from 2011, there are IMO certain good reasons to try SRC. The key reason is that your SRCed data might beat the internal DAC filters and DSP. This could outweigh the SRC related losses - no DSP is lossless.
As you can see above. For now I'm offering 4 presets. You should try them all to get the picture. Give each of them a little time to sink in.
My experience shows, there are DACs that show real nice performance jumps, others do not show any change and yes, there are DACs where things get worse. No promises made!
Working with DSPs and digital filters is not an exact science. Every DSP solution remains a compromise.
One more thing needs to be mentioned for now. Inside the pCP Squeezelite Settings menu, you'll find a field Max sample rate. By default, with the Max sample rate field being empty, above presets synchronously resample to the highest possible sample-rate that your DAC supports. squeezelite recognizes the maximum samplerate of your DAC. However. There are cases (my DAC) where the maximum sample rate the DAC is offering doesn't work. That's when u use the Max sample rate field.
Just go one level below you DACs max sample rate. And try that. Below the setting for my iFi DAC.
Typical values to try would be: 768000, 384000, 192000, 96000
The uneven values (x*44100) are automatically selected by the synchronous resampling mode!
That'll be it for the time being. I'd really like to hear some feedback on above presets.
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. sKit installs a small package (procps-ng) that offers the full featured ps. The sKit manager 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.
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 or 1. That's basically how it looks if everything is properly sKit-like configured.
You can try this command once you're done with the whole setup and tweaking.
If you encounter issues or if you have improvement proposals, you can either contact me via this blog
or my github presence.
- describe your setup
- RPi revision and type
- pCP revision and version (32 or 64bit)
- describe your issue properly
- what's been done - step by step
- describe corrective measures taken
- add logfile (to be found under /mnt/mmcblk0p2/tce/sKit/log )
The more specific you are, the easier issues can get fixed.
No proper Info >> No Action on my side >>>> No Fix.
- sKit evolution and maintenance - pretty solid efforts
- sKit-custom-realtime-kernel - that'd be a major project - and a major step up
- sKit-advanced-tuning - there's still much more to gain
- sKit-basic-settings - do the pCP basic configs with a tool.
- sKit-server/standalone - combined server and client operation
- sKit-Moode - piCorePlayer is not the only system with tuning potential
- sKit-Volumio - that applies here again
All I can say from the feedback I receive sKit seems to work quite well for many folks out there.