4 ms·
I've heard that Haiku's audio APIs are similar to those of BeOS, which are harder to use than today's APIs. I hope they can be improved though, if Haiku is a be
by nyanpasu64 5y ago
I've heard that Haiku's audio APIs are similar to those of BeOS, which are harder to use than today's APIs. I hope they can be improved though, if Haiku is a better foundation for real-time media than standard Linux (or even realtime).
- tialaramex 5y agoThe BeOS Media APIs enshrine a strange way to think about multimedia latency, which is maybe useful if your central idea is that you need to synchronise audio and video through different production pipelines, but doesn't serve real time audio work at all. I believe Haiku did eventually fix some of the most egregious mistakes in their audio handling for example for years if you played silence it made everything else quieter, which is a classic goof†. But it's a long way from ideal for this application. You can of course use anything, if your hobby is making music with Haiku, knock yourself out, same with a ZX Spectrum or a toy xylophone, but yeah, not ideal. † How do I mix samples for N channels together? Adding them together and dividing by N ought to work right? No.
- smallstepforman 5y agoThe Haiku MediaKit API was available 5 years before Fabrice Bellard published ffmpeg, and back in the early 90’s BeInc’s goal was to attract the next successor to the NewTek toaster, and to be the next real time audio mixer. This is why they emphasised chaining of media nodes and sorting our “performance time” synchronisation issues with their API. The famous BeOS marketing video demos such a device. BeOS kernel allows unique app access to a shared memory area, eliminating memory copies when sharing data. When creating the shared area, media apps can set several media access flags to engage the “fast path” if the devices have that buffer. These days modern graphics API’s (eg. Vulkan) offer the same buffer creation hints to help the driver figure out where to best allocate memory (device local, host accessible etc). Because not all memory is equal. I’ve used both ffmpeg API and BMediaKit (I’m the author of a Haiku native video editor, https://github.com/smallstepforman/Medo https://github.com/smallstepforman/Medo). The BMediaKit API is trivially easy to use. ffmpeg is notoriously convoluted. Likewise, the native GUI API is also a pleasure to use. This is why my open source media editor is Haiku native (and not cross platform).
- grepfru_it 5y agoHey! Thanks for your contributions to the BeOS Ecosystem. The OS wouldn't be the same without it!
- viraptor 5y agoSince Pipewire, the Linux view on audio is changing a lot. The latencies are not what they used to be. Even if Haiku becomes more usable, it's unlikely to achieve a massive difference.
- 0des 5y agoConversely, in my own experience, Pipewire removed everything I held dear, destroyed my will to compute, and has somehow crippled my systems for the purposes of multitasking with any type of media playing. Hyperbole aside, I'm glad someone was looking at the audio situation, but this one seemed to knock me out of the game on every machine that received it. Examples of common scenarios for me: I can't have firefox open and virtualbox at the same time, or bitwig and firefox, or visual studio and audacious. Common pairs of apps cause a bitrate mismatch for whatever reason, and everything sounds like a heavily bitcrushed and ring modulated signal. The exception to this are machines that were installed with pipewire, rather than upgraded to pipewire. Also, using Cadence, a router type app helps, but inconsistently.
- viraptor 5y agoDo you mean sample rate? This may help https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-ALSA#changing-the-node-sample-rate https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Con... Otherwise, have you raised the issue at https://gitlab.freedesktop.org/pipewire/pipewire/-/issues https://gitlab.freedesktop.org/pipewire/pipewire/-/issues ? They're pretty responsive.
- zozbot234 5y agoDoes the PREEMPT_RT patchset matter wrt. audio latencies in Linux? That seems to be the biggest effort wrt. "low latency" workloads at least on the kernel side.
- viraptor 5y agoIt does for latency and reliability, but in my experience running the xanmod kernel with just preempt without rt provides low enough (sub-5ms) latency that I stopped caring about RT in my home recording use.