Live data from Hacker News

Elk OS – Audio Operating System

elk.audio

61–70 of 165 posts

Re: Elk OS – Audio Operating System

#61
post #60

It’s a Linux distribution with real-time kernel. Here’s a download link if anybody is interested: https://github.com/elk-audio/elk-pi/releases

what is a real time kernel vs a normal kernel? just "faster"?

'real time' generally means latency guarantees and trading some throughput for consistent low latency for interrupts and scheduling. So faster in some dimensions and slower in others.

The Arch Linux wiki has some description of their real time patches:

https://wiki.archlinux.org/title/Realtime_kernel_patchset

Re: Elk OS – Audio Operating System

#62
post #6

> 1ms round-trip Ooh, a rare latency claim that actually specifies which type of latency they mean! One millisecond round-trip latency, if true in practice, is quite impressive. I'm going to continue reading now... :)

I’ve never understood the latency requirement for professional gear, are you able to articulate why there’s a need for lower latency than average consumer gear?

Press a key on a real piano - instant sound.

At 10ms (and possibly less), you will start to notice the lag and it will affect your performance.

https://www.soundonsound.com/sound-advice/q-how-much-latency...

Re: Elk OS – Audio Operating System

#63
post #37

Earlier quoted context omitted.

I’ve never understood the latency requirement for professional gear, are you able to articulate why there’s a need for lower latency than average consumer gear?

It only takes a small amount of latency (5 ms or so) to noticeably impact performances by musicians. Latency is also an issue when you want to monitor a live signal along with other recorded audio, like in a DAW. It is not as big a deal with a playback only device.

rule of thumb is that sound travels roughly 1ft per ms, so 5ms is the same as standing 5 extra feet from the speaker. Most musicians don't have much trouble up to around 10-20ms.

Jitter is killer though - if the latency is randomly changing it's really annoying.

Re: Elk OS – Audio Operating System

#64
post #13

Reminds me a lot of the Bela project [1]. The idea is that they expose the raw audio device interrupt handler so applications can do DSP processing without the kernel being involved at all. Wonder if this is doing something similar? [1] https://bela.io/

Bela does not expose the audio device interrupt to applications. Your code runs in the Xenomai RT kernel, which functions somewhat like a hypervisor. That means that your RT code doesn't run as part of Linux at all. It also means that you need to use Xenomai-specific techniques if you need to communicate with regular Linux application code. You'd get more or less the same thing by writing a kernel module for Linux, w…

I stand corrected - thanks for the clarification.

Re: Elk OS – Audio Operating System

#65

Earlier quoted context omitted.

So the real time kernel patches have been mainlined? How comprehensive are the real time features of Linux now?

Almost all of the original PREEMPT_RT patchset are mainlined now, but the features are not (all) enabled by default. Low latency will always present a tradeoff with bandwidth, and Linux is used for so many different purposes that one is not clearly more important than the other. For more than 10 years, Linux with the PREEMPT_RT patch has been capable of more-or-less hard real time, with latencies in the 10's of usecs…

If anyone wants to try the as-much-rt-as-possible build in a nice ready package, there's the Xanmod project https://xanmod.org/ which offers it precompiled with a few other tweaks. It's aimed at gamer crowd, but I had a really good experience using it with music processing.

Re: Elk OS – Audio Operating System

#66
post #60

It’s a Linux distribution with real-time kernel. Here’s a download link if anybody is interested: https://github.com/elk-audio/elk-pi/releases

what is a real time kernel vs a normal kernel? just "faster"?

Often it's explicitly not faster— you intentionally do work in a more interruptible/resumable/chunked way even if it's less efficient to do it that way than to just block the system and do it all in one shot.

These kinds of tradeoffs don't make sense for a lot of common Linux workloads, which is why it isn't the default.

Re: Elk OS – Audio Operating System

#67
post #63
post #37

Earlier quoted context omitted.

It only takes a small amount of latency (5 ms or so) to noticeably impact performances by musicians. Latency is also an issue when you want to monitor a live signal along with other recorded audio, like in a DAW. It is not as big a deal with a playback only device.

rule of thumb is that sound travels roughly 1ft per ms, so 5ms is the same as standing 5 extra feet from the speaker. Most musicians don't have much trouble up to around 10-20ms. Jitter is killer though - if the latency is randomly changing it's really annoying.

Is the speed of sound relevant in most recording scenarios? Assuming headphones and instrument/vocal mics that are within a few inches, then everything is traveling as electrical signals at the speed of light.

Or is this just meant as a visualization of latency in these scenarios versus what it would be like with musicians playing x ft apart from each other in a room?

Re: Elk OS – Audio Operating System

#68

Earlier quoted context omitted.

That's necessarily going to be aspirational in at least some respects, though—it's limited by the hardware.

I wonder if there's a way for computers to self-measure round trip. Even if you have to plug an aux cord between the speaker + mic jacks.

People have done experiments using high-speed cameras and such.

Re: Elk OS – Audio Operating System

#69
post #60

Earlier quoted context omitted.

what is a real time kernel vs a normal kernel? just "faster"?

Often it's explicitly not faster— you intentionally do work in a more interruptible/resumable/chunked way even if it's less efficient to do it that way than to just block the system and do it all in one shot. These kinds of tradeoffs don't make sense for a lot of common Linux workloads, which is why it isn't the default.

Yes, and: in return you get documented guarantees about how much time certain operations are allowed to take. As opposed to “We work hard to make it fast most of the time. But, no promises because sometimes stuff happens.”

Re: Elk OS – Audio Operating System

#70
post #58

Earlier quoted context omitted.

Almost all of the original PREEMPT_RT patchset are mainlined now, but the features are not (all) enabled by default. Low latency will always present a tradeoff with bandwidth, and Linux is used for so many different purposes that one is not clearly more important than the other. For more than 10 years, Linux with the PREEMPT_RT patch has been capable of more-or-less hard real time, with latencies in the 10's of usecs…

>more-or-less hard real time Also known as soft realtime. For hard realtime, you need guarantees. Linux is too complex and cannot possibly offer them; this is the territory of formal proof, with complexity growing exponentially with code size. Look at seL4 for hard realtime.

Even with the "guarantees" offered by e.g. seL4, you still need cooperating hardware. SMIs on most mobos cannot be masked, and can take an eternity to be handled by the BIOS.

Fortunately, for realtime audio, you don't need hard realtime unless you're very close to overloading the CPUs. Soft realtime (i.e. 99% of all interrupts handled within N usecs, 100% handled with N*2) is good enough.

Post reply on HN