Experiment

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Experiment

Post by j_e_f_f_g »

Let's conduct an experiment that evaluates 2 things:

1) How well (or not) Linux's audio API is documented.
2) How much linux programmers around here know about Linux's audio API.

I challenge any and all to tell me all you know, or can learn from available docs, about ALSA's Hardware Dependant Interface:
http://www.alsa-project.org/alsa-doc/al ... w_dep.html

Tell me what it's for, how you use it, and cite potential examples of its use.

Some caveats:
1) You're not allowed to use any content previously provided by me (not that I won't recognize it).
2) If anyone even attempts to employ the "I don't think I'm gonna like the message, so lemme attack the messenger" ploy, it will turn out badly for him. Plus, I think I'm gonna start doing public code reviews of the work of these "why don't you do something useful like me?" sorts.

Use your own words. Cut and paste of the auto-doc generated text from alsa's web page doesn't cut it. The point is to find what you, a linux audio dev, know about it.

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

StudioDave
Established Member
Posts: 753
Joined: Sat Nov 01, 2008 1:12 pm

Re: Experiment

Post by StudioDave »

Greetings,

Would you mind if I forwarded this post to the Linux Audio Developers mail list ?

Best,

dp
tux99
Established Member
Posts: 346
Joined: Fri Sep 28, 2012 10:42 am
Contact:

Re: Experiment

Post by tux99 »

falkTX wrote: There's one massive thing that is often forgotten here: open-source.
While in other systems you might have better documentation, they often don't have the big amount of example source code and real open applications that Linux does.
Sorry, but Jeff is right, open source is no excuse for lack of documentation, in fact having source code available is much less useful if it isn't documented.
I have no experience with ALSA source code documentation, but I know that ALSA is very badly documented for end users, the whole ALSA web site seems to be a big cut and paste exercise that's also woefully out of date.

I very much agree with Jeff that ALSA needs much better documentation, and in fact I remember reading that even the ALSA devs themselves acknowledge that.
falkTX wrote: Also, we can very often talk to the developers that designed the API directly! That for me is pretty awesome! :D
Sometimes we can even take part of the developers' talk and help the design/development of the APIs.
That's a great thing but it doesn't replace documentation, especially because it's very inefficient having to answer the same questions over and over again via email when they could just be documented once and for all.
falkTX wrote:But I simply couldn't let pass the fact that opensource is awesome! :D
Yes, the concept of open source is awesome but that has nothing to do with the fact that proper documentation is necessary.


Jeff, as I already suggested in the other thread, why don't you contribute to ALSA directly both with code improvement patches and by helping with the documentation. I mean you seem to have the required skills to do this so why not help out?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Experiment

Post by raboof »

tux99 wrote:open source is no excuse for lack of documentation
Agreed entirely
tux99 wrote:I have no experience with ALSA source code documentation, but I know that ALSA is very badly documented for end users, the whole ALSA web site seems to be a big cut and paste exercise that's also woefully out of date.
Actually it seems they're using templates - but the result is indeed a terrible mess with lots of useless and confusing duplication.
tux99 wrote:I very much agree with Jeff that ALSA needs much better documentation, and in fact I remember reading that even the ALSA devs themselves acknowledge that.
I wouldn't be surprised in the least.
tux99 wrote:
falkTX wrote:Also, we can very often talk to the developers that designed the API directly! That for me is pretty awesome! :D
Sometimes we can even take part of the developers' talk and help the design/development of the APIs.
That's a great thing but it doesn't replace documentation, especially because it's very inefficient having to answer the same questions over and over again via email when they could just be documented once and for all.
While this is true, it also depends on context: for example, taking the example jeffg introduced here, this seems like a fairly obscure part of the API. It doesn't seem entirely unlikely that those users who need this are likely to already be so intimately familiar with ALSA internals that further documentation has relatively little added value. In a closed-source-world, I wouldn't be surprised if this kind of hooks would be kept out of the public API entirely.
j_e_f_f_g wrote:How much linux programmers around here know about Linux's audio API
Do keep in mind that linuxmusicians.com is primarily a users' forum. There's some developers over here, but not a lot overall. If you want to reach the linux audio developers' community, the LAD mailinglists might be a better place to look.

