Page 1 of 2

Sound enhancement script instead of editing several files

PostPosted: 27 Aug 2019, 12:41
by Vhond
Long time ago a topic about enhancing/tweaking the sound of Runeaudio was started. (tweaking-the-audio-performance-rpi3-t4301.html)

I applied the suggestions editing several files using the command line and was very happy with the results.

I was wandering if it is also possible to put this into a script (like somebody did for Moodeaudio: http://moodeaudio.org/forum/showthread.php?tid=749). It seems after every update these alterations are lost.

Unfortunately my Linux skills are not that good.

Or maybe somebody has another solution?

Thanks in advance, Vhond

Note: I allready sent the topicstarter a PM a while ago but haven't received an answer yet

Re: Sound enhancement script instead of editing several file

PostPosted: 28 Aug 2019, 12:04
by eea123
This is a great idea. I haven't touched any code but the extensive thread on audio tweaks in this forum has caught my attention.

I'll also defer to the larger group about the Sound Signature setting already built in. I'm using RuneAudio (the default?) and haven't ever tried changing it for comparison.

Re: Sound enhancement script instead of editing several file

PostPosted: 28 Aug 2019, 16:19
by dynobot
Vhond wrote:Long time ago a topic about enhancing/tweaking the sound of Runeaudio was started. (tweaking-the-audio-performance-rpi3-t4301.html)

I applied the suggestions editing several files using the command line and was very happy with the results.

I was wandering if it is also possible to put this into a script (like somebody did for Moodeaudio: http://moodeaudio.org/forum/showthread.php?tid=749). It seems after every update these alterations are lost.

Unfortunately my Linux skills are not that good.

Or maybe somebody has another solution?

Thanks in advance, Vhond

Note: I allready sent the topicstarter a PM a while ago but haven't received an answer yet


Hi, which files did you update specifically?

And what information did you put in them?

Thanks

Re: Sound enhancement script instead of editing several file

PostPosted: 29 Aug 2019, 08:54
by Vhond
dynobot wrote:
Hi, which files did you update specifically?

And what information did you put in them?

Thanks


Here you can read about it:
http://www.runeaudio.com/forum/tweaking-the-audio-performance-rpi3-t4301.html

Re: Sound enhancement script instead of editing several file

PostPosted: 29 Aug 2019, 15:42
by dynobot
Vhond wrote:
dynobot wrote:
Hi, which files did you update specifically?

And what information did you put in them?

Thanks


Here you can read about it:
http://www.runeaudio.com/forum/tweaking-the-audio-performance-rpi3-t4301.html


Looked at the last post where you had items highlighted, looks like a script can be written to insert those commands into the various files.

But those are not my mods that I created for MoOde. Not sure which mods you are using....some of those were from Rune, others from Archamigo [power mods], and then there are others. Taking the best of all worlds is a good idea.

I'm in the process of writing a script to insert my mods into various files within Rune at the moment. I might look into creating another to include these as well.

Problems with your mod as shown:
#runeFrost
renice -10 -p 3
renice -10 -p 12
renice -10 -p 16
renice -10 -p 20

These PID numbers may change and may be different for each person. For example my Rpi does not even show a pid 3 and 12,16 are not related to anything see below.

root@havana(rw):~# ps -e
PID TTY TIME CMD
1 ? 00:00:07 systemd
2 ? 00:00:00 kthreadd
4 ? 00:00:00 kworker/0:0H
6 ? 00:00:00 mm_percpu_wq
7 ? 00:00:00 ksoftirqd/0
8 ? 00:00:00 rcu_sched
9 ? 00:00:00 rcu_bh
10 ? 00:00:00 migration/0
11 ? 00:00:00 cpuhp/0
12 ? 00:00:00 cpuhp/1
13 ? 00:00:00 migration/1
14 ? 00:00:00 ksoftirqd/1
15 ? 00:00:00 kworker/1:0
16 ? 00:00:00 kworker/1:0H

Also editing the vm numbers are best done in the file that handles the parameters. According to IBM this file would be in /etc/sysctl.d. In the RPi it is the file called raspberrypi.conf.



Thanks
:D

Re: Sound enhancement script instead of editing several file

PostPosted: 30 Aug 2019, 13:13
by Vhond
Thanks Dynobot for your extensive answer.

I understand the pid's vary so the renice commands aren't as usefull as they seem (maybe only if you don't shut down your RPI? Don't know if there's a better solution for this?).

I used this code to put in the orion_optimize.sh file

Code: Select all
if [ "$1" == "OrionV2" ]; then
# runefrost version
ifconfig eth0 mtu 9000
ifconfig wlan0 mtu 9000
ifconfig eth0 txqueuelen 4000
ifconfig wlan0 txqueuelen 4000
echo 0 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=120000 s02=2000000 s03=2000000 s04=2000000 s05=2000000 s06=2000000 s07=2000000 s08=2000000 s09=2000000 s10=2000000 u01=2 u02=2 u03=2 u04=2 u05=2 u06=2 u07=2 u08=2 u09=2 u10=2
#runeFrost
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
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
echo 1 > /proc/sys/kernel/hung_task_check_count
echo 20 > /proc/sys/vm/stat_interval
echo -1 > /proc/sys/kernel/sched_rt_runtime_us
echo 5 > /proc/sys/vm/dirty_background_ratio

sleep 2
mpdprio_nice
echo "(OrionV2) sound signature profile"
fi


I also modified the config.txt file with

Code: Select all
max_usb_current=1

# memory options
gpu_mem=64

# Overclocking options
force_turbo=1

avoid_pwm_pll=1
arm_freq=666
over_voltage=-10
gpu_freq=333

# sdram overclock
sdram_freq=333


sdram_schmoo=0x02000020
over_voltage_sdram_p=-5
over_voltage_sdram_i=-14
over_voltage_sdram_c=-6


disable_pvt=1

# HDMI disable
hdmi_blanking=2


I didn't understand the following code which was also mentioned:
Code: Select all
chattr -i /etc/mpd.conf
Nano /etc/mpd.conf
Add this to the active source:
format "192000:24:2"
samplerate_converter "soxr very high"
then :
Chattr +i /etc/mpd.conf


When I used Moode I liked to use the Realtime Kernel (but this isn't released anymore after release 3.8.4), the forementioned script gives a better sound for the later versions (4.x releases), but not as good as the 3.8.4 RT kernel with options for performance and latency...

Re: Sound enhancement script instead of editing several file

PostPosted: 30 Aug 2019, 21:48
by dynobot
Vhond wrote:I didn't understand the following code which was also mentioned:
Code: Select all
chattr -i /etc/mpd.conf
Nano /etc/mpd.conf
Add this to the active source:
format "192000:24:2"
samplerate_converter "soxr very high"
then :
Chattr +i /etc/mpd.conf

.


The chattr -i

chattr +i

seems to unlock and lock the mpd.conf file for editing....this file is made to only take edits from the UI, I'm guessing.

Re: Sound enhancement script instead of editing several file

PostPosted: 31 Aug 2019, 07:44
by Vhond
Aren't these SOX changes possible using the MPD GUI settings screen?

Re: Sound enhancement script instead of editing several file

PostPosted: 31 Aug 2019, 11:56
by janui
Hi Vhond & dynobot,
Vhond wrote:Aren't these SOX changes possible using the MPD GUI settings screen?
SoXr is already built-in and enabled by default (see your debug UI, the contents of mpd.conf is listed). You can switch it off in the http://runeaudio.local/dev UI.
dynobot wrote:format "192000:24:2"
This will force all output, regardless of the source format, to the specific format: 192k, 24bit, stereo. SoXr will then automatically be used for resampling. Note that 0.5b of RuneAudio will also support up to
Code: Select all
format "384000:32:2
But regardless of this, the output will no longer be bit perfect and don’t forget that the hardware in your DAC will normally resample better than SoXr if and when resampling is required. So I don't really believe this will improve your sound. I did some tests in the past, but was not impressed (see here: using-soxr-resampling-with-rune-0-4-beta-t5835.html). SoXr is implemented as a fallback for cases when a DAC cannot handle a specific output format. Even though SoXr is normally not as good as your DAC it is a far better resampler then the standard ones in MPD and ALSA (see here: post26548.html#p26548).
janui

Re: Sound enhancement script instead of editing several file

PostPosted: 31 Aug 2019, 15:05
by Vhond
Thx Janui for your additional answer, about bitperfect: RuneAudio+R e1 includes an option to select MPD bitperfect setting.

Do you know what this exactly means (isn't this possible as option using the Rune 0.5b version)?