Ticket #880 (new defect)

Opened 18 months ago

Last modified 18 months ago

pasuspender should trap SIGINT

Reported by: heftig Owned by: lennart
Milestone: Component: clients
Keywords: Cc:

Description

Currently running something like this:

  pasuspender -- jackd -d alsa

And interrupting it via Ctrl+C will end jackd, but not resume PulseAudio.

Change History

Changed 18 months ago by coling

I suspect the ctrl+c is affecting pasuspender and thus it's not cleaning up nicely when jackd exists.

Try something like:

$ pasuspender bash
$ jackd -d alsa
ctrl+c
$ exit

As that should allow pasuspender to exit cleanly (ie. not interrupted via ctrl+c) and release the devices properly.

I just tested that here and it seems to work fine, so I think this isn't a major problem.

It arguably should trap sigint and pass it on to the app it's running but then by the same token should we really try to trap all signals in this way or only sigint?

Changed 18 months ago by heftig

I believe it should trap all signals (as possible) that would cause it to exit, and shut down cleanly if signaled (resuming PulseAudio).

Changed 18 months ago by caiiiyua

I also tested this issue on my ubuntu 10.10 with PulseAudio 0.9.21 and it seems work well too.

here is the log of PA:

I: client.c: Created 9 "Native client (UNIX socket client)"
D: protocol-native.c: Protocol version: remote 16, local 16
I: protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
D: protocol-native.c: SHM possible: yes
D: protocol-native.c: Negotiated SHM: yes
D: module-augment-properties.c: Looking for .desktop file for pasuspender
D: protocol-native.c: Suspending all sinks
D: protocol-native.c: Suspending all sources
I: client.c: Created 10 "Native client (UNIX socket client)"
I: client.c: Freed 10 "Native client (UNIX socket client)"
I: protocol-native.c: Connection died.
D: module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: protocol-native.c: Resuming all sinks
D: protocol-native.c: Resuming all sources
I: client.c: Freed 9 "pasuspender"
I: protocol-native.c: Connection died.

I did:

momo@momo-laptop:~$ pasuspender bash
momo@momo-laptop:~$ jackd -d alsa
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
....
^Cjack main caught signal 2
momo@momo-laptop:~$ exit
exit
momo@momo-laptop:~$ 

By the way,I guess trap signals like SIGINT and SIGTERM,etc are enough to make a clean exit.

Changed 18 months ago by coling

Yeah that workaround pretty good. I have had similar problems in the past to be honest but never thought them really worth fixing as the end goal is obviously to not need pasuspender except for debugging, but I agree it would be nice if the signals were handled properly.

In the case of jack, I believe jack should talk over dbus and ask PA to release the audio device it wants to open and PA will comply. So using pasuspender with jack should not be necessary in the general case when jack has dbus support.

Note: See TracTickets for help on using tickets.