(Solved!) Windows Audio vs. Linux Audio

Practical tips for recording, editing, and mastering.

Moderators: MattKingUSA, khz

User avatar
TAERSH
Established Member
Posts: 455
Joined: Mon Feb 03, 2020 6:48 pm
Has thanked: 27 times
Been thanked: 21 times

(Solved!) Windows Audio vs. Linux Audio

Post by TAERSH »

Hi.

When I'm running my old machine from 2008 with Windows XP SP2 installed I never have anything like Xruns e.g. in Cubase. Also I don't need stuff like JACK audio to be able to play music from different sources/players at same time via the sound card.

Why isn't GNU/Linux able to handle that audio stuff as excellent and smart as Windows is doing it?

Will this ever change?

As we see from different posts, there's always problems to get it running well. Pulse Audio didn't change anything on these continuing and repeatedly arising problems and I'm sure the new development of the Pulse replacement (can't recall its name right now) won't do it either. I really like to use GNU/Linux, but currently I wish I had enough money to buy everything needed to use Windows again.
Last edited by TAERSH on Fri Sep 03, 2021 3:32 am, edited 1 time in total.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Windows Audio vs. Linux Audio

Post by CrocoDuck »

TAERSH wrote: Tue May 18, 2021 4:36 pm Why isn't GNU/Linux able to handle that audio stuff as excellent and smart as Windows is doing it?
I am not sure I can offer a technically satisfactory answer by pointing out at the various design choices that, throughout the years, have made Linux what it is. Best I can do is link to an article I written some time ago and point one thing out:

Under the hood, Windows and macOS too (for the matter) actually have somewhat similar implementations of the audio stack. This is mentioned in my article above. I tend to agree that for most people the audio experience on Win/mac at least feels more straightforward and easier though, despite this.

One point I always found interesting is that raised by Paul Davis here.
Gps
Established Member
Posts: 1136
Joined: Mon Mar 09, 2015 3:09 pm
Has thanked: 331 times
Been thanked: 112 times

Re: Windows Audio vs. Linux Audio

Post by Gps »

My two cents.

I once tried jack, and gave up rather soon. It crashing was the main reason.

These days with LMMS, using pulse audio, and everything is plug and play.

Maybe one day, I will try jack again, but the number of post here, of people having issues with jack makes me reluctant.
Most are solved though, I am not criticizing jack.

It is not as user friendly as pulse audio though.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Windows Audio vs. Linux Audio

Post by CrocoDuck »

TAERSH wrote: Tue May 18, 2021 4:36 pm Will this ever change?
About this: I have no idea. I have no major issue with how Linux audio works at the moment, but I would welcome a more efficient and streamlined audio stack for sure. At the moment, PipeWire is in the making. To be honest, I am not holding my breath. Even if it turns out to be very good, we will have some rough edges for some time as it starts getting adopted. It doesn't touch the kernel side of things as far as I am aware, so all ALSA limitations, including those Paul mentioned in the forum post I linked above (it is pretty old, not sure how much that is still relevant) will not be addressed by PipeWire.

I guess we will see how it goes, for those of us that, like me, are not skilled enough to contribute.
User avatar
TAERSH
Established Member
Posts: 455
Joined: Mon Feb 03, 2020 6:48 pm
Has thanked: 27 times
Been thanked: 21 times

Re: Windows Audio vs. Linux Audio

Post by TAERSH »

@Gps
I never had any problems using JACK, though there was one single exception.
It was on a Dell computer where the sound card was detected and could be selected in JACK (QJackCtl).
But it never played any audio. Only ALSA worked.

I wished JACK could be used by all Audio & Video programs incl. Browsers.
Then I would setup my OS to run/use JACK automatically after booted into the DE.

Thanks at all...
User avatar
GMaq
Established Member
Posts: 2774
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 520 times
Been thanked: 555 times

Re: Windows Audio vs. Linux Audio

Post by GMaq »

TAERSH wrote: Tue May 18, 2021 8:39 pm
I wished JACK could be used by all Audio & Video programs incl. Browsers.
Then I would setup my OS to run/use JACK automatically after booted into the DE.

Thanks at all...
Hi,

For the most part this is how AVL-MXE comes out of the box... Select your Audio device you want to use with JACK, start Qjackctl and it starts the PulseAudio bridges and even ALSA MIDI devices get shown as JACK MIDI with a2jmidid and everything that uses PulseAudio (browsers, Media Players, Video Editors, etc etc.) gets routed through your selected JACK device. I've even used this to effortlessly record Audio right out of the Browser into Ardour..

I agree it sucks to have to use a special configuration with 2 Sound servers + ALSA but when it's all set up and ready to go you can pretty much route anything anywhere.. If you use the same Audio interface every day its very easy to set up Qjackctl for Autostart and you boot into a system with it all going when you Log in
User avatar
sunrat
Established Member
Posts: 915
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 151 times
Been thanked: 242 times

Re: Windows Audio vs. Linux Audio

Post by sunrat »

CrocoDuck wrote: Tue May 18, 2021 8:14 pm
TAERSH wrote: Tue May 18, 2021 4:36 pm Will this ever change?
About this: I have no idea. I have no major issue with how Linux audio works at the moment, but I would welcome a more efficient and streamlined audio stack for sure. At the moment, PipeWire is in the making. To be honest, I am not holding my breath. Even if it turns out to be very good, we will have some rough edges for some time as it starts getting adopted. It doesn't touch the kernel side of things as far as I am aware, so all ALSA limitations, including those Paul mentioned in the forum post I linked above (it is pretty old, not sure how much that is still relevant) will not be addressed by PipeWire.
I see that article you linked was about KLANG, a new audio system for Linux announced in 2012 that was going to fix all the problems. :| I also have little faith Pipewire will be the definitive solution any time soon.
GMaq wrote: Tue May 18, 2021 9:17 pm
TAERSH wrote: Tue May 18, 2021 8:39 pm I wished JACK could be used by all Audio & Video programs incl. Browsers.
Then I would setup my OS to run/use JACK automatically after booted into the DE.
For the most part this is how AVL-MXE comes out of the box... Select your Audio device you want to use with JACK, start Qjackctl and it starts the PulseAudio bridges and even ALSA MIDI devices get shown as JACK MIDI with a2jmidid and everything that uses PulseAudio (browsers, Media Players, Video Editors, etc etc.) gets routed through your selected JACK device.
I borrowed most of Glen's AVL config to run similarly to that in Debian. It's really not that hard and is mostly documented in my Debian Bullseye KDE guide in Tips and Tricks section. It even now starts LSP PEQ for room correction when Qjackctl starts JACK. :wink:

Oh yeah, re the topic - Windows audio is not free of its own peculiar problems either. Just check the forums for any Windows audio software. Also check this "Guide for optimising Windows 10" for DAW use from Merging Technologies, maker of Pyramix and other pro audio software and hardware - https://confluence.merging.com/pages/vi ... d=17203497 . It's rather lengthy.
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: Windows Audio vs. Linux Audio

Post by j_e_f_f_g »

TAERSH wrote:Why isn't GNU/Linux able to handle that audio stuff as excellent and smart as Windows is doing it?
Because Microsoft pays good money to the people who write its audio stack, and consequently these people are expected to:

1) Do significant research, get feedback, and give much consideration to what professional musicians and music companies want and need.

2) Make sure everything is documented in a way that is useful to programmers so the audio stack is properly and well supported.

And there are bosses to ensure that, if the employee doesn't do the above, consequences will be had.

Contrast this with the typical person who creates Linux's audio system/support. He is, for the most part, a hobbyist creating support that serves his own particular need. For example, the guy who wrote ALSA did so because he wanted an API to access a few "features" on his Gravis Ultrasound audio card (ie, a cheap Creative Labs Sound Blaster knockoff made by a "game audio" company). Seriously. What kind of API do you reckon that's going to yield?

He doesn't have anyone to answer to if he ends up doing things that are "bad" for Linux audio. He has no supervision. He doesn't need to worry about whether his output is even useful to anyone else, much less discerning professionals. And he doesn't need documentation because he wrote the code, and already knows how it works and how you use it. (Hell if he's a typical FLOSS programmer, you're lucky if you see even one, fleeting comment in the source code).

So which group of people do you think are going to produce the better system?

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Drumfix
Established Member
Posts: 299
Joined: Mon Jan 26, 2009 5:15 pm
Been thanked: 11 times

Re: Windows Audio vs. Linux Audio

Post by Drumfix »

I don't know in what parallel universe you guys are living, but i known not a single version of the Windows audio stack that would be suitable for low latency audio. WDM, no. DirectSound, no. WASAPI (shared) no. WASAPI exclusive (maybe). But wit WASAPI exclusiveonly one audio client can use the soundcard, same for ASIO (which is not a part of Windows). So how could this be better than alsa+jack+pulseaudio ?
tavasti
Established Member
Posts: 2047
Joined: Tue Feb 16, 2016 6:56 am
Location: Kangasala, Finland
Has thanked: 369 times
Been thanked: 208 times
Contact:

