falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
370 stars 80 forks source link

More robust RT kernel detection #325

Open neyuru opened 3 years ago

neyuru commented 3 years ago

This commit replaces previous method of realtime kernel detection. The last method relied on the version name of the kernel, and it was successful only if the last chunk of the name after the last hyphen contained one of three possible values: ("rt", "realtime", "lowlatency"). But as explained in issue falkTX/Cadence#125 the version name can be convoluted and might not comply with the detection mechanism standard as imposed by cadence. E.g. a kernel with name "3.13.0-44-lowlatency" would pass the test whilst another realtime kernel with name "4.4-6.dmz.1-liquorix-amd64" would not. Also, kernel names can be easily changed and appending "rt" to a name would not make it "rt capable". To solve this, it is proposed to change the detection method to rely on coreutil's "uname -a", which obtains information from the built kernel and outputs two strings related to RT: PREEMPT_RT or PREEMPT. The method presented here takes advantage of this and improves RT kernel detection.