the audio streaming series

the base - advanced

(Latest update: Feb-13-2021)

By now you should have a nice and stable audio streaming system based on the Raspberry Pi up'n running.


So far we've been setting up  

  1. the OS
  2. the audio interface
  3. squeezelite

This part of the audio streaming series covers some rather advanced operating system (OS) modifications.

As with all measures, we're following the red line to make the system more efficient.

This part of the project is a must!

The described modifications are quite intrusive. They'll limit access to certain system
features.
These features though are not essential to the actual audio streaming task once the system is properly configured and up'n running.

All of the proposed modifications can get reverted 
rather easy .


soundcheck's tuning kit - pCP (sKit)


To make life for you guys easier I introduced  sKit. sKit will configure everything 
I've been talking about here and more! automatically. You can easily implement it.

Switch over to sKit to get things going.


You can skip below tasks. These are obsolete ( the way it's done and scope) now.
 I leave em in for the time being. 



Kill the daemons 


A Cat1 tweak. There are usually quite a lot of background processes and daemons lingering and poking around in the background, no matter what OS you're looking at.

Most of these idling daemons and processes are not required for the streaming and playback job. And all these processes occupy resources and do have a certain operational and even physical 
impact. 

pCP starts off very lean already. That's the main intention of a TinyCore based system. There's actually not much to tweak. Still enough that it makes a Cat1 tweak.

Raspberry Pi OS based systems, such as Moode, DietPi, Volumio or alike do run a 
lot more background processes and daemons by default.

 
That's the list of daemons we're addressing

  1. the webserver  (the WEB-GUI)
  2. secure shell     (ssh >> remote access)
  3. dhcp  (Dynamic Host Configuration Protocol daemon >> IP network config)


This tweak will stop the related processes after a certain user defined period. You won't be able to access pCP neither via web-interface nor via ssh after this period. It requires a power down and a power up to regain access for the web-ui, in case you want to disable the tweak or do some configurations. Before you do any configurations disable the tweak first!

After the tweak is triggered all audio related processes will continue to work.

What's being done


What are we actually doing here? What's the process?

pCP offers a feature that allows to add and issue certain Linux commands to the boot-up phase. These commands can be entered inside the pCP WEB-UI under Tweaks.The then configured commands will be automatically executed during the pCP startup period.

How is it done?

Enable Modification


Go to the "Tweaks" and "User commands" panel. 




copy/paste below line into the panel:

sleep 120; pkill -f httpd; pkill -f ssh; pkill -f udhcpc


Save and reboot!

That'll be it. Yep. It's that easy.

To verify the mod try to access pCP via WEB-GUI after 120s.  
pCP should not pop up on your web browser and squeezelite should still be playing.

You can change the 120 s timeout to your liking. Don't make it too short though. 
Keep in mind. You'll lock yourself out after this period. No more pCP access via WEB or ssh!

Disable/Pause Modification


If you now intend to disable the mod to be able to e.g. run further pCP configurations via WEB-GUI or ssh, you can remove the whole line or you simply disable/pause the mod by adding a "#" in front of the command line in above User commands panel.

or simply copy/paste below line:

#sleep 120; pkill -f httpd; pkill -f ssh; pkill -f udhcpc


Save it and reboot again.


Once you're finished with your config work don't forget to remove the "#" for re-enabling the mod!



LEDs OFF TWEAK

This tweak disables the RPi onboard LEDs. The two main LEDs (ACT and PWR)
and also the ethernet port LEDs. You'll be left with a black brick in front of you.


Now part of sKit.
 

Wrap-Up


That was an easy one, wasn't it!?!?  
Yep. Easy and highly effective. I'm once more pretty confident you'll enjoy the result. 

Don't forget to make a backup of your SD-card after done with this exercise! 


Enjoy. 

2 comments:

  1. Hi, thanks for all your work. I've been running a pi server, player set up for a while and just installed your all your tweaks on my player(rpi3 - Allo Digione) and I've just upgraded the server pi to a 4 2gb, should I install all the same tweaks on the server as on the player?

    ReplyDelete
  2. I mostly mean the CPU isolation tweaks, I've installed the sKit manager on the server and disabled the LED's just not sure if i need to install custom squeeze and isolate CPU's?
    Ive manually set governor to performance and forced turbo, just not sure if this is best for the server? Ive installed all the Skit manager tweaks on my player and very happy with results, thanks again for all your work.

    ReplyDelete