Re: [LAD] Finding ALSA sequencer client/port numbers

From: Paul Davis <paul@email-addr-hidden>
Date: Sat Apr 23 2011 - 02:22:59 EEST

On Fri, Apr 22, 2011 at 7:18 PM, Lieven Moors <lievenmoors@email-addr-hidden> wrote:
> On Fri, Apr 22, 2011 at 07:09:24PM -0400, Paul Davis wrote:
>> On Fri, Apr 22, 2011 at 7:05 PM, Lieven Moors <lievenmoors@email-addr-hidden> wrote:
>>
>> > I had a similar problem in my studio when I wanted to restore
>> > connections with multiple ZynaddsubFX instances. All the port names
>> > were the same, so I had no way of knowing which was which.
>> > And the client ID is not much help either, because it completely
>> > depends on the order in which you start the applications.
>> > In the end, the only thing I could do was patch ZynaddsubFX so
>> > it would make unique port names. It was very hard to code such
>> > a simple thing, because like you, I couldn't find a way to get
>> > an id from a name...
>>
>> why would you use the name at all. the way we handle this in ardour2
>> is to use only port IDs when storing MIDI connections. the names are
>> not used at all. we use pair<int,int> as SequencerPortAddress (the
>> first one is the client ID, the second is the port ID).
>>
>> --p
>
> But surely, the client IDs are a moving target. I want to connect
> to a specific instance of ZynaddsubFX, not to the program that was
> the second one to get an ALSA ID...
>
> Am I missing something?

i don't think so. but since, as dave pointed out, there is no
particular mapping between client IDs and names, there's really no way
to do this. i think. like i said, i consider the whole design totally
FUBAR'ed. if you use numeric ID's you're screwed because the client ID
may change; if you use names, you're screwed because you can't map
reliably from names to the numeric ID's required by the API. that's
how it looks to me, anyway.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sat Apr 23 04:15:05 2011

This archive was generated by hypermail 2.1.8 : Sat Apr 23 2011 - 04:15:06 EEST