Re: Windows Audio vs. Linux Audio

Post by tavasti »

TAERSH wrote: Tue May 18, 2021 4:36 pm I really like to use GNU/Linux, but currently I wish I had enough money to buy everything needed to use Windows again.
Just curious, what are those costs involved if you would jump to windows? I haven't used windows since 1994, so I don't know :-)

Linux veteran & Novice musician

Latest track: https://www.youtube.com/watch?v=ycVrgGtrBmM

CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Windows Audio vs. Linux Audio

Post by CrocoDuck »

sunrat wrote: Tue May 18, 2021 10:42 pm I see that article you linked was about KLANG, a new audio system for Linux announced in 2012 that was going to fix all the problems.
Not quite. Yes the thread is about KLANG, but as we all know KLANG was an idea doomed to fail since its inception that had no development whatsoever done on it as far as I understand. Most of its shortcomings are indeed mentioned in the thread itself. I wanted instead to direct you guys to a few comments about ALSA Paul Davis did. Not sure if the link redirected you to the actual Paul Davis post, if not here it is in its integrity:

User question:
89c51 wrote: Paul could you also answer why mac os x does a better job with a single "stack", why we can't have the same in linux and also why there is no effort trying to merge jack and PA (lack of manpower was the reason last time i heard about it).
Paul answer:
Paul Davis wrote: Its complicated. OS X does a better job with a single stack because it has very clever design that we unfortunately missed (read: didn't know about) back in the early days of ALSA. i don't feel so bad about this - windows didn't get anything remotely resembling this idea till years later either. The crux of the matter is that CoreAudio is NOT dependent on the flow of interrupts from the device to be able to know with fairly high precision where the current audio interface read and write locations are in memory. This means that applications with entirely different latency requirements can write into a shared memory buffer without requiring that they all do so synchronously (the way that JACK requires). An application that wants to write 8 samples at a time can do so, and at the same time, another application that wants to deliver 4096 or even 64k samples at a time can also do so - CoreAudio can ensure that both of them end up putting audio in the "right" place in the mix buffer so as to match their latency requirements. It does this using an engineering design called a delay locked loop (DLL), which actually makes the latency slightly worse than on Linux - CoreAudio drivers have a "safety buffer" to account for possible errors in the estimates that the DLL provides for the current read/write pointer locations, and this adds to the overall latency. Its fairly small though - typically 8-32 samples. Now, there is nothing fundamental stopping ALSA from adopting this kind of design. But nothing stopping it isn't the same as making it happen - that would require a significant engineering effort.

In addition, even without this, you still have to decide where sample rate conversion and sample format conversion will take place - in user space, or in the kernel. OS X does not have a prohibition on floating point in kernel space (which is contributes a teeny bit to why their kernel is slower than linux for many things). So historically, they have done some of this in the kernel. they won't talk much about the details, but it appears that in recent OS X releases (Lion & Mountain Lion) they have moved away from this and now have a user space daemon that is conceptually similar to Pulse and/or JACK through which all audio flows. this is slight speculation - you can see the server running with ps(1) but apple have never said anything about it. Its also not clear whether the shared memory buffer into which applications ultimately write their audio data is in user space or kernel space, and this may also have changed recently. The key point is that even with the DLL-driven design in the kernel, there are still tricky, fundamental aspects of API design that you have to tackle, and that even on OS X, the answers are not fixed in stone.

interestingly note that PulseAudio has (or was going to have) this DLL-driven design too - lennart calls it "glitch free" - but adding to pulseaudio (or JACK) doesn't do anything what goes on at the ALSA layer.

as for merging JACK + PulseAudio, manpower remains an issue, but more importantly, the goals of the two projects are not really that similar even though to the many idiot-savants who post to reddit and slashdot, they sound as if they should be. there are ways that it could happen, but it would require a huge level of desire on the part of all involved, and given the difficulties we have internally with two different jack implementations, it just seems unlikely.
This was in 2012. A lot must have changed, but I doubt much in the fundamentals of ALSA.
tavasti wrote: Wed May 19, 2021 7:38 am Just curious, what are those costs involved if you would jump to windows? I haven't used windows since 1994, so I don't know
That's also a good point. I remember a few years ago Windows 10 could be downloaded and installed for free. The only limitation of the free license is that you have limited system configuration (cannot even change wallpaper) and only get the security updates. If this is still the case, I think that is enough to build a DAW around.
Drumfix wrote: Wed May 19, 2021 7:04 am I don't know in what parallel universe you guys are living, but i known not a single version of the Windows audio stack that would be suitable for low latency audio. WDM, no. DirectSound, no. WASAPI (shared) no. WASAPI exclusive (maybe). But wit WASAPI exclusiveonly one audio client can use the soundcard, same for ASIO (which is not a part of Windows). So how could this be better than alsa+jack+pulseaudio ?
Yes, win is as "messy" as Linux, from the technical standpoint. Still, I do see reported often, even on this forum, that for many it seems it works out of the box better.
User avatar
Largos
Established Member
Posts: 616
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 70 times
Been thanked: 179 times

Re: Windows Audio vs. Linux Audio

Post by Largos »

The only issues I've ever had with Audio are entirely down to me using a firewire device from focusrite who cba to offer proper support. I installed the firewire packages to use it and I also had to blacklist a module in the kernel. Which involved copy pasting a few words into a text file. This is hardly high effort stuff but it's not even something you need to do if you use a class compliant usb sound interface, which is what I would get if I was buying something today.

For using the same device on Windows, I still have to install the focusrite drivers. So essentially the only extra effort part was a minor edit to a text file. Also, as everything is proprietary, there is always the issues that keeping up to date could leave the device as a paper weight if Focusrite cba to develop for a new windows release or there is some removal of firewire support.

For general use my onboard sound chip and then when I want to use the focusrite, i switch to jack. There is a pulseaudio bridge, so all the non jack applications are still heard. As I have speakers which have inputs from both sources going into them, I only really need the bridge for headphone usage when using the focusrite. Pulseaudio allows me to easily choose whether I sent audio to the focusrite or out my built in soundboard on a per application basis.

It's been pretty simple for me to get myself going with a less than ideal bit of hardware and not the most simple of setup. I don't get why people see it as such trouble.
Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Windows Audio vs. Linux Audio

Post by Kott »

The weakness of Linux drivers can be it's power. For example it's very tricky to utilize E-MU devices on recent Windows, while in Linux it will work OOB.
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: Windows Audio vs. Linux Audio

Post by j_e_f_f_g »

Drumfix wrote: Wed May 19, 2021 7:04 am suitable for low latency audio. WASAPI exclusive (maybe).
Definitely. That's its whole purpose. I use it for several Windows audio apps I wrote, including an earlier version of backupband. BtW i once posted to this forum the source for a small console mode app I wrote to demonstrate how to program wasapi exclusive to play a wave file. It's so easy. Contrast it with alsa MMAP. Yikes! Backupband's WASAPI did in 10 lines of code what took 60 lines in alsa.
WASAPI exclusiveonly one audio client can use the soundcard
Same as alsa or jack if you want comparable latency. Because if you use dmix, or "graph" more external jack clients (process context switches), latency ain't gonna so good..
ASIO (which is not a part of Windows
jack and pulseaudio aren't part of linux.
how could wasapi be better than alsa+jack+pulseaudio ?
Because wasapi pretty much configures itself, is easy to program for, and is suitable for pro audio. The latter combo (the triad of terror) is a nightmare to get working together... although it does appear to give canadians something to do besides drink beer and play hockey.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Gps
Established Member
Posts: 1136
Joined: Mon Mar 09, 2015 3:09 pm
Has thanked: 331 times
Been thanked: 112 times

Re: Windows Audio vs. Linux Audio

Post by Gps »

CrocoDuck wrote: Wed May 19, 2021 8:49 am
tavasti wrote: Wed May 19, 2021 7:38 am Just curious, what are those costs involved if you would jump to windows? I haven't used windows since 1994, so I don't know
That's also a good point. I remember a few years ago Windows 10 could be downloaded and installed for free. The only limitation of the free license is that you have limited system configuration (cannot even change wallpaper) and only get the security updates. If this is still the case, I think that is enough to build a DAW around.
My pc is Dual boot(openSUSE / Win10), if you have a windows 7 or 8 key some were, you can go to the microsoft site and download a win 10 iso, and use that key of windows 7 or 8.

If you don't have a key, you can still download and install Win10, but you will have a water mark that tells you to go into setting, and register windows.
This watermark you can't see if your program is in full screen mode. :wink:

Why I need windows ? It´s because of some older games, that don't have a Linux version.
Post Reply