Anyway, to answer your challenge as a developer (though I haven't done much linux audio development in ages): I have no clue what that API does and I'm pretty sure it's irrelevant to me.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Experiment

Post by raboof »

falkTX wrote:But who will write documentation? I speak only for myself here, I truly hate to write documentation...
Actually I love contributing to a good body of documentation. I approach documentation much like I approach code: it should be an elegant, well-structured, easy to navigate whole.

Unfortunately, like code, badly written/maintained documentation can be a terrible pain to improve, and scare off contributors. For this reason, I wouldn't quickly devote my time to improving the ALSA wiki - also because I'm by no means an ALSA expert.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: Experiment

Post by ssj71 »

after a brief look at the docs:

Its obviously for using hardware specific features of a device such as HW monitoring or internal mixing. This would be used to enable such features to relieve the SW of such tasks. </shot in the dark>
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: Experiment

Post by j_e_f_f_g »

I'm not seeing anything about Hardware Dependant Interface. This is not looking good, especially when a dev responds about how useful OSS is, and yet he can't even deduce what this OSS does, let alone how one uses it. I warned you a response like that would just look bad. Advocacy is no substitute for substance.
Would you mind if I forwarded this post to the Linux Audio Developers mail list ?
Yes I would. That would undermine objectivity of the experiment. By all means, post a question to that list, but with the following caveats:

1) You must post as if you're a developer who really wants an understanding of "What's the Hardware Dependant Interface for, how do you use it, and could you cite potential examples of its use?". For example, ask that. You may not say "the reason I'm asking is to conduct an experiment on the merits of alsa dev support", nor link to this thread, nor in any way compromise the objectivity of the experiment. You must not post anything other than what a dev seeking info would post.

2) Use any info you gain there, as well as any other publically available resource, to construct a response here in your own words. Don't just blindly cut and paste someone's answer. The point is to find out if there are adequate resources to teach you, a developer, about this part of linux's audio system.

A few points:

a) I monitor this list, so I'll see the thread.
b) I monitor linux audio irc chans too.
c) Any attempt to compromise the experiment will be exposed, and will look really bad.
d) I know the hwdep interface, and have written an app that uses it. I can easily deduce whether someone is cut-and-pasting an "answer" he doesn't even understand.

3) If the result of this experiment raises a red flag, you may write an article for an online linux journal about this, and even dare ask the question "If devs who already write linux audio software don't know, nor can find, answers to these kinds of questions, does anyone really expect commercial devs to slog through some large, undocumented codebase just to be able to support a really small enduser base?".

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

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 357 times

Re: Experiment

Post by j_e_f_f_g »

We have the first genuine endeavor to answer the question from Steve. (No surprise). Let's hear some more, but remember guys, you're trying to show what you've learned from available resources what hwdep is and what you use it for.

We'll look at all the answers after everyone interested in participating has had a chance.

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

tatch
Established Member
Posts: 662
Joined: Fri Nov 16, 2012 3:18 pm

Re: Experiment

Post by tatch »

j_e_f_f_g wrote:
Would you mind if I forwarded this post to the Linux Audio Developers mail list ?
Yes I would. That would undermine objectivity of the experiment. By all means, post a question to that list, but with the following caveats:
I think StudioDave's question is less of an intent to garner answers for himself to answer and more of a want to extend this post to a more relevant audience, i.e. actual linux audio developers.
Last edited by tatch on Wed May 22, 2013 9:20 pm, edited 1 time in total.
StudioDave
Established Member
Posts: 753
Joined: Sat Nov 01, 2008 1:12 pm

Re: Experiment

Post by StudioDave »

j_e_f_f_g wrote:I'm not seeing anything about Hardware Dependant Interface. This is not looking good, especially when a dev responds about how useful OSS is, and yet he can't even deduce what this OSS does, let alone how one uses it. I warned you a response like that would just look bad. Advocacy is no substitute for substance.
If you're replying to me you're a little off-based. I'm not a developer, never claimed to be. I'm certainly not technically equipped to respond meaningfully to your challenge, but I know people who are. I figured you'd want to hear from them, not me.
Would you mind if I forwarded this post to the Linux Audio Developers mail list ?
Yes I would. That would undermine objectivity of the experiment. By all means, post a question to that list, but with the following caveats:
Thanks, but no thanks. As I wrote in my message I asked to forward the post and that's all I intended to do.

Good luck with the experiment.

Best,

dp
tux99
Established Member
Posts: 346
Joined: Fri Sep 28, 2012 10:42 am
Contact:

Re: Experiment

Post by tux99 »

Jeff, I find this thread a bit pointless, I get what you are trying to prove, but wouldn't it be a much better use of your time if you contributed constructively to the improvement of ALSA?

I'm sure your patches and documentation improvements will be well accepted by the ALSA devs given your knowledge and experience.


As I already said I'd be very glad to see you using your skills to improve ALSA and I'm sure many others would be too.
falken
Established Member
Posts: 21
Joined: Mon Sep 02, 2013 1:28 am

Re: Experiment

Post by falken »

umm, having opened 10 tabs binged/googled (rather binged honestly, since google disalowed + and - on phrases, grrrr) I found that HWDEP is used to configure and control custom nonstandard parts of eighter quite legacy consumer adapters equiped by HW synth chips as FM OPL/YMU or programmable DSP as EMU 10K or even quite standard ADSP-2115 (I personally owned such card Paradise 16-DSP from Western Digital, back in 1993 or so, great design, really, loved it even that GUS was famous at this time; there was REAL 20MIPS DSP !!!) to upload DSP firmware code, or on the other side for few true professional adapters as RME does to configure onboard complex monitoring mixes, onboard FXs etc... All this quite legacy at all today, having far more documented "audio class" standards particulary for USB (1.0 mostly consumer but useable for profi and 2.0 HS even profi considered finally);
So this is also reason why I LOVE such standardized usb-audio classes and their fully implemented drivers (as in Windows its better than in linux, together with all related drivers for latest USB bus topology/hubs/multi-TT etc)

but honestly, NO systematic real documentation about the subject, only "exactly 1" real sample code here:
http://jan-holst.dk/u2a-control/index.html
http://www.mail-archive.com/alsa-devel@ ... 12813.html (also something meaningfull)
2005-09-07
Here I am, at it again after the summer holidays. A patch by ALSA-developer Clemens Ladisch for the USB audio driver implements a hardware dependant interface that allows me to send control transfers to the device through an ioctl() call (please note that this patch only applies cleanly to an older CVS version of the ALSA drivers). I have been able to squirt off a control transfer package to the sound card without getting an error code back, so that definitely counts as progress :-). See below for a useless example that nevertheless seems to send two bytes without complaints.
UMM,
I like to see concepts first, big picture, may be even real pictures and drawings, diagrams, may be videos first. Then short conceptual description how things relates together, then details and for sure, also deep internals and reasons WHY things are implemented the specific way (mostly I understand WELL based on the "inside" details - big woohoo, yeeaah comes :-). But developers have no time to do docs, OK. There arent resources to pay for it, OK. SO...

May be, as LINUX really is OSS and here code is considered as BEST documentation (ummm, good code, well) then at least, can there be some project which integrates at least BIG-PICTURES, birds view in short presentations/videos with graphics and links to compact conceptual description (WIKIs) which will be deeply linked to particular OSS codebases (SVN/GIT/...) exactly to show EXAMPLES how things are really used??? At least this way???

Cheers,
Petr
carlc
Posts: 1
Joined: Wed Sep 04, 2013 1:43 pm

Re: Experiment

Post by carlc »

Hi Jeff,

I found your thread earlier this week through Google as I've been asked to evaluate Linux as an alternate platform for a Windows application. As the application was to remain cross platform and maintain an indentical user experience everywhere, 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 the same way that the application uses ASIO or WASAPI today.

So I asked the ALSA developers to add to their todo list an additional example application in ALSA SDK tarball to eliminate uncertainty about how a full duplex + MIDI application should be implemented.

http://mailman.alsa-project.org/piperma ... 66085.html

Less than 24 hours later I have now shown the mailing list thread to my corporate masters, who had a hearty laugh with me and decided maybe a Linux port isn't such a good use of our time. This has the side effect of tabling any further discussion of making any part of the application open source as ASIO and VST have restrictive licenses that prevent open sourcing the application unless you first strip out any references to ASIO. So absent any open source back end to port to, there is little reason to even consider open sourcing any code. If ALSA has a monopoly on Linux audio then we want nothing to do with Linux, nor do we want Jack or any other API to act as a wrapper between ALSA.

BTW 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 so any calls by loyalists to give Jack another chance will fall on deaf ears, we've moved on to other projects now.

Warm Regards,
Carl
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Experiment

Post by raboof »

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: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: Experiment

Post by ssj71 »

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!
Post Reply