Moode Forum
My MoOde Sound Tweaks - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: Audiophile (https://moodeaudio.org/forum/forumdisplay.php?fid=32)
+--- Forum: Sound quality (https://moodeaudio.org/forum/forumdisplay.php?fid=34)
+--- Thread: My MoOde Sound Tweaks (/showthread.php?tid=749)

Pages: 1 2 3 4 5 6 7


My MoOde Sound Tweaks - Edward - 12-08-2018

Please use the script that is available on github to apply the tweak, this reduces the chance of user error and saves time/effort.

Old instructions removed from this post.

https://github.com/dynobot/Linux-Audio-Adjustments



/boot/config.txt

disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=allo-digione
#dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
over_voltage=-3
over_voltage_sdram=-3
max_usb_current=0

Newly created file in /usr/local/sbin/sound.sh....change permimssions with sudo chmod 755 sound.sh then put the path to this file in /etc/rc.local

Find your audio threads with this command and substitute them with the ones below.
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"

Look for ksoftirq [should be four of them], mine are numbers 7, 14, 19, 24.


#!/bin/bash

#Reduce Audio thread latency

chrt -f -p 83 7
chrt -f -p 83 14
chrt -f -p 83 19
chrt -f -p 83 24

#Reduce USB latency

modprobe snd-usb-audio nrpacks=1

#Reduce MPD and OS latency

chrt -f -p 81 $(pidof mpd)
taskset -c -p 1 $(pidof mpd) 

#Note mmcblk0 should be your hard drive usually sdX for x86 vs ARM

echo noop > /sys/block/mmcblk0/queue/scheduler
echo 2 > /sys/block/mmcblk0/queue/rq_affinity
echo 0 > /proc/sys/vm/swappiness
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


RE: My MoOde Sound Tweaks - mactolinux - 12-08-2018

It is very interesting to have some sh file stings meanings...

Thank you!


RE: My MoOde Sound Tweaks - Edward - 12-08-2018

(12-08-2018, 09:08 PM)mactolinux Wrote: It is very interesting to have some sh file stings meanings...

Thank you!

Sure, please report back any differences in sound.

Shy


RE: My MoOde Sound Tweaks - CallMeMike - 12-09-2018

(12-08-2018, 03:13 PM)Edward Wrote: /boot/config.txt

disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=allo-digione
#dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
over_voltage=-3
over_voltage_sdram=-3
max_usb_current=0

Newly created file in /usr/local/sbin/sound.sh....change permimssions with sudo chmod 755 sound.sh then put the path to this file in /etc/rc.local

Find your audio threads with this command and substitute them with the ones below.
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"

Look for ksoftirq [should be four of them], mine are numbers 7, 14, 19, 24.


#!/bin/bash

#Reduce Audio thread latency

chrt -f -p 83 7
chrt -f -p 83 14
chrt -f -p 83 19
chrt -f -p 83 24

#Reduce USB latency

modprobe snd-usb-audio nrpacks=1

#Reduce MPD and OS latency

chrt -f -p 81 $(pidof mpd)
taskset -c -p 1 $(pidof mpd) 

#Note mmcblk0 should be your hard drive usually sdX for x86 vs ARM

echo noop > /sys/block/mmcblk0/queue/scheduler
echo 2 > /sys/block/mmcblk0/queue/rq_affinity
echo 0 > /proc/sys/vm/swappiness
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
@Edward...  Thanks for publishing your experience.

Can you, please, describe your hardware set-up?


RE: My MoOde Sound Tweaks - Edward - 12-09-2018

(12-09-2018, 06:12 AM)CallMeMike Wrote:
(12-08-2018, 03:13 PM)Edward Wrote: /boot/config.txt

disable_splash=1
hdmi_drive=2
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=allo-digione
#dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
over_voltage=-3
over_voltage_sdram=-3
max_usb_current=0

Newly created file in /usr/local/sbin/sound.sh....change permimssions with sudo chmod 755 sound.sh then put the path to this file in /etc/rc.local

Find your audio threads with this command and substitute them with the ones below.
ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"

Look for ksoftirq [should be four of them], mine are numbers 7, 14, 19, 24.


#!/bin/bash

#Reduce Audio thread latency

chrt -f -p 83 7
chrt -f -p 83 14
chrt -f -p 83 19
chrt -f -p 83 24

#Reduce USB latency

modprobe snd-usb-audio nrpacks=1

#Reduce MPD and OS latency

chrt -f -p 81 $(pidof mpd)
taskset -c -p 1 $(pidof mpd) 

#Note mmcblk0 should be your hard drive usually sdX for x86 vs ARM

echo noop > /sys/block/mmcblk0/queue/scheduler
echo 2 > /sys/block/mmcblk0/queue/rq_affinity
echo 0 > /proc/sys/vm/swappiness
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
@Edward...  Thanks for publishing your experience.

Can you, please, describe your hardware set-up?

RPi
Allo DigiOne Signature
iFi USB Power being powered by a Linear Regulated Power supply being powered by a Balanced Power Supply
Audiogd Master 7 Dac
Audiogd Master 1 Pre
Audiogd Master 3 Amp
Audiogd HE350 power regenerator powering the Dac, Pre and Balanced power supply


RE: My MoOde Sound Tweaks - Tim Curtis - 12-09-2018

Hi,

Are the following params specific to a particular model Pi?

arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
over_voltage=-3
over_voltage_sdram=-3

-Tim


RE: My MoOde Sound Tweaks - Edward - 12-09-2018

(12-09-2018, 04:37 PM)Tim Curtis Wrote: Hi,

Are the following params specific to a particular model Pi?

arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
over_voltage=-3
over_voltage_sdram=-3

-Tim

Hi Tim

Those came from Archimago's site....he did some testing on the Rpi and found some 'optimal' settings. They were used with the B+....I do have all the Pi models I might test it out to see if I run into any glitches.

http://archimago.blogspot.com/2017/03/howto-building-and-installing-raspberry.html


The other kernel level settings came from RedHat, so if anyone is wondering if they were just dreamed up....no RedHat actually has a manual on Linux tuning.


RE: My MoOde Sound Tweaks - mactolinux - 12-10-2018

Edward  
Thank you for sharing this. All seems clear, more or less, this one is not really:

chrt -f -p 81 $(pidof mpd)

My previous attempt for FIFO in mpd.service, adding CPUSchedulingPolicy=fifo — failed, hi-res files were playing with interruptions. Is the command above doing the same?

Thanks.


RE: My MoOde Sound Tweaks - Edward - 12-10-2018

(12-10-2018, 12:20 PM)mactolinux Wrote: Edward  
Thank you for sharing this. All seems clear, more or less, this one is not really:

chrt -f -p 81 $(pidof mpd)

My previous attempt for FIFO in mpd.service, adding CPUSchedulingPolicy=fifo — failed, hi-res files were playing with interruptions. Is the command above doing the same?

Thanks.

Hi mactolinux

That line changes the priority of MPD to 81 and the process type to first in first out. Test it on the command line...sudo chrt...... Afterwards you can check top to verify. Works perfectly for me, been using it for nearly a decade.


RE: My MoOde Sound Tweaks - mactolinux - 12-10-2018

Okay, so it is the same as was in that config. Strange – didn't work here, for 96 & 192 files at least.