carlc wrote:I've been asked to evaluate Linux as an alternate platform for a Windows application.
As a Windows music app developer who also does linux stuff, I feel your pain. Linux documentation is atrociously bad. I consider it linux's biggest weakness. And frankly, a bit of the advice you get from too many linux devs is equally uninformed, unhelpful, and unprofessional. You be amazed how appalling little a great many linux audio devs know about alsa.
The first thing youu should do is go read my linux audio programming article at http://home.roadrunner.com/~jgglatt/tech/linuxapi.htm
. It's not finished yet. I did most of the midi stuff, but I just started the audio stuff. But that will get you started. Secondly, download the source to my EDrummer app at http://home.roadrunner.com/~jgglatt/edrummer.zip
which is profusely
commented (I am not a typical open source dev. My philosophy is 'If you don't document your source, then don't release it'). That app will show you how to get the tightest performance for midi input and output, and digital audio playback. The only base left to cover is audio recording, but you'll quickly figure that out after gleaning info from my tutorial and example code.
the same way that the application uses ASIO or WASAPI
I don't like ASIO. I do really like WASAPI's Exclusive mode, and to date, it's the best audio API I've used. Ain't gonna lie, Linux doesn't have anything to match wasapi in both
ease of use and
performance. With linux, you have to choose one or the other. You can choose alsa's mmap mode which, like wasapi exclusive mode, eliminates buffer copying, minimizes address translation, and gives direct access to hardware dma buffers. Is it designed well enough to be easily used? Hell no. It was written by a guy who takes data abstraction to absurd extremes, and thinks it's a great idea to provide a dozen different ways to do the same thing. He's what I call a "computer science programmer". No sense of practicality. What I can do in 6 lines of wasapi code literally takes dozens of lines of alsa code. The good news is alsa mmap will give you the performance of wasapi exclusive or asio. Even better if you use a optimized kernel vs stock Windows.
Or you can do things the lazy and easy way with jack, which has a simple api, but internally does craploads of buffer copying/mixing, socket reading/writing, and even inflicts process switching atop that mess. Will you get asio or wasapi exclusive performance? Hell no. Latency is atrocious in comparison. (You wouldn't believe the latency linux musicians readily accept. I either do all pro music work on Windows, or I use my own tools which use alsa).
I only registered this user name to comment in your thread, I won't be returning to read replies or spending any more time evaluating ALSA or Jack
You're hardly the first Windows dev who has come here (or to some linux forum) looking for info and interested in linux, listened to the "advice/recommendations/knowledge" of linux folks, then ended up shaking his head and saying "that ain't for me". How do I know? Because google seems to direct them to a lot of the content I
post, and apparently resonates with them enough that they email me about it. I've gotten emails from 8 windows devs just through this here forum commenting on these threads and basically telling me how... um... "dissatisfied" they've been with just the process of researching linux, let alone anything more. I'm laughing because I just looked at the board index, and see I have a new email.
Bottom line: Linux dev docs need to vastly improve before more pro devs will partake.
Secondly, if your a linux dev who is using something like jack because it's "easy" and you don't know how to program "the hard stuff" because the docs are terrible and the example code is scarce and equally bad, then don't give advice to people who are willing to do the hard work. Trust me, that never goes well.
But if you stumble back here Carl, then I'll hook you up with the info/code you want.