-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volume Control Behaviour #99
Comments
This is very strange. There is no code in PulseEffects that would set it as fallback device. I only read pulseaudio default device setting. I do not write anything to it. I also use gnome (3.26) and I have media keys in my keyboard. Everything is fine here. Volume keys control the built-in analog device and not PulseEffects(apps). I am using Arch Linux. What is the log printed by PulseEffects when this strange behaviour happens? |
Did you try to remove the files under |
I also have an issue like this, both in PulseEffects and my script https://github.com/mikhailnov/dumacast |
@wwmm please post your system-wide and user config of PulseAudio to compare it with the one in Ubuntu 17.10 (I developed Dumacast on and for Ubuntu 16.04 and do not remember such problems) |
|
I launch Dumacast https://github.com/mikhailnov/dumacast/blob/master/usr/bin/dumacast , it creates the sink null1, and PulseAudio thinks that it's a default output device, but my script does not make it default (lines 135-149)! |
@wwmm it must be easy to downgrade PulseAudio to version 10 on Arch to try to reproduce this bug to make sure that Pulseaudio is to be blamed |
Unfortunately it will not be so easy to downgrade Pulseaudio. I don't have the old version anymore in my cache. In any case I used Pulseaudio 10 for a few months and I never saw any of the PulseEffects sinks becoming default devices automatically. |
daemon.conf
|
Sorry for the delay. I spent some time debugging this, and determined that it is being caused by the module-switch-on-connect module which, as of Ubuntu 17.10, is now activated by default. The purpose of this module is to "Use hot-plugged devices like Bluetooth or USB automatically." Apparently it is detecting the new PulseEffects virtual devices as real ones, and automatically switching to them. I simply copied my /etc/pulse/default.pa into ~/.config/pulse and commented out the module and this appears to have solved the issue for me. I would say that this is an Ubuntu bug, but might be worth adding to the FAQ. |
It is not only worth to be in the FAQ it has to be there. This explains lots of problems that users have reported over time that I was never able to reproduce. There is no way PulseEffects will work well with this module loaded. As Arch Linux does not enable this module it never crossed my mind to think about it as cause for this kind of problem |
I have just packaged PulseEffects for Mageia and have a 'similar' although not identical issue. |
Just to be sure could you run the command In any case something outside of PulseEffects is changing the device it should be recording from. Run PulseEffects in a terminal and post here its output when this problem happens. It may help to figure out what is happening |
The outputs requested are below. ############################################### Requires: gstreamer1.0-python >= 1.12 ####################################### 25 module-x11-xsmp display=:0 session_manager=local/jackodesktop:@/tmp/.ICE-unix/4155,unix/jackodesktop:/tmp/.ICE-unix/4155 ############################################## 14:44:58.741 - PulseEffects - INFO - pulseaudio context started (pulseeffects:29037): Gtk-WARNING **: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node block, owner GtkLevelBar) |
I know nothing about meson, however I don't see any mention of ladspa in the build log or in meson.build so is it tested for? |
I did not understand the
@AsavarTzeth can tell you more about meson but what it is doing is using pkg-config to find dependencies. Run the command Assuming you have installed the ladspa swh-plugins the errors about the limiter and the compressor are probably related to missing gstreamer-plugins-bad files. Check which package has the file As far as I know there is nothing in the output of |
I see nothing in PulseEffects log that could give a hint about the source of the problem :-( But if PulseEffects is recording from |
Thanks, and sorry for the confusion. Requires: python3-numpy >= 1.13 Could you please confirm that gstreamer-plugins-good is also required? Regarding the recording source issue, I will try the approach used by hackel above and play with the enabled modules while trying to understand the docs :\ |
gstreamer-plugins-good is a dependency. The equalizer plugin is in this package for example Something you may try is testing in a new user account and see if there is any change. This should remove user config out of the equation. But system wide configs or services will still take place. Another test you could try is running in a different desktop like xfce or gnome and see if there is any difference. As I only use gnome it is possible that there is something specific to kde I am not aware of. |
Thanks - I thought so - I have added it. |
I just tried a 'clean' second user and the issue is there too, and on returning to my normal user that too is broken again, so whatever changed to fix it in the debugging session did not survive a log-in/out. |
It is strange that there are sinks left once PE was closed. But this should not be a problem as I check if the sinks are already loaded and if yes I just use them. I do not let Pulseaudio auto select source because this would not make sense in PE. The effects are being applied by a gstreamer pipeline that has a |
I have just remembered that a user had a similar issue a long time ago like you can see here #1. At that time I asked him to run a test code that should mimic PulseEffects behavior. Try the following: close PulseEffects and run: Put this code in a file test.py and run it:
While the program is running open pavucontrol and see if it is recording from To unload the null sink created for the test run |
At least for that user the test code was also recording from the wrong device despite of the line At the time this user tried to open a bug report in gstreamer https://bugzilla.gnome.org/show_bug.cgi?id=783464 but as he did not know how to do it properly things did not go further. And as I never could reproduce this issue in any of my machines I should not be the one taking this bug report forward. |
Running test.py the Recording tab shows 'Built-in Analogue Audio Stereo' selected, and 'Monitor of test' is available as an option. |
If possible show him the test code. It should help him figure out why some installations are obeying the set device properties and others are not. He probably can also tell if this is something that should be investigated by gstreamer developers instead of pulseaudio developers. |
I asked him to look here and sent PA debug logs of a case where test.py works and one where it fails which are here for your reference: |
The links are not working |
That should have been the Stop button in Clementine not the Pause button. Pause does not drop the stream, Stop does. |
Hi - tanuk created a large patch for PA that creates more detailed debugging output. The link below is from running puseaudio-11.1 patched with the extra debugging, during a run of test.py where the wrong recording source was shown in pavucontrol. |
This log is quite helpful although the source of the problem is still a mystery. I will detail here what I have found. First we have:
This means that something was using the
This
Now we have to understanding why the test code is being moved from the correct device. Did you run the test code with pulseeffects opened or closed? It should not be a problem but it is best to limit the number of variables |
I ran the test code with pulseeffects opened and it is not a problem. I see |
I am wondering if this could be somehow related to kde phonon. I haven't used kde in a while But I remember it was possible to set default devices for playback and recording in phonon. Maybe he is the one moving recording applications to alsa_input.pci-0000_00_1b.0.analog-stereo |
Yes - I think so. Regarding "Did you run the test code with pulseeffects opened or closed?" I'm not sure what you mean. I rebooted, loaded module-null-sink, started PE, started test.py, opened pavucontrol and checked that the recording source was not PE, allowed test.py to time out and copied the log over, before shutting down PE. |
/OT |
I asked if PE was running just to rule it out as possible cause of the moving. But it is clear now that something is odd in phonon. What is quite sad. It makes sense that PE is not shown as a recording source in phonon. After all PE is not a source but it is a sink where apps can play sound. What I think it is happening is that phonon is automatically moving all recording apps to the default source. As PE applies effects using a gstreamer pipeline that should be recording from our null sink monitor and not from the system default source phonon is breaking us. I am not sure how we can fix this in kde. Maybe it would be good to contact a kde developer. Clementine is probably recreating its stream. This will make the sink input related to it to also be recreated and in the end the behavior is the same as having a new app. Run PulseEffects in service mode that it will automatically switch on when the main window is closed. |
I will install clementine here and take a look at its behavior |
Here clementine is kept switched on when I click stop and play again after it has disappeared from PE window. No need to run in service mode. Which clementine version are you using? I have 1.3.1 and it is working fine |
I forgot to tell you how to run in service mode https://github.com/wwmm/pulseeffects/wiki/Command-Line-Options. But at least here no need to use that. Clementine is fine |
Pulseaudio is supposed to remember the last sink used by audio applications. As long as PulseEffects null sinks are kept loaded between applications restarts they will be switched on automatically. So what may be happening in you setup is that pulseaudio is not remembering the last used sink as it should be |
This is a bug in PulseAudio, in module-device-manager. The reason why this doesn't happen on non-KDE systems is that module-device-manager is only loaded when using KDE (see /usr/bin/start-pulseaudio-x11). When an application requests a specific device when creating a stream, module-device-manager will let the application use that device initially, but it doesn't remember that the stream had "special" routing that shouldn't be changed. There are many situations where module-device-manager will check the stream routing and move streams if their routing doesn't match what module-device-manager thinks the routing should be. An extra bit of information should be added to the internal stream state: "this stream is routed according to the application's request". When that bit is set, module-device-manager should refrain from moving the stream. If the stream is moved for any reason (e.g. requested by user), then that bit should be cleared, since the initial routing isn't relevant any more. |
I can confirm that with the relevant line removed from /usr/bin/start-pulseaudio-x11 it is now behaving the same in plasma5 as in Mate. |
@tanuk |
I submitted patches for fixing the PulseAudio bug: https://patchwork.freedesktop.org/series/34558/ I haven't tested the patches, can you do that? The reason why KDE uses module-device-manager is that its UI for configuring audio device priorities depends on that module. |
I forgot that I should have rebased the patches on the 11.1 release. Here are the patches rebased: https://cgit.freedesktop.org/~tanuk/pulseaudio/log/?h=device-manager-fix I'll also send the patches to @barjac like I did with the logging patch. |
Brilliant, stupendous, fantastic! |
Ok. I think that tanuk patches to |
What is the status of upstream changes in PulseAudio to properly handle the problem with virtual sinks and module-switch-on-connect? |
Pulseaudio git repository has the fixes for the modules pulseaudio/pulseaudio@e083357 I imagine that the next Pulseaudio version will have them |
Thanks for the information. |
I confirm it's fixed in PulseAudio 12.0 If you want to try PulseAudio 12.0 instead of Ubuntu's 11.1, use ppa:mikhailnov/desktop1-dev
In this testing PPA:
|
One thing I've noticed with PulseEffects 3+ under Ubuntu 17.10 (Gnome Shell) is that, when I activate PE, it changes which output device my system volume control (hotkeys or the volume slider in the gnome-shell menu) responds to. Normally, it controls the "Built-in Audio Analogue Stereo" hardware device. When I enable PE, the volume control switches over to the "PulseEffects(apps)" virtual device, which is set at 100%. Changing this volume causes a very noticeable static sound each time, and there's no way to turn the volume up above 100%. In pavucontrol, I can see that "PulseEffects(apps)" is set as the "fallback" device. If I change this back to "Built-in Audio Analogue Stereo", then audio continues playing through PE, but my volume controls the hardware device as expected.
The text was updated successfully, but these errors were encountered: