4 ms·
Isn't this kind of a known issue in Linux land? As much as it has improved, latency has always been the bane of audio applications in the Linux kernel. I rememb
by rglullis 12y ago
Isn't this kind of a known issue in Linux land? As much as it has improved, latency has always been the bane of audio applications in the Linux kernel. I remember in the days of kernel 2.2 that even XMMS would stop playing any music if I started using more than one or two applications.
Recently I got one of those cheap USB interfaces to connect my guitar. I spent some good 4 hours changing the kernel to "low latency" one provided by ubuntu, then trying to setup aRTs to run, then trying to make pulseaudio work with it, then figuring out how to keep both aRTs and pulseaudio dependent applications happy. In the end I got most of it working and I could run some kind of guitar effects application, but the next minute I realized that the volume control media keys stopped working. It was enough for me to throw the usb interface in the drawer and give up on linux for audio applications on workstations: buying a 50€ effect pedal was cheaper than all the time devoted to it.
- jebblue 12y agoIt was and I'm guessing still is a problem on Windows too: http://en.wikipedia.org/wiki/Latency_(audio) http://en.wikipedia.org/wiki/Latency_(audio) Linux has a Real Timer kernel you can run, I used to run it when doing audio stuff, it works great.
- copx 12y agoWindows overcame its audio latency issues in the Vista days by introducing WASAPI (Windows Audio Session API), an API especially designed for professional audio processing. It grands an application exclusive, direct control of the audio hardware drivers, bypassing the higher-level audio layer of the OS. That + real-time threads (I do not know how old that feature is) allows for pro-grade latencies.
- stinos 12y agoI had the exact opposite experience (about 10 years ago, didn't try any audio since on linux): even after all possible RT patches and whatnot we were happy if we would get skip-free roundtrip latencies of 50mSec on Debian with pretty much top of the line pro soundcards. Might have been bad drivers, or maybe we were just screwing up, but on Windows (with ASIO)/OsX we would just install driver, open control panel, turn down buffer size to minimum and sampling rate to maximum and be looking at about 2mSec of latency with a simple loop I->O test app (IIRC but I'm pretty sure it was 64 samples @ 96kHz)
- digi_owl 12y ago>I remember in the days of kernel 2.2 that even XMMS would stop playing any music if I started using more than one or two applications. Back then the sound subsystem didn't do any mixing or similar, so if some program grabbed /dev/snd, everyone else had to wait. As for low latency sound work on Linux today, Jack is what you want rather than pulseaudio. Frankly Pulseaudio is a massive detour when it comes to Linux audio.
- rglullis 12y agoYeah, I mentioned aRTs but I was actually thinking of Jack (too late to change it). The annoying thing with these different sound systems is that it turns a general purpose workstation into an either/or proposition. - The applications that depend on pulseaudio were really not happy when jack was the sink. - Skype wouldn't work. - Because of the real-time requirements of the sound applications, everything else felt absolutely sluggish. - The volume control stopped working. All in all, I'd have to setup a separate system just to run jack-dependent applications.
- digi_owl 12y agoWell at least having Skype go Pulseaudio only prompted the creation of https://github.com/i-rinat/apulse https://github.com/i-rinat/apulse.
- BFay 12y agoPulseaudio has gotten a really bad rep, and I think there was at time where it was legitimately awful, but I think it's better than it was. On mainstream distros with pulseaudio like Fedora or Ubuntu, audio just works, when you don't have low-latency requirements. When you do have low-latency requirements, things are a bit tricky. You do pretty much need to get a low-latency or realtime kernel, and you definitely want to use Jack or ALSA. Maybe this setup is a little more frustrating than Windows, where you may just need to install one driver like ASIO4ALL. But it's flexible, and you can actually get Pulseaudio and Jack working pretty well together after installing the pulseaudio-module-jack. You can turn on jack when you need it, turn it off when you don't, and all of the pulseaudio stuff will get routed through it so that you don't lose sound from your other applications. If you want, you can route audio from pulseaudio into whatever other audio applications you're using - sometimes I like taking Youtube videos and routing the audio through weird effects in Pure Data. I toggle jack on and off with this little script, works pretty well for me right now: https://gist.github.com/YottaSecond/f0a1b515f95b2e791755 https://gist.github.com/YottaSecond/f0a1b515f95b2e791755
- marcosdumay 12y agoTrying to make Pulse work is a big mistake. The first step on any Linux setup is ensuring that it isn't installed. One can get very short latency out of Alsa, up to the point where the hardware becomes your bottleneck. But that's extremely processor intensive, and won't work well if you try to share the dsp with several processes (if you want to get that extreme, I'd recommend you get extra hardware for exclusive use of the application you want low latency from - but here I'm talking about 1ms latency). Anyway when using a cheap USB interface, I'd focus on improving the hardware first. Low latency and high throughput USB isn't cheap (nor is it available at every computer).
- rglullis 12y agoI am talking about my day-to-day workstation and laptop running (x)ubuntu. Pulse may not be great, but nowadays I get to use Skype, watch videos, and listen to music all day using Pulse... why should I go through all the trouble of removing it if it works for the most common tasks? About the interface. I doubt that was the problem. When I got jack to work, I was getting 2-3ms latency between input and processed output. I did get the guitar effect application to work, I just thought it was too inconvenient to be forced to be aware of "what-application-uses-what-sound-system-and-when-I-need-to-flip-the-switches". In any case, my goal was to have a alternative that could be (a) cheap and (b) convenient if I wanted to play with my guitar and have some DAW tools, not to see how low I could bring down latency in a linux system. The lesson learned is that it can be cheap, but not convenient. Ps: did you go to Unicamp?
- marcosdumay 12y ago> why should I go through all the trouble of removing it if it works for the most common tasks? Well, your question that implied you wanted it. Although, yes, the pedal is probably a better choice after all. Anyway, Pulse is only needed for advanced tasks of streaming sound through a network, using application based mixing settings, etc. If you are only doing common tasks, they'll almost certainly keep working without it. It's one of those cases of an apt-get and you are done. Yes, I went to Unicamp, 99's class. Is your nick based on your name?
- ris 12y ago"Isn't this kind of a known issue in Linux land?" No. If you're doing serious audio in Linux, you use jack and get fantastic latency properties. This is a Solved Problem.
- rglullis 12y ago> If you're doing serious audio in Linux Except I am not. And I guess it would be the same case for the vast majority of people who have Android devices. It is only a "Solved Problem" if you are talking exclusively about sound systems that are designed to deal with latency. The problem I was stating is that you can not transparently run "serious audio" and common desktop applications that rely on alsa/pulseaudio. I would consider it a "Solved Problem" when I can get to install Audacity, Skype, my web browser, the mentioned usb interface connected and I can run some effect software... and run them all concurrently without caring how to setup the sound system. People can do that in MacOS/iOS/Windows, and they can't do that in Linux (GNU or Android).