(Latest update: Dec-21-2021)
I was thinking of how to get most relevant and applicable learnings from the Audio Streaming Series easily applied to all the systems out there. Simply to make sure that everything ends up as intended and satisfactory for you in a couple of minutes.
After looking into it, it turned out that many of the measures I've been outlining would make a nice small set of tools. (similar to my Squeezebox Touch Toolbox project from 10 years ago).
One of the project goals : Even fellow audio-enthusiasts who lack in-depth computer skills should be able to get things done easily.
And this then finally led to
sKit
(soundcheck's tuning Kit)
sKit provides a small set of tools to customize and enhance the piCorePlayer base OS for improved audio performance.
sKit currently supports a streaming-client scenario only.
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 Pi 4B.
(CM4 modules and RPi3 and related CM3 modules might also work - no promises made - I don't have them and won't test and won't provide any support for them).
The sKit toolset expects the 64-bit pCP versions. That's the pCP version you should have installed.
sKit has been tested on pCP Versions > 7.0 up to 8.1 .
Please upgrade to the latest pCP version and the most up2date software before you start the journey.
PLEASE: Do not contact me if you run into issues while trying sKit on a different platform!
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. If you don't know how to do that, have a look at the official pCP documentation to be found over@pCP first.
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.
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 500MB (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, HDMI and Wifi (going wired is my preference)
- 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.
A squeezelite settings reminder:
Just to mention it once more, the pCP ssh-login default credentials:
user: tc
password: piCore
Sounds OK and manageable so far!?!?
Let's get sKit installed.
Initial Installation
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:
wget -O- https://raw.githubusercontent.com/klslz/sKit/master/download 2>/dev/null | sh
Once more: This action has to be done only once!
sKit-manager.sh
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.
sKit-check.sh
c-s output priority: OK if between 45 and 50
sKit-custom-squeezelite.sh
The sKit-custom-squeezelite.sh tool you know from The Custom Engine project.
The tool
- offers,
- builds and
- installs
- 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.
Finally.
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.
E.g.
would assign the output-thread to CPU3 (-A) and would enable the internal linear volume control.
sKit-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
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. ;)
sKit-tweaks
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!
sKit-src-manager.sh
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.
Optional Tools
sKit-restore.sh
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. 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.
SUPPORT - Trouble Reports
If you encounter issues or if you have improvement proposals, you can either contact me via this blog
or my github presence. For better tracking I'd prefer a github issue request, with at least below information.
- describe your setup
- RPi revision and type
- pCP revision and version (32 or 64bit)
- pCP setup
- audio interface and power supplies
- describe your issue properly
- what's been done - step by step
- describe corrective measures already taken
- add logfile (to be found under /mnt/mmcblk0p2/tce/sKit/log )
- or screenshots
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
Hi! Thanks a lot for all the work and the info! Really learning a lot! Was playing with the new skit, but after installation LMS stopped. I run from a RPi 3B+ with a Boss DAC, and have updated piCoreplayer and LMS. Any idea what I could do to have LMS back on the same card?
ReplyDeleteThanks again, Michael
Thx for the feedback.
DeleteCurrently a combined LMS/squeezelite operation is not supported.
This would require a complete different tuning profile.
I added a note to the article.
Hi, soundcheck! Thanks for the work. There is a problem when using sKit-check.sh which shows red "please check" sign at "SL-custom-out priority", and I don't figure out what to check.
ReplyDeleteAny help is most welcome,
JK
You should check what priority is configured in your squeezelite settings.
DeleteI check against the recommendations I made in the Audio Streaming Series.
If you run a different Priority it's fair enough.
Well done! It sounds better than ever. Any idea why sKit-check.sh tells me, hdmi is enabled and Skit disabled? hdmi power is "off" on the tweaks page and sKit-tweaks is wizhin the user commands. Is ist because i use a raspberry pi 3b+?
ReplyDeleteDear Soundcheck, i installed one fresh piCorplayer + sKit 1.5 on Pi4 + KTB. Pi4 and KTB are powered with 2 iFi ps + extra caps. The sound is just absolutely f...ing great. I have one (very ?) good system. I just can't stop listen. One question - squeezelite is running on core 1&2, core 3 is reserved. What is running on core 3 ? Thank you so much much for your phantastic work. Tomek :)
ReplyDeleteThe squeezelite (my optimized squeezelite version!) alsa-output thread gets assigned to CPU3 exclusively. The idea is to avoid as much distraction for that key process as possible.
DeleteOne question or hint about rpi 4 getting hot. Has anybody updated rpi firmware? Mine was always around 60 degree, no matter what cpu governor. So i tried updating rpi`s firmware, see raspberry pi homepage. Create a micro sd card with rpi os, place an empty file named ssh on it and you can connect your pc via putty (username pi, password raspberry). Follow the advice on "Updating and upgrading Raspberry Pi OS". Afterwards temperature was significantly lower and everything worked as before so far.
ReplyDeleteLooking forward to next sKit version!
The heat issue has been an early RPi4 issue. It's been fixed a long time ago. However. If you run pCP only, you're facing a lack of a firmware upgrade mechanism. The pCP team is well aware of it, I brought it up quite a while ago. They simply refused to do something about it back then. "It's not worth it" . I haven't checked recent developments though.
DeleteAnyhow. As you say - the easiest and most reliable way is to install a RPiOS and get the latest firmware by running "rpi-eeprom" as root. Before that run an update of the OS.
Keep in mind, being back on the pCP OS you can't change the bootloader
configuration. For 99% of the folks out there it doesn't matter, since they run the default bootloader settings ( BIOS-like settings ) anyhow.
All that is another why I am running RPiOS myself. RPiOS is the OS where the foundation runs its developments on. All RPI related tools and configurations are properly implemented. From that perspective no other OS beats RPiOS.
Enjoy.
FYI - they did something about their own firmware upgrade mechanism and it's available here:
Deletehttps://github.com/piCorePlayer/rpi-eeprom/releases
Simply do a search on "tce-load -i rpi-eeprom.tcz" and we'll find the procedures, I'm not adding the direct link to their forum thread just in case the "Artificial UNintelligence" of Google Bots might flag my reply as some kinda spam simply because of having more than one URL.
Here's the exact title of that forum thread:
"ANNOUNCE: piCorePlayer 7.0.0"
BTW, going from a different flavor of pCP 6.1.0 (with optimized kernel version 4.19) to pCP 8.0.0 (with optimized kernel version 5.13) turned out to drop the CPU Temperature from 47 to 42 but we're talking about Compute Module 4 here.
They should integrate it into the WEB UI and should offer an automatic or manual method, with an option to configure the bootloader and to choose a certain firmware release stage (beta,stabil,...)
DeleteHello Klaus;
ReplyDeleteGood job, but unfortunately i have an issue during download (I4m using rasptouch from audiophonics ans Picore player 8:
sKit (1.5) - manager (1.6)
(c) soundcheck
welcome tc@Rasptouch
_______________________________________________________________
verifying space requirements
mounting boot partition
setting up sKit base
sKit package installation
backing up pre-installation extensions
installing sKit related extensions
ERROR: serious issue while downloading extensions
ERROR: prior status will be restored
ERROR: please try once more later or use a different repo server
ERROR: you could also have look @
ERROR: >> /mnt/mmcblk0p2/tce/sKit/log/sKit-manager.sh.log
ERROR: >> ncurses.tcz already on system....Error ncurses.tcz Failed Checks
restoring pre-sKit extensions
Hope you can fix this easily. regards Arnaud
Hi Arnaud.
DeleteI haven't been looking into sKit for quite a while. Last week I pushed myself to check if everything is fine.
As a matter of fact, surprise, surprise, I ran into the same issue - last week. The whole pCP package download didn't work.
The download and processing of packages from the pCP repos never worked satisfactory.
I am now in the process of rewriting the program to improve the situation. Using my own program.
I already found a method that seems to work more reliable.
I plan to launch an updated version next wednesday latest.
I released a sKit update. Please check if the issue still occurs.
DeleteThe issue was related to pretty annoying performance issues on pCP repo servers. sKit should be able to cope much better with that situation.
Let me know if you made it work.
Hi Klaus,
Deletesorry: exactly same error message today.
I had first remove old sKit, restart and re install, without change.
Arnaud
I think I made it clear inside the article that I require solid information for tracing and trouble shooting.
DeleteNo infos. No support. It's that easy.
Preferably, issue a ticket incl. all the infos over at the github project page.
Good luck.
Hello,Klaus,I am trying your skit kit?
ReplyDeleteIs that contain tidal connect?I find it very useful and facilitated to stream music from PC to moode 7.4.
I hope to use it in skit version.
Thank you!
Hello David.
DeleteTidal, as well as Qobuz and Spotify are supported by the LogitechMedia Server (LMS). You have to enable respective Plugins on LMS under Settings. For Tidal in particular you on top need to install an the additional Tidal app on LMS via mysqueezebox.com. Click the App button on the LMS browser main page.
sKit won't impact these streaming services. I am running Qobuz myself and a friend of mine runs Tidal.
Good luck.
Hello,Klaus
ReplyDeleteAfter installed sKit,it shows that Squeezelite is not running, LMS is not running,everything seems breakdown?
David.
DeleteAt the end of the sKit article I posted a list of items I expect you to supply if you run into problems and if you want some support. I'll give support for sKit related bugs ONLY. I do prefer that the tickets are issued over @github.
If you don't comply, you're on your own. Sorry. I simply don't have time for more support.
See. If you write "squeezelite AND LMS" is not running, it indicates to me that you didn't even read the instructions that say that a combined squeezelite and LMS operation is not supported.
You need to develop a basic understanding of what's actually going on.
Good luck.
Hi Klaus!
ReplyDeleteI want to say a HUGE thank you for the work you've done here! This is the coolest computer science + audiophile project I've seen.
I went through all your instructions to the best of my ability and I think I've configured sKit correctly on a 4b rpi running PiCorePlayer. I'm using a Pi2AES HAT with the 4b. When I run sKit-check.sh i get a response check ALSA value. Using your custom Squeezelite version under Squeezelite -> Unmute ALSA control I set Unmute ALSA control to -U which should set it to max volume. I don't have any volume issues but if you can speak to it then please let me know if that is the right thing to do.
Is it advisable to install sKit onto the LMS/server side of the audio playback chain? I might have missed your instructions to do that but it seems like it would further elevate performance.
As for the subjective first impressions - the sound is much more clear, authoritative, and present. Another level of low level detail and darker backgrounds between instruments is clearly heard. Overtones are separated from the fundamental and there is more clearly defined space and blackness between instruments. Very happy!!
Thank you
As for your subjective impressions: That's what I'd have expected. ;)
DeleteYou can/could install sKit on a pCP LMS server. I wouldn't expect too much of an improvement though. Most configurations are related to squeezelite.
I installed sKit on the server rpi running PiCorePlayer. the changes are: CPU is set to 1500 mghz & locked there. HDMI, Bluetooth, internal audio, and LED's are disabled. sKit tweaks are enabled. I left the CPU isolation, networking (running on wifi currently) and custom squeezelite client alone.
DeleteSince this isn't really meant to be installed on a server client, its kind of janky, but worth experimenting with for some people. I believe that enabling the sKit tweaks involves turning off the networking capability's of the server, I'm not sure how but the server seems to be functioning. I can connect and play Spotify tracks using Spotty vis LMS to the streamer rpi. On the Server rpi, PiCorePlayer says that LMS is not running but well, it is. Hopefully it stays that way. I would send you the log data but since it says LMS is not running it wont show me any log data so as of right now the buttons don't do anything. I don't think that the sKit-tweaks.sh command worked since the web interface is still accessible after 180 seconds and LMS works. I understand this is not anywhere near enough info to troubleshoot but to me it was an interesting experiment.
We're probably approaching the point where the time of day/network activity/power delivery have a similar effect, but at a bare minimum I think it sounds better and would encourage others to give it a try.
After I back all of this up, I'm going to try the streamer side up-sampling plug in you provided and see how that changes the sound.
Klaus, would you consider implementing a sKit server client configuration and a sKit player client configuration? Out of curiosity what player do you use? I recall reading you didn't use LMS.
As I mentioned earlier. Providing a standalone sKit
Deleteplayer (lms and squeezelite on one machine) would mean
a major (continuous) effort to me.
I do have a blueprint for the best sounding RPI based audio player
in the pocket (I'm running it).
All I have to say: There's IMO a lot more to gain.
However. To be able to go public, all the work that needs
to go into such a project requires numerous (100s) quality IT
specialist man-hours. "Unpaid" hours. And it requires a hardware
development environment.
All that means huge cost and efforts plus a bunch of risks on my side.
What for?
You folks (a very,very few excluded) won't even feel tempted
to support such a project. sKit was a test to find out about
your (the community) commitment. There's basically none.
The motivation to share further stuff goes against 0 after having sKit
online for about half a year.
Once more:
I am running a highly tweaked custom Raspberry PI OS (my own build),
with realtime kernel (my own build), LMS and squeezelite (my own branch)
on a single RPI4 machine. Yep. I am not even using pCP myself. All I do
on pCP is just for you folks out there.
Enjoy.
It's not a problem. It's a feature. My binaries are built disabling as many features as possible. Usually people use apps like iPeng, Orange Squeeze or a browser to control LMS. IR control I consider intrusive. My own kernels have HID support, incl. IR support, disabled. If you really need it you can use the original binary.
ReplyDeleteHello Klaus, I use an external dac and a preamp with Volume control. the So I don’t need any digital volume control etc.
ReplyDeleteShould I still be enabling custom Squeezelite?
Please advise…
Thank you for giving us this wonderful gift.
Yes. The custom binary comes with some more changes. I'd recommend to go for it. Everything matters.
DeleteHi Klaus, i'm using and enjoying my picoreplayer since years now thanks to your blog and tools!
ReplyDeleteMy SD Card did crash recently and had to redo from scratch, i noticed that picoreplayer is now version 9.0, sadly sKit-custom-squeezelite does not seem to compile anymore. Do you plan delivering an update of this amazing toolkit?
Hello Klaus, your kit works on version 8.2?
ReplyDeleteHi folks. Have a look at my recent House Keeping blog post! THX
ReplyDelete