pasuspender does not stop alsa-lib from defaulting to pulseaudio plugin

Bug #944295 reported by max ulidtko
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
alsa-plugins (Ubuntu)
Expired
Wishlist
Unassigned
pulseaudio (Ubuntu)
Expired
Wishlist
Unassigned

Bug Description

Steps to reproduce:
1. Run an application continuously playing audio, music player for example.
2. Launch in a terminal: pasuspender speaker-test
3. While 2) is running, launch in another terminal: pasuspender sleep 1, and wait while it finishes.

What happens:
2. a) The usual pulseaudio streams stop playing, which is expected.
    b) But the speaker-test produces no output, which is contrary to the expected effect.
3. a) While the first pasuspender instance is still running, the sound from music player resumes, which is not what is expected.
    b) Moreover, the "pasuspended" speaker-test pink noise resumes with the music player, too. Which is not what is expected, too.

Tags: patch
Revision history for this message
Antony Riley (antony-cyberiantiger) wrote :

Speaker-test writes to the default alsa device, which happens to be the alsa-pulseaudio bridge, which explains why you get no output from it, and then when sound resumes you get output.

Consider the following:

pasuspender -- speakertest -Dplug:front

This should work as you expect.

(It would be great if pasuspender disabled the alsa-pulse bridge).

3 a) is kinda obvious, pasuspender was never intended to have multiple copies running, because it's expected whatever you're running under it will lock the sound card exclusively. Making running another copy of pasuspender in parallel something outside of the designers expectations.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
Antony Riley (antony-cyberiantiger) wrote :

This has been pissing me off for some time, there are two possible workaround I can think of:

- fix libasound_module_conf_pulse.so so that if an application is running under pasuspender it does not load pulse devices into alsa.

I've implemented a rough hack so pasuspender sets the environment variable PASUSPENDED and add a check in libasound_module_conf_pulse.so

Revision history for this message
Antony Riley (antony-cyberiantiger) wrote :
affects: pulseaudio (Ubuntu) → alsa-plugins (Ubuntu)
affects: alsa-plugins (Ubuntu) → pulseaudio (Ubuntu)
Revision history for this message
David Henningsson (diwic) wrote :

Hmm, interesting. So the idea is to not have alsa default to pulseaudio, if we're inside a pasuspender shell?

If so, I think what you want to modify pulse/conf_pulse.c, function "conf_pulse_hook_load_if_running", in alsa-plugins, which controls whether ALSA tries to load the pulse plugin or not.

summary: - pasuspender tool doesn't work
+ pasuspender does not stop alsa-lib from defaulting to pulseaudio plugin
Changed in alsa-plugins (Ubuntu):
importance: Undecided → Wishlist
Changed in pulseaudio (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch against pulseaudio" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Mike Mestnik (cheako) wrote :

ubuntu-reviewers :
  I think this patch can be ignored, no offense to Antony, it is not ready to be included or used in it's current state.

Revision history for this message
Mike Mestnik (cheako) wrote :

I believe there are two changes that should be made.

The most obvious is that "conf_pulse_hook_load_if_running" needs to connect to PA and confirm it's really running, in that specifically if it's suspended or not. I believe it would be fine if PA was suspended for another reason for applications to 'skip' trying to use it. These should be rare cases and what's the worst that could happen? My though is that an application, like xmms, will start using the hardware and PA won't ever be able to get it back. However, after the unsuspend, applications will start transitioning back to PA... Even with xmms still hogging the HW sink.

The second change is for PA to reject a second attempt to suspend, this should be an error or warning that pasuspender should handle with a stop and exit without running the application it was supposed to. An issue here is that if PA is suspended for another reason, but that's up to the user to discover and fix.

Revision history for this message
Raymond (superquad-vortex2) wrote :

THis hack seem prevent any application use snd_ctl_open() hw:0 only

alsa-lib/test/control fail with card zero only but other card number are o.k.

Revision history for this message
Raymond (superquad-vortex2) wrote :

alsa-lib/test/control can be run normally by rename /use/share/alsa/alsa.conf.d/pulse.conf

YEAHBOY (ariesallic-016)
Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-plugins (Ubuntu):
status: New → Confirmed
YEAHBOY (ariesallic-016)
Changed in alsa-plugins (Ubuntu):
assignee: nobody → YEAHBOY (ariesallic-016)
Changed in pulseaudio (Ubuntu):
assignee: nobody → YEAHBOY (ariesallic-016)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If anyone can still reproduce this bug then please help us by running:

apport-collect 944295

to send more system information.

Changed in alsa-plugins (Ubuntu):
status: Confirmed → Incomplete
assignee: YEAHBOY (ariesallic-016) → nobody
Changed in pulseaudio (Ubuntu):
assignee: YEAHBOY (ariesallic-016) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pulseaudio (Ubuntu) because there has been no activity for 60 days.]

Changed in pulseaudio (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for alsa-plugins (Ubuntu) because there has been no activity for 60 days.]

Changed in alsa-plugins (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.