07-19-2020, 05:09 PM
(07-19-2020, 07:28 AM)swizzle Wrote:(07-17-2020, 12:24 PM)Tim Curtis Wrote: What would be nice is to see a time stamped trace of sample frames within the OS showing some that sort of timing issue, frame loss, etc actually exists. Then it could be analyzed to see what's causing the problem.
Anyway, my point in posting about latency is to provide info from an engineers point of view which leans heavily on testing and analysis :-)
The 32 bit kernels are compiled with CONFIG_PREEMPT_VOLUNTARY=y
Code:pi@rp3:~ $ uname -a
Linux rp3 5.4.49-v7+ #1323 SMP Fri Jun 26 14:34:26 BST 2020 armv7l GNU/Linux
pi@rp3:~ $ sudo modprobe configs
pi@rp3:~ $ zcat /proc/config.gz | grep PREEMPT
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
# CONFIG_PREEMPTIRQ_EVENTS is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
The 64-bit kernels are compiled with CONFIG_PREEMPT=y
Code:pi@rp3:~ $ uname -a
Linux rp3 5.4.49-v8+ #1323 SMP PREEMPT Fri Jun 26 14:47:11 BST 2020 aarch64 GNU/Linux
pi@rp3:~ $ sudo modprobe configs
pi@rp3:~ $ zcat /proc/config.gz | grep PREEMPT
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_RCU=y
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_DEBUG_PREEMPT=y
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
# CONFIG_PREEMPTIRQ_EVENTS is not set
# CONFIG_PREEMPT_TRACER is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
The case against preempt is it hurts performance a bit, the voluntary setting seems like a good compromise especially for older hardware. The Pi 4 can afford to give up a few cycles, especially in an audio context where the processor isn’t working very hard and the newer processor might not suffer as much of a perf hit.
Back when the linked tweaks were under a different name I thought they helped when running the 32-bit kernel but were counterproductive with the newer mpd versions and/or 64-bit kernel (can’t remember the timeline, it was one of them though). It was never a big difference in any case. I used to underclock and do the other type of tweaks until I complained once to Tim about library loading being slower in a test version and tracing the difference to those changes. It had a pretty noticeable impact and any sound improvement was very minor so I stopped bothering when I moved to the Pi 4. I might try the non-config.txt ones again out of nostalgia.
I remember that ;-)
What might be possible is to create a "System tuning" panel that consolidates a reasonable set of options in one place.
More feedback would be needed on this.