jack_freewheel: doesn't help suspend/resume

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

jack_freewheel: doesn't help suspend/resume

ken restivo-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks like there's already a jack_freewheel utility in the jack examples that does exactly what I was looking for, even if it doesn't solve the problem I was trying to solve.

It is possible to kick jackd into freewheeling mode, then sleep and resume, then bringing jack back from freewheeling mode. But then no audio apps actually produce sound anymore. Several of them just hang.  And jackd loses its mind, with 99% CPU usage.

I suspect some interaction between jack and ALSA (I'm using a USB audio interface) will make suspend/resume impossible.

At sleep/wakeup time, ALSA unloads all its kernel modules, and then re-loads them. This probably causes jackd to disconnect from the audio interface. Even if it didn't do that, the USB layer disconnects and reconnects the devices. I doubt there's any facility within jackd to connect an already-running jackd to a new/different audio interface, so suspending/resuming a laptop running jackd will probably never work.

Oh well, it was worth a try.

- -ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGmoT7e8HF+6xeOIcRArzGAJ9aG+kLsx7e4EmG6J9iNZ2Ja3OmSACaA9B1
FyAGa34xVSoK0sTctPGrpc8=
=nCqS
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_freewheel: doesn't help suspend/resume

lars.luthman (Bugzilla)
On Sun, 2007-07-15 at 13:35 -0700, Ken Restivo wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Looks like there's already a jack_freewheel utility in the jack examples that
> does exactly what I was looking for, even if it doesn't solve the problem I
> was trying to solve.
>
> It is possible to kick jackd into freewheeling mode, then sleep and resume,
> then bringing jack back from freewheeling mode. But then no audio apps
> actually produce sound anymore. Several of them just hang.  And jackd loses
> its mind, with 99% CPU usage.
>
> I suspect some interaction between jack and ALSA (I'm using a USB audio
> interface) will make suspend/resume impossible.
>
> At sleep/wakeup time, ALSA unloads all its kernel modules, and then re-loads
> them. This probably causes jackd to disconnect from the audio interface. Even
> if it didn't do that, the USB layer disconnects and reconnects the devices. I
> doubt there's any facility within jackd to connect an already-running jackd
> to a new/different audio interface, so suspending/resuming a laptop running
> jackd will probably never work.
>
> Oh well, it was worth a try.
It would be very nice if it did work though. Maybe this calls for two
new API functions:

 void jack_suspend(jack_client_t);

    Fire off a signal to all clients, then stop the backend and
    disconnect from the hardware while maintaining all port
    connections.

 void jack_restore(jack_client_t);

   Reconnect to the hardware (with the exact same settings), fire off a
   new signal to all clients, then start the backend again.

It's not very nice if the whole thing dies when you suspend the
computer. Of course, there's always LASH, but even that doesn't restart
jackd itself with the same settings (and it shouldn't, since that would
make LASH sessions very unportable).


--ll



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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_freewheel: doesn't help suspend/resume

ken restivo-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Jul 16, 2007 at 12:15:51PM +0200, Lars Luthman wrote:

> On Sun, 2007-07-15 at 13:35 -0700, Ken Restivo wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Looks like there's already a jack_freewheel utility in the jack examples that
> > does exactly what I was looking for, even if it doesn't solve the problem I
> > was trying to solve.
> >
> > It is possible to kick jackd into freewheeling mode, then sleep and resume,
> > then bringing jack back from freewheeling mode. But then no audio apps
> > actually produce sound anymore. Several of them just hang.  And jackd loses
> > its mind, with 99% CPU usage.
> >
> > I suspect some interaction between jack and ALSA (I'm using a USB audio
> > interface) will make suspend/resume impossible.
> >
> > At sleep/wakeup time, ALSA unloads all its kernel modules, and then re-loads
> > them. This probably causes jackd to disconnect from the audio interface. Even
> > if it didn't do that, the USB layer disconnects and reconnects the devices. I
> > doubt there's any facility within jackd to connect an already-running jackd
> > to a new/different audio interface, so suspending/resuming a laptop running
> > jackd will probably never work.
> >
> > Oh well, it was worth a try.
>
> It would be very nice if it did work though. Maybe this calls for two
> new API functions:
>
>  void jack_suspend(jack_client_t);
>
>     Fire off a signal to all clients, then stop the backend and
>     disconnect from the hardware while maintaining all port
>     connections.
>
>  void jack_restore(jack_client_t);
>
>    Reconnect to the hardware (with the exact same settings), fire off a
>    new signal to all clients, then start the backend again.
>
> It's not very nice if the whole thing dies when you suspend the
> computer. Of course, there's always LASH, but even that doesn't restart
> jackd itself with the same settings (and it shouldn't, since that would
> make LASH sessions very unportable).
>
>

That would be sweet!

Sounds like the kind of thing which would be relatively straightforward to code, but a nightmare to test and troubleshoot, especially with all the different kinds of hardware out there.

- -ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGnSHCe8HF+6xeOIcRAip2AKDYaRJwZmF+zUG+zNaypV4NZ6kYKQCeOFYG
mk67DEDiuG1YpejC501nDAY=
=J/40
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_freewheel: doesn't help suspend/resume

torbenh
On Tue, Jul 17, 2007 at 01:08:34PM -0700, Ken Restivo wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, Jul 16, 2007 at 12:15:51PM +0200, Lars Luthman wrote:
> > On Sun, 2007-07-15 at 13:35 -0700, Ken Restivo wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Looks like there's already a jack_freewheel utility in the jack examples that
> > > does exactly what I was looking for, even if it doesn't solve the problem I
> > > was trying to solve.
> > >
> > > It is possible to kick jackd into freewheeling mode, then sleep and resume,
> > > then bringing jack back from freewheeling mode. But then no audio apps
> > > actually produce sound anymore. Several of them just hang.  And jackd loses
> > > its mind, with 99% CPU usage.
> > >
> > > I suspect some interaction between jack and ALSA (I'm using a USB audio
> > > interface) will make suspend/resume impossible.
> > >
> > > At sleep/wakeup time, ALSA unloads all its kernel modules, and then re-loads
> > > them. This probably causes jackd to disconnect from the audio interface. Even
> > > if it didn't do that, the USB layer disconnects and reconnects the devices. I
> > > doubt there's any facility within jackd to connect an already-running jackd
> > > to a new/different audio interface, so suspending/resuming a laptop running
> > > jackd will probably never work.
> > >
> > > Oh well, it was worth a try.
> >
> > It would be very nice if it did work though. Maybe this calls for two
> > new API functions:
> >
> >  void jack_suspend(jack_client_t);
> >
> >     Fire off a signal to all clients, then stop the backend and
> >     disconnect from the hardware while maintaining all port
> >     connections.
> >
> >  void jack_restore(jack_client_t);
> >
> >    Reconnect to the hardware (with the exact same settings), fire off a
> >    new signal to all clients, then start the backend again.
> >
> > It's not very nice if the whole thing dies when you suspend the
> > computer. Of course, there's always LASH, but even that doesn't restart
> > jackd itself with the same settings (and it shouldn't, since that would
> > make LASH sessions very unportable).
> >
> >
>
> That would be sweet!
>
> Sounds like the kind of thing which would be relatively straightforward to code, but a nightmare to test and troubleshoot, especially with all the different kinds of hardware out there.

you can use netjack... ( i guess it needs minimal hacking to reduce the
latency to zero. and you would need to make the jacknet_client block on
the wait for the return packet.

but as long as you can disable the watchdog jackd -dnet just waits for
incoming network packets.

and while your at it you can add multiuser jack also.

so you can just exchange the jackd -dalsa for a jackd -ddummy or
whatnot while offline...
if you do this programmatically you even to this without deactivating
the watchdog.


--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_freewheel: doesn't help suspend/resume

lars.luthman (Bugzilla)
On Wed, 2007-07-18 at 05:43 +0200, [hidden email] wrote:

> On Tue, Jul 17, 2007 at 01:08:34PM -0700, Ken Restivo wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Mon, Jul 16, 2007 at 12:15:51PM +0200, Lars Luthman wrote:
> > > On Sun, 2007-07-15 at 13:35 -0700, Ken Restivo wrote:
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA1
> > > >
> > > > Looks like there's already a jack_freewheel utility in the jack examples that
> > > > does exactly what I was looking for, even if it doesn't solve the problem I
> > > > was trying to solve.
> > > >
> > > > It is possible to kick jackd into freewheeling mode, then sleep and resume,
> > > > then bringing jack back from freewheeling mode. But then no audio apps
> > > > actually produce sound anymore. Several of them just hang.  And jackd loses
> > > > its mind, with 99% CPU usage.
> > > >
> > > > I suspect some interaction between jack and ALSA (I'm using a USB audio
> > > > interface) will make suspend/resume impossible.
> > > >
> > > > At sleep/wakeup time, ALSA unloads all its kernel modules, and then re-loads
> > > > them. This probably causes jackd to disconnect from the audio interface. Even
> > > > if it didn't do that, the USB layer disconnects and reconnects the devices. I
> > > > doubt there's any facility within jackd to connect an already-running jackd
> > > > to a new/different audio interface, so suspending/resuming a laptop running
> > > > jackd will probably never work.
> > > >
> > > > Oh well, it was worth a try.
> > >
> > > It would be very nice if it did work though. Maybe this calls for two
> > > new API functions:
> > >
> > >  void jack_suspend(jack_client_t);
> > >
> > >     Fire off a signal to all clients, then stop the backend and
> > >     disconnect from the hardware while maintaining all port
> > >     connections.
> > >
> > >  void jack_restore(jack_client_t);
> > >
> > >    Reconnect to the hardware (with the exact same settings), fire off a
> > >    new signal to all clients, then start the backend again.
> > >
> > > It's not very nice if the whole thing dies when you suspend the
> > > computer. Of course, there's always LASH, but even that doesn't restart
> > > jackd itself with the same settings (and it shouldn't, since that would
> > > make LASH sessions very unportable).
> > >
> > >
> >
> > That would be sweet!
> >
> > Sounds like the kind of thing which would be relatively straightforward to code, but a nightmare to test and troubleshoot, especially with all the different kinds of hardware out there.
>
> you can use netjack... ( i guess it needs minimal hacking to reduce the
> latency to zero. and you would need to make the jacknet_client block on
> the wait for the return packet.
>
> but as long as you can disable the watchdog jackd -dnet just waits for
> incoming network packets.
>
> and while your at it you can add multiuser jack also.
>
> so you can just exchange the jackd -dalsa for a jackd -ddummy or
> whatnot while offline...
> if you do this programmatically you even to this without deactivating
> the watchdog.
Switching backends on the fly could be very useful for other things as
well (e.g. starting with an ALSA backend for the soundcard, switching to
another ALSA backend for an USB microphone while recording from that (to
avoid any resampling jitter added by alsa_in, even if it's minimal)),
and then switching back when done recording.


--ll

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment