Squeezebox Touch Tweak - ALSA Real-Time
I spent some time trying out my ALSA real-time kernel mods on the Touch. I went though the steps to isolated the "audio threads", the "real-time clock IRQ", and the "spdif IRQ" and tried different values and different combinations. Much clearer vocals, more open and clean sound stage, lows go deeper and clearer...the difference is not subtle! Expect natural smoothness with a good sense of clarity, increased separation within the sound stage, vocals are clear without being harsh and everything sounds more realistic.
The goal is to:
[*]increase audio threads priority
[*]prevent audio threads from sharing interrupt lines
[*]adjust interrupts/processes according to their use
Prerequisites:
You must have a Network connection, you must know your Touch's IP address and you must navigate to Advanced~~~> Remote Login: Enable ssh
Using the WinSCP tool from a Windows machine do the following steps 1~4.
Click to Enlarge - Apply your Touch's IP address and enter the information as seen.
Detailed steps for the mod. After WinSCP has started hit CTRL+T to open a console window then enter the information in yellow, Execute to apply. If you don't like it simply reboot and the values will revert back to the original.1) Find the IRQ number for the Real-Time process to change
cat /proc/interrupts
~~~~~~~~~~~~~~~~~~~~~~~~~
25: 0 - mxc_rtc <~~~~~~~Real time clock = IRQ25
47: 7 - spdif <~~~~~~~~Spdif = IRQ47
~~~~~~~~~~~~~~~~~~~~~~~~~
2) Find the process ID
ps -e
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 ? 00:04:41 sirq-timer/0 <~~~~~~~~PID5 = Audio thread
11 ? 00:00:00 sirq-hrtimer/0 <~~~~~~PID11 = Audio thread
367 ? 00:00:00 IRQ-47 <~~~~~~~~~~PID367 = Spdif IRQ47
407 ? 00:00:00 IRQ-25 <~~~~~~~~~~~PID407 = Real time clock IRQ25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3)Change the process priority
chrt -f -p 93 11 <~~~~~~Audio thread
chrt -f -p 91 5 <~~~~~Audio thread
chrt -f -p 59 367 <~~~~~Spdif [see Fine Tuning section below for alternate suggested values]
chrt -f -p 87 407 <~~~~~Real-Time Clock
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root$ chrt -f -p 59 367 <~~~~~~Enter on command then Execute
pid 367's current scheduling policy: SCHED_FIFO
pid 367's current scheduling priority: 40 <~~~~~Old value
pid 367's new scheduling policy: SCHED_FIFO
pid 367's new scheduling priority: 59 <~~~~~New valuee
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4)Verify the change
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 FF 91 131 - [sirq-timer/0]
9 FF 89 129 - [sirq-tasklet/0]
11 FF 93 133 - [sirq-hrtimer/0]
49 FF 90 130 - [iRQ-34]
367 FF 59 99 - [iRQ-47]
407 FF 87 127 - [iRQ-25]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set it and Forget it.
***Note: To make sure YOUR process ID's are the same on YOUR SB-Touch do steps 1 and 2 above first.***
1) Navigate to the rcS file [etc/init.d/rcS] double clicking it will open it.
2) Enter the yellow portion below into the "rcS" file.
3) Save the file and close the window.
4) CTRL+T to open a command line window and type reboot [Execute]
Click Image to Enlarge...How-To Visual Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Start wlan#/etc/init.d/wlan start <~~~~~Comment out ie [add # mark] this line to insure WiFi does not startiwconfig wlan0 txpower off <~~~~~~~Add this line to insure WiFi is off# Start Samba#if [ -x /etc/init.d/samba ]; then <~~~~~~Comment out these lines to prevent Samba from starting# /etc/init.d/samba start fi#Change priorities <~~~~Add these five lines at the bottomchrt -f -p 93 11chrt -f -p 91 5chrt -f -p 59 367chrt -f -p 87 407
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fine Tuning for Your SystemI encourage everyone to try different values for the SPDIF process ie "367". Apply the change as shown in step 3 above, the change takes affect immediately after you select Execute. The new value will stay in affect until either a reboot or a new value is entered.In some cases the vocals or higher octave notes may seem too focused, a lower value for the SPDIF process will resolve this...try 44, 48, or 53.One of these values is likely to suit your tastes and system best.Update: The folks at Squeezebox Forum came up with some very good supplements for this mod that really makes everything gel together nicely. See alsa_jive processes.
These are the default priority settings for the Touch without the adjustments.
The 40 value is a busy interrupt line with so many [27] processes sharing the same priority. Two processes are already called out as having higher priority. The IRQ34 interrupt which is for direct memory access, and the tasklet process which responds to IRQ requests and insures that tasklets are scheduled on time. Per FFADO IRQ Priorities suggestions the audio threads should be scheduled higher than the tasklet but still have unique values.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root$ ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"
4 FF 40 80 - [sirq-high/0]
5 FF 40 80 - [sirq-timer/0]
6 FF 40 80 - [sirq-net-tx/0]
7 FF 40 80 - [sirq-net-rx/0]
8 FF 40 80 - [sirq-block/0]
9 FF 89 129 - [sirq-tasklet/0]
10 FF 40 80 - [sirq-sched/0]
11 FF 40 80 - [sirq-hrtimer/0]
12 FF 40 80 - [sirq-rcu/0]
49 FF 90 130 - [iRQ-34]
99 FF 40 80 - [iRQ-14]
116 FF 40 80 - [iRQ-10]
125 FF 40 80 - [iRQ-42]
126 FF 40 80 - [iRQ-41]
236 FF 40 80 - [iRQ-22]
258 FF 40 80 - [iRQ-57]
264 FF 40 80 - [iRQ-33]
305 FF 40 80 - [iRQ-37]
334 FF 40 80 - [iRQ-122]
346 FF 40 80 - [iRQ-17]
351 FF 40 80 - [iRQ-123]
356 FF 40 80 - [iRQ-7]
358 FF 40 80 - [iRQ-102]
359 FF 40 80 - [iRQ-8]
367 FF 40 80 - [iRQ-47]
385 FF 40 80 - [iRQ-11]
395 FF 40 80 - [iRQ-12]
407 FF 40 80 - [iRQ-25]
416 FF 40 80 - [iRQ-45]
1341 TS - 19 0 grep -i irq
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://sites.google...ox-touch-tweaks