Log the reason for every suspend/resume.

I was looking at a log that showed that a suspend happened (at
a strange time), but the log didn't tell me why the suspend was done.
This patch tries to make sure that that won't happen again.
This commit is contained in:
Tanu Kaskinen 2012-11-16 18:24:34 +02:00
parent 28c49a12fc
commit 0f44b1e820
12 changed files with 76 additions and 25 deletions

View file

@ -350,8 +350,10 @@ static void verify_access(struct userdata *u, struct device *d) {
/* If we are already loaded update suspend status with
* accessible boolean */
if ((card = pa_namereg_get(u->core, d->card_name, PA_NAMEREG_CARD)))
if ((card = pa_namereg_get(u->core, d->card_name, PA_NAMEREG_CARD))) {
pa_log_debug("%s all sinks and sources of card %s.", accessible ? "Resuming" : "Suspending", d->card_name);
pa_card_suspend(card, !accessible, PA_SUSPEND_SESSION);
}
}
}