05-17-2020, 06:48 AM
Hi, now I had a bit of fun skimming through the scripts and options I started playing around and I think I found a good sound quality with the following changes in the Sound.sh (which is slightly different to Edwards from in Brianlight's).
I uncomment the MPD Affinity and Priority as I am using a high quality external USB DAC and also gave my RPI 4 4GB RAM cores 3 an 4 to MDP exclusively. Secondly I gave my external USB DAC faster data flow by uncommenting the line.
Cheers
Chris
Sound.sh below
#!/bin/bash
#Reduce Audio thread latency
chrt -f -p 54 $(pgrep ksoftirqd/0)
chrt -f -p 54 $(pgrep ksoftirqd/1)
chrt -f -p 54 $(pgrep ksoftirqd/2)
chrt -f -p 54 $(pgrep ksoftirqd/3)
#Uncomment for MPD Affinity and Priority, chrt sets now MDP FIFO, taskset sets MDP prirority to 3rd or 4th core using RPI 4
chrt -f -p 81 $(pidof mpd)
taskset -c -p 3,4 $(pidof mpd)
#USB Dacs Uncomment to reduce USB latency
modprobe snd-usb-audio nrpacks=1
#SPDIF HAT and WiFi users Uncomment to turn off power to [Ethernet and USB] ports
#echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspower
#Reduce operating system latency
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 1000000 > /proc/sys/kernel/sched_latency_ns
echo 100000 > /proc/sys/kernel/sched_min_granularity_ns
echo 25000 > /proc/sys/kernel/sched_wakeup_granularity_ns
exit
I uncomment the MPD Affinity and Priority as I am using a high quality external USB DAC and also gave my RPI 4 4GB RAM cores 3 an 4 to MDP exclusively. Secondly I gave my external USB DAC faster data flow by uncommenting the line.
Cheers
Chris
Sound.sh below
#!/bin/bash
#Reduce Audio thread latency
chrt -f -p 54 $(pgrep ksoftirqd/0)
chrt -f -p 54 $(pgrep ksoftirqd/1)
chrt -f -p 54 $(pgrep ksoftirqd/2)
chrt -f -p 54 $(pgrep ksoftirqd/3)
#Uncomment for MPD Affinity and Priority, chrt sets now MDP FIFO, taskset sets MDP prirority to 3rd or 4th core using RPI 4
chrt -f -p 81 $(pidof mpd)
taskset -c -p 3,4 $(pidof mpd)
#USB Dacs Uncomment to reduce USB latency
modprobe snd-usb-audio nrpacks=1
#SPDIF HAT and WiFi users Uncomment to turn off power to [Ethernet and USB] ports
#echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspower
#Reduce operating system latency
echo noop > /sys/block/mmcblk0/queue/scheduler
echo 1000000 > /proc/sys/kernel/sched_latency_ns
echo 100000 > /proc/sys/kernel/sched_min_granularity_ns
echo 25000 > /proc/sys/kernel/sched_wakeup_granularity_ns
exit