Experiment

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
falkTX
Established Member
Posts: 6646
Joined: Sat Jan 09, 2010 3:04 pm

Re: Experiment

Postby falkTX » Wed Sep 04, 2013 2:28 pm

oh the ego... :lol:

I speak for myself and KXStudio users (who have JACK always running).
We have no interest on ALSA-only applications, unless what they do is MIDI.

JACK is not so hard to figure out if you use a decent audio-oriented distro like AVLinux or KXStudio.
Plus the JACK API is very easy to understand, with lots of example code.

User avatar
raboof
Established Member
Posts: 1609
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Contact:

Re: Experiment

Postby raboof » Wed Sep 04, 2013 3:48 pm

carlc wrote:it does not make much sense to use Jack considering the poor state of Jack on Windows, so absent any implementation of important Jack features it only makes sense to hook the apps existing audio device configuration dialogs into ALSA


Indeed it does not make sense for carlc to use JACK on Windows. It does, however, make sense to use JACK (instead of ALSA) on Linux. This is the advice he received on the ALSA mailinglist, too - I don't understand why he insists on using ALSA directly.

http://mailman.alsa-project.org/pipermail/alsa-devel/2013-September/066103.html wrote:t is my personal conviction that I would much rather retain full control of my application by communicating directly with ALSA rather than delegating control to Jack just to ease the pain of deciphering your poor documentation.


This is of course nonsense: the reason to prefer JACK over ALSA is not that ALSA has poor documentation.

absent any open source back end to port to


JACK is right there.

I won't be returning to read replies or spending any more time evaluating ALSA or Jack


I was tempted to moderate away this message as this indicates there's little hope for a useful discussion, but let's see.

ssj71
Established Member
Posts: 1292
Joined: Tue Sep 25, 2012 6:36 pm

Re: Experiment

Postby ssj71 » Wed Sep 04, 2013 5:18 pm

I think it is important to note that JACK is not a wrapper, but an interface.
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!

tramp
Established Member
Posts: 1374
Joined: Mon Jul 01, 2013 8:13 am

Re: Experiment

Postby tramp » Wed Sep 04, 2013 5:30 pm

Image
On the road again.

User avatar
falkTX
Established Member
Posts: 6646
Joined: Sat Jan 09, 2010 3:04 pm

Re: Experiment

Postby falkTX » Wed Sep 04, 2013 6:01 pm

@tramp: please make the image clickable to show the full size image, like this:

Code: Select all

[url=http://jackaudio.org/files/JACK-Diagram.png][img]http://jackaudio.org/files/JACK-Diagram-screensize.png[/img][/url]

which results in this:

Image

Note that the image is very old, jack can handle MIDI now, jackdbus exists and can replace jackd and jack2 runs the clients processing in parallel.

j_e_f_f_g
Established Member
Posts: 1045
Joined: Fri Aug 10, 2012 10:48 pm

Re: Experiment

Postby j_e_f_f_g » Fri Sep 06, 2013 11:02 am

carlc wrote:I've been asked to evaluate Linux as an alternate platform for a Windows application.


Hi Carl,

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.

tramp
Established Member
Posts: 1374
Joined: Mon Jul 01, 2013 8:13 am

Re: Experiment

Postby tramp » Fri Sep 06, 2013 1:40 pm

It isn't as hard to find examples for audio interfacing with ALSA directly
http://sourceforge.net/p/faudiostream/c ... alsa-dsp.h
, just the interest under Linux Audio Developers in use it, is low, simply because the modular interfacing between applications is the focus we/they work on. If you would use ALSA for your app, do it, but don’t be surprised when you only get users which come fresh from windows, and when they disappear as soon they face the ability they get with jack.

just a tramp
On the road again.

User avatar
raboof
Established Member
Posts: 1609
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Contact:

Re: Experiment

Postby raboof » Fri Sep 06, 2013 3:10 pm

j_e_f_f_g wrote: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.


Indeed Jack introduces overhead in terms of resource utilisation - indeed there's buffer copying/mixing and process switching going on.

This does not neccessarily mean latency increases. It only means latency increases when the overhead is so big that you need to switch to bigger buffers. I haven't seen measurements that prove that's often the case for real-world DSP loads. I'll readily admit I haven't searched very well for such benchmarks, so if you could point to them I'd be interested.

j_e_f_f_g wrote: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.


I entirely agree you should not use Jack because it's easier (though it is). I think one should use Jack because it's what I prefer to use as an end-user.

I know you insist talking directly to ALSA would for some reason be better here, even though even ALSA developers themselves disagree. Not much sense in repeating that discussion again though.

falken
Established Member
Posts: 21
Joined: Mon Sep 02, 2013 1:28 am

Re: Experiment

Postby falken » Sun Sep 15, 2013 11:57 pm

@all: thanks for the big-pictures and detailed internals on linux audio elsewhere;

One question, tried anybody to benchmark at least most complete(?) ardour somehow?
When I tried to b/g "ardourVST DAWbench", there is till now NOTHING to return, curious :-)


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 2 guests