Another little bump in performance:
sudo apt install rtirq-init
In /etc/default/rtirq
:
Change: RTIRQ_NON_THREADED="rtc snd"
To: RTIRQ_NON_THREADED="rtc"
Change: RTIRQ_NAME_LIST="snd usb i8042"
To: RTIRQ_NAME_LIST="ACP_PDM_IRQ snd_hda_intel snd_pci_acp3x snd_rn_pci_acp3x snd_pci_acp5x snd_pci_acp6x snd usb i8042"
You find what to put in the line above by issuing sudo lspci -v
, noting the IRQs used by the sound system components, then issuing cat /proc/interrupts
and using the text in the right-hand column for each of those IRQs.
If you don't do the immediately above, it will appear to work as long as you have the Settings window open (and with the focus) to the Bluetooth tab, but as soon as you close the Settings window, it'll start stuttering again. Doing the immediately above gives the IRQs used by the sound system components the highest priority, so they can be serviced by the CPU in a timely manner, no matter if the Bluetooth Settings window is open or not.
In Grub:
GRUB_CMDLINE_LINUX_DEFAULT="threadirqs preempt=full tsc=reliable numa=on nosmt=force nohz=1-5 rcu_nocbs=1-5"
I added the threadirqs
kernel parameter, which changes the interrupt handlers to run in a threaded context. While the low-latency kernel does thread interrupts, it doesn't thread the interrupts related to sound. By forcing the sound system to use threaded interrupts (and giving those IRQs higher priority), we force guaranteed servicing of the sound system threads within a specified time.
This helps especially if you've got your phone connected via Bluetooth to your computer, and your headphones connected via Bluetooth to your computer, and you're listening to podcasts from your phone, through your computer, to your headphones (so you can hear your phone and your computer in the headphones)... without threadirqs
and rtirq-init
, the sound is choppy, no matter what setting I use for the CPU performance (I can peg all the cores to maximum frequency and the sound will still be choppy)... but with those added, it was only choppy very occasionally.
To fix that last bit of choppiness, I changed:
sudo sh -c "echo 10 > /sys/devices/system/cpu/cpufreq/conservative/down_threshold"
I decreased the CPU load at which the CPU will throttle down (previously 50).
sudo sh -c "echo 20 > /sys/devices/system/cpu/cpufreq/conservative/up_threshold"
I decreased the CPU load at which the CPU will throttle up (previously 99).
sudo sh -c "echo 10 > /sys/devices/system/cpu/cpufreq/conservative/freq_step"
I increased by how much the CPU frequency increases per step (previously 1).