dagargo / overwitch

JACK client for Overbridge devices
GNU General Public License v3.0
127 stars 15 forks source link

Skip writing to the device if no audio in ports are connected #11

Closed lentferj closed 2 years ago

lentferj commented 2 years ago

This patch set optimizes (or tries to) the handling of audio out to Elektron devices in that it checks if these ports are connected via jack and only then writes out the data to the ring buffer.

dagargo commented 2 years ago

This is really nice. Merged!

Thanks for your contribution!

dagargo commented 2 years ago

After a few tests, I've reverted 04a33b2 in 8a83f5b4f5017b1d7246d5c730c67c2e9db40544

This is the average load of the process with your changes after a few minutes of execution.

$ ps -o pcpu  -q $(pidof overwitch)
%CPU
 6.5

This is without them.

$ ps -o pcpu  -q $(pidof overwitch)
%CPU
 5.8

I've noticed this because I usually monitor overwitch and the CPU use of the JACK thread was around 1 % higher than it did before. The values above are the average of all the threads.

I hope you don't mind.

lentferj commented 2 years ago

Sure not. Thanks for considering and taking the time to test it out. If evidence shows it's actually not helping I am all for reverting it.