Bug 102205

Summary: Unloading module-stream-restore and immediately loading it again fails
Product: PulseAudio Reporter: Colin Chan <kalgynirae>
Component: toolsAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Sample commands and corresponding logs from pulseaudio -vvvvv

Description Colin Chan 2017-08-14 05:58:51 UTC
Created attachment 133481 [details]
Sample commands and corresponding logs from pulseaudio -vvvvv

This command succeeds (no output, module is unloaded and loaded again):

  $ pacmd unload-module module-stream-restore; pacmd load-module module-stream-restore

This command fails (error message and module is only unloaded):

  $ pacmd <<EOF
  > unload-module module-stream-restore
  > load-module module-stream-restore
  > EOF
  Module load failed.

From the `pulseaudio -vvvvv` logs, it looks like the load-module tries to occur *before* the unload happens; I see the message “Module "module-stream-restore" should be loaded once at most.  Refusing to load.”

I have attached the full logs from running both of these examples. The reason I am trying to do this is that I want to reload the module with different options in my default.pa (the module is already loaded because I .include the system-wide default.pa).

This is pulseaudio 10.0 on Arch Linux.
Comment 1 Tanu Kaskinen 2017-08-18 06:39:59 UTC
The code that handles commands from pacmd and default.pa doesn't unload modules immediately. That's probably easy to fix, it just needs to be tested that running "pacmd unload-module module-protocol-cli-unix" doesn't crash the server, since that command will unload the code that is processing the command. But I think it will be fine.
Comment 2 Tanu Kaskinen 2017-08-18 07:08:21 UTC
I sent a patch to the mailing list:
https://patchwork.freedesktop.org/patch/172324/
Comment 3 Tanu Kaskinen 2017-08-20 06:53:54 UTC
The patch is now in the "next" branch. Closing bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.