alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Gabriel M. Beddingfield" <gabrbedd@gmail.com>
To: "Paul D. DeRocco" <pderocco@ix.netcom.com>
Cc: Alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: Rawmidi vs. /dev/snd/*
Date: Mon, 02 Apr 2012 00:21:29 -0500	[thread overview]
Message-ID: <4F793759.4050006@gmail.com> (raw)
In-Reply-To: <7F5048EEC8BC46EE9D6306291A92F3EC@PAULD>

On 04/01/2012 01:25 AM, Paul D. DeRocco wrote:
> In writing an embedded app that will be the only thing talking to MIDI, and
> in which I don't need any timing or routing capability, is there any reason
> to use ALSA Rawmidi, as opposed to merely reading and writing the device via
> the file system? Which is the lower-level, and therefore most efficient,
> interface? I'm leaning toward the latter, because I already know how to use
> poll() to wait for incoming data on multiple input devices, but I don't see
> how to do that via Rawmidi.
>

ALSA Rawmidi is the same as doing read/write operations on the file 
system.  Rawmidi is a very thin, low-level interface to 
/dev/snd/midiCxDx.  There is no performance advantage of using one 
approach over the other because they are the same thing.

You're probably better off using the API because it's likely to help you 
avoid mistakes and it gives you easier access to the kernel ioctl() calls.

You can use snd_rawmidi_poll_descriptors() to access the raw file 
descriptors for the midi device so that you can add to your other 
polling descriptors.

-gabriel

  reply	other threads:[~2012-04-02  5:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01  6:25 Rawmidi vs. /dev/snd/* Paul D. DeRocco
2012-04-02  5:21 ` Gabriel M. Beddingfield [this message]
     [not found] <4F7995F2.9040508@gmail.com>
2012-04-02 17:02 ` Paul D. DeRocco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F793759.4050006@gmail.com \
    --to=gabrbedd@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=pderocco@ix.netcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).