Re: MIDI subscription

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul D. DeRocco wrote:
> Under "Subscription", it says "subscription is a connection between two
> sequencer ports." The snd_seq_subscribe_port() function takes a
> snd_seq_port_subscribe_t which specifies a sender and a receiver. But the
> explanation always seems to refer to subscribing "to" a port, rather than
> subscribing "between" two ports.

In most cases, the receiver is your own port.  But in the general case,
all subscriptions are between two ports.

> [...] And then it says "There is another subscription type for opposite
> direction". But if subscription is a connection between a source and
> a destination, what are the two types of subscription?

There are not really two types.  But if you want connections in both
directions, you need to make two subscriptions, with opposite "from"/"to"
ports.

> Later, under "Permissions", it speaks of READ and WRITE permissions being
> needed to send events to or receive events from other ports. Then, it
> speaks of SUBS_READ and SUBS_WRITE permissions, which are needed for
> subscription, implying that subscription isn't the same thing as merely
> passing events from one port to another.

All events have a destination port, which can be a specific port, or
"all subscribers".  A program like aplaymidi sends events to a specific
destination and does not allow subscriptions.

> It then says that these SUBS flags aren't necessary "if the client
> subscribes itself to the specified port". Since a client is just an
> object, not a program or a piece of code, how does a client subscribe
> itself to something, or do anything at all?

All accesses to the ALSA sequencer are done through a client object, so
for practical purposes, a client indeed is a program or a piece of code.

The permission bits allow other clients to do something with the port;
a client is always allowed to do everything with its own ports.

So if you want to subscribe from or to your own port, the other port
needs to allow this; if you subscribe between two other ports, both need
to allow this.

(Please note that events are always sent by the source port, so it is not
possible to read events from another client's port without a subscription,
so the READ bit is pointless without SUBS_READ.)


Regards,
Clemens

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux