BUG: System port number always incremented on remove/add

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG: System port number always incremented on remove/add

juuso.alasuutari (Bugzilla)
This is something that happens with both latest SVN jackd and jackdmp
using -dalsa -Xseq.

I have two MIDI input ports, the first is the sound card's input, and
the second is my USB MIDI keyboard. Normally they are named
midi_capture_1 and midi_capture_2, respectively. But if I pull the
keyboard's USB plug and reconnect it, midi_capture_2 disappears and
reappears as midi_capture_3. Then once more, and it reappears as
midi_capture_4, and so on.

I'm guessing there's a counter somewhere in the code shared between
jackd and jackdmp that simply keeps on going. It should be checked
against the largest existing port number instead. Possibly this is also
true for audio port numbering.

Juuso

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: BUG: System port number always incremented on remove/add

juuso.alasuutari (Bugzilla)
Juuso Alasuutari wrote:

> This is something that happens with both latest SVN jackd and jackdmp
> using -dalsa -Xseq.
>
> I have two MIDI input ports, the first is the sound card's input, and
> the second is my USB MIDI keyboard. Normally they are named
> midi_capture_1 and midi_capture_2, respectively. But if I pull the
> keyboard's USB plug and reconnect it, midi_capture_2 disappears and
> reappears as midi_capture_3. Then once more, and it reappears as
> midi_capture_4, and so on.
>
> I'm guessing there's a counter somewhere in the code shared between
> jackd and jackdmp that simply keeps on going. It should be checked
> against the largest existing port number instead. Possibly this is also
> true for audio port numbering.

Umm, scratch that last one. What I meant is that the new port number
should be set to the _smallest available_ one. Or something...

Juuso

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-Devel] BUG: System port number always incremented on remove/add

Stéphane Letz

Le 8 mars 08 à 17:18, Nedko Arnaudov a écrit :

> Juuso Alasuutari <[hidden email]> writes:
>
>> Juuso Alasuutari wrote:
>>> This is something that happens with both latest SVN jackd and  
>>> jackdmp
>>> using -dalsa -Xseq.
>>>
>>> I have two MIDI input ports, the first is the sound card's input,  
>>> and
>>> the second is my USB MIDI keyboard. Normally they are named
>>> midi_capture_1 and midi_capture_2, respectively. But if I pull the
>>> keyboard's USB plug and reconnect it, midi_capture_2 disappears and
>>> reappears as midi_capture_3. Then once more, and it reappears as
>>> midi_capture_4, and so on.
>>>
>>> I'm guessing there's a counter somewhere in the code shared between
>>> jackd and jackdmp that simply keeps on going. It should be checked
>>> against the largest existing port number instead. Possibly this  
>>> is also
>>> true for audio port numbering.
>>
>> Umm, scratch that last one. What I meant is that the new port number
>> should be set to the _smallest available_ one. Or something...
>
> This is caused by munging code. IMHO it is not MIDI specific. I've
> implemented midi port munging is same way as for audio ports. It is  
> just
> that if you unplug your audio card worse things will happen to  
> JACK. It
> will happen if audio hardware can add and remove audio ports runtime.
>

I would say unplug handling is not really taken in account right now  
(or any kind or dramatic change of backend state...)
As I remember, It was said during LAC meeting that backend jack port  
state change could already be taken in account by clients (using the  
appropriate port register/unregister callback) and that any "robust"  
client would have to be prepared for that.

A 2.0 issue for better handling of backend state change surely?

Stephane
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-Devel] BUG: System port number always incremented on remove/add

lars.luthman (Bugzilla)

On Sat, 2008-03-08 at 22:03 +0100, Stéphane Letz wrote:

> Le 8 mars 08 à 17:18, Nedko Arnaudov a écrit :
>
> > Juuso Alasuutari <[hidden email]> writes:
> >
> >> Juuso Alasuutari wrote:
> >>> This is something that happens with both latest SVN jackd and  
> >>> jackdmp
> >>> using -dalsa -Xseq.
> >>>
> >>> I have two MIDI input ports, the first is the sound card's input,  
> >>> and
> >>> the second is my USB MIDI keyboard. Normally they are named
> >>> midi_capture_1 and midi_capture_2, respectively. But if I pull the
> >>> keyboard's USB plug and reconnect it, midi_capture_2 disappears and
> >>> reappears as midi_capture_3. Then once more, and it reappears as
> >>> midi_capture_4, and so on.
> >>>
> >>> I'm guessing there's a counter somewhere in the code shared between
> >>> jackd and jackdmp that simply keeps on going. It should be checked
> >>> against the largest existing port number instead. Possibly this  
> >>> is also
> >>> true for audio port numbering.
> >>
> >> Umm, scratch that last one. What I meant is that the new port number
> >> should be set to the _smallest available_ one. Or something...
> >
> > This is caused by munging code. IMHO it is not MIDI specific. I've
> > implemented midi port munging is same way as for audio ports. It is  
> > just
> > that if you unplug your audio card worse things will happen to  
> > JACK. It
> > will happen if audio hardware can add and remove audio ports runtime.
> >
>
> I would say unplug handling is not really taken in account right now  
> (or any kind or dramatic change of backend state...)
> As I remember, It was said during LAC meeting that backend jack port  
> state change could already be taken in account by clients (using the  
> appropriate port register/unregister callback) and that any "robust"  
> client would have to be prepared for that.
>
> A 2.0 issue for better handling of backend state change surely?
But MIDI hardware ports are pretty likely to appear and disappear
dynamically - think USB keyboards and control surfaces.


--ll

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-Devel] BUG: System port number always incremented on remove/add

Pieter Palmers
Lars Luthman wrote:

> On Sat, 2008-03-08 at 22:03 +0100, Stéphane Letz wrote:
>> Le 8 mars 08 à 17:18, Nedko Arnaudov a écrit :
>>
>>> Juuso Alasuutari <[hidden email]> writes:
>>>
>>>> Juuso Alasuutari wrote:
>>>>> This is something that happens with both latest SVN jackd and  
>>>>> jackdmp
>>>>> using -dalsa -Xseq.
>>>>>
>>>>> I have two MIDI input ports, the first is the sound card's input,  
>>>>> and
>>>>> the second is my USB MIDI keyboard. Normally they are named
>>>>> midi_capture_1 and midi_capture_2, respectively. But if I pull the
>>>>> keyboard's USB plug and reconnect it, midi_capture_2 disappears and
>>>>> reappears as midi_capture_3. Then once more, and it reappears as
>>>>> midi_capture_4, and so on.
>>>>>
>>>>> I'm guessing there's a counter somewhere in the code shared between
>>>>> jackd and jackdmp that simply keeps on going. It should be checked
>>>>> against the largest existing port number instead. Possibly this  
>>>>> is also
>>>>> true for audio port numbering.
>>>> Umm, scratch that last one. What I meant is that the new port number
>>>> should be set to the _smallest available_ one. Or something...
>>> This is caused by munging code. IMHO it is not MIDI specific. I've
>>> implemented midi port munging is same way as for audio ports. It is  
>>> just
>>> that if you unplug your audio card worse things will happen to  
>>> JACK. It
>>> will happen if audio hardware can add and remove audio ports runtime.
>>>
>> I would say unplug handling is not really taken in account right now  
>> (or any kind or dramatic change of backend state...)
>> As I remember, It was said during LAC meeting that backend jack port  
>> state change could already be taken in account by clients (using the  
>> appropriate port register/unregister callback) and that any "robust"  
>> client would have to be prepared for that.
>>
>> A 2.0 issue for better handling of backend state change surely?
>
> But MIDI hardware ports are pretty likely to appear and disappear
> dynamically - think USB keyboards and control surfaces.

There is not really a good way to do port numbering for disappearing
devices IMHO. I would be able to defend the "port numbers keep
increasing" scenario as well as the "reuse lowest number".

The port numbers should be attached to a "device", since that will allow
the same device to reuse the port numbers. Otherwise the reuse of port
names doesn't make a lot of sense. You could equally well use higher
numbered ports.

Greets,

Pieter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel