Transient hot-disconnnect of USB devices causes JACK to crash

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

Transient hot-disconnnect of USB devices causes JACK to crash

Daniel James-2
Hi all,

This might seem rather obvious, but I've found momentary accidental
disconnection of a bus-powered USB audio device (M Audio Mobile Pre)
causes jackd 0.103 to fail in a spectacular fashion, with hundreds of xruns.

Given that some USB sockets are rather loose, and that the crash can
sometimes be caused by just slight movement of the laptop in question,
is there anything that can be done to improve reliability? Is it
feasible to expect jackd to pause the transport and wait for the
hardware device to become available again, rather than go down in flames?

Cheers!

Daniel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Transient hot-disconnnect of USB devices causes JACK to crash

Marc-Olivier Barre-3
On Thu, Mar 27, 2008 at 11:20 AM, Daniel James <[hidden email]> wrote:

> Hi all,
>
>  This might seem rather obvious, but I've found momentary accidental
>  disconnection of a bus-powered USB audio device (M Audio Mobile Pre)
>  causes jackd 0.103 to fail in a spectacular fashion, with hundreds of xruns.
>
>  Given that some USB sockets are rather loose, and that the crash can
>  sometimes be caused by just slight movement of the laptop in question,
>  is there anything that can be done to improve reliability? Is it
>  feasible to expect jackd to pause the transport and wait for the
>  hardware device to become available again, rather than go down in flames?
>
>  Cheers!
>
>  Daniel

Hi Daniel,

That is something that has been discussed to be part of jack 2.0.
Disconnecting and reconnecting devices transparently without the
server crashing and apps loosing their connections.
__________________
Marc-Olivier Barre,
MarcO'Chapeau.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Transient hot-disconnnect of USB devices causes JACK to crash

Pieter Palmers
Marc-Olivier Barre wrote:

> On Thu, Mar 27, 2008 at 11:20 AM, Daniel James <[hidden email]> wrote:
>> Hi all,
>>
>>  This might seem rather obvious, but I've found momentary accidental
>>  disconnection of a bus-powered USB audio device (M Audio Mobile Pre)
>>  causes jackd 0.103 to fail in a spectacular fashion, with hundreds of xruns.
>>
>>  Given that some USB sockets are rather loose, and that the crash can
>>  sometimes be caused by just slight movement of the laptop in question,
>>  is there anything that can be done to improve reliability? Is it
>>  feasible to expect jackd to pause the transport and wait for the
>>  hardware device to become available again, rather than go down in flames?
>>
>>  Cheers!
>>
>>  Daniel
>
> Hi Daniel,
>
> That is something that has been discussed to be part of jack 2.0.
> Disconnecting and reconnecting devices transparently without the
> server crashing and apps loosing their connections.

In any case it won't be part of jack 1.0 (at least as far as I have any
say in that). This problem is rather complex to solve, and the current
jack codebase isn't very suited to do this.

But for jack 2.0 I will personally make sure that this works, if only
for the fact that we are faced with a rather similar issue.

Greets,

Pieter

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Transient hot-disconnnect of USB devices causes JACK to crash

Daniel James-2
Hi Pieter,

>> That is something that has been discussed to be part of jack 2.0.
>> Disconnecting and reconnecting devices transparently without the
>> server crashing and apps loosing their connections.

> But for jack 2.0 I will personally make sure that this works, if only
> for the fact that we are faced with a rather similar issue.

I think there are a couple of different 'use cases' - there's the more
complex scenario where a user wishes to hot-unplug an interface and
hot-plug a different one, for example to increase the physical I/O count.

I was talking about a simpler case, featuring accidental disconnection
and reconnection of the same interface, maybe only for a few
milliseconds. Apart from loose USB or FireWire sockets, or a faulty
cable, there's also the scenario where an externally-powered interface
loses power for a short time. The laptop would keep going because of its
internal battery, but jackd would crash because the interface had been
power-cycled.

It's just something to think about for the future :-)

Cheers!

Daniel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Transient hot-disconnnect of USB devices causes JACK to crash

Fons Adriaensen-2
On Fri, Mar 28, 2008 at 02:10:55PM +0000, Daniel James wrote:

> It's just something to think about for the future :-)

It seems two steps are required to arrive at this:

1. Having a set of 'pseudo physical ports' that exist
independently of the backend, and that get mapped to
the real ones if and when these are available,

2. Having 'dummy mode' on stand-by all the time.

Having a reconfigurable 'patching' between what the user
sees as physical ports and the real ones would also help
to achieve portability of complex sessions between
different systems.

Ciao,

--
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Lascia la spina, cogli la rosa.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Transient hot-disconnnect of USB devices causes JACK to crash

lars.luthman (Bugzilla)

On Fri, 2008-03-28 at 15:46 +0100, Fons Adriaensen wrote:
> On Fri, Mar 28, 2008 at 02:10:55PM +0000, Daniel James wrote:
>
> > It's just something to think about for the future :-)
>
> It seems two steps are required to arrive at this:
>
> 1. Having a set of 'pseudo physical ports' that exist
> independently of the backend, and that get mapped to
> the real ones if and when these are available,

There should already be an empty port buffer that is used for
unconnected input ports - maybe that could be used?

> 2. Having 'dummy mode' on stand-by all the time.

Maybe just enter freewheeling mode when a hardware disconnect is
detected?


--ll

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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: Transient hot-disconnnect of USB devices causes JACK to crash

Fons Adriaensen-2
On Fri, Mar 28, 2008 at 03:51:58PM +0100, Lars Luthman wrote:
>
> > It seems two steps are required to arrive at this:
> >
> > 1. Having a set of 'pseudo physical ports' that exist
> > independently of the backend, and that get mapped to
> > the real ones if and when these are available,
>
> There should already be an empty port buffer that is used for
> unconnected input ports - maybe that could be used?

Unmapped port would need such a empty buffer, but
that's only part of the solution.
 
> > 2. Having 'dummy mode' on stand-by all the time.
>
> Maybe just enter freewheeling mode when a hardware disconnect is
> detected?

Probably not want you want. When a device is (e.g. accidentally)
disconnected and reconnected a few seconds later, you'd expect
the apps to have continued at their normal speed, not at maximal
speed. Dummy is like freewheeling, but at (near) normal speed.

Continuing the ideas above, it would be very convenient
if you could do this:

- Start jack without any hardware, but with some user defined
sample rate and having a user-defined number of 'hardware'
ports (i.e. the current dummy backend).

- Set up your session in this 'dummy mode'.

- When a hardware device is selected or becomes available
(depending on circumstances), the dummy ports are remapped
(using either rules or a stored per-device configuration)
to the hardware ports, and the hardware takes over the
timing.

- When the hardware disappears or is deselected, switch
back to the dummy mode.

Ciao,

--
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Lascia la spina, cogli la rosa.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel