Closed flying-sheep closed 4 years ago
We hat multiple contexts for a while, but they caused problems. Apparently, pulse can get rather unstable if too many contexts are created. So we'll have to make do with a single context for now.
Would you like to create a pull request for changing the context name with a global function? I am a bit weary of including new features if they are only implemented in one platform, but you have to start somewhere.
Alternatively, it might be possible to implement this in your own code, by adding a the pa_context_set_name
manually with an additional _ffi.cdef
and re-opening _ffi.dlopen('pulse')
before using the library.
Panon directly imports and uses the pulseaudio backend, so I wasn’t aware that there’s an abstraction. Sure, I can try my hand at it!
Hi, I’m using the audio visualizer panon. Panon uses this project to grab audio data from a monitor of the current output.
My desktop, KDE Plasma, shows a little microphone symbol when something is using a microphone or monitor. Hovering it while panon is running says “audio is using the microphone”*, with the “audio” part being pretty confusing, and possibly scary for people using panon.
I grepped your source code to find out that you hardcode this string in your
_PulseAudio
backend class:https://github.com/bastibe/SoundCard/blob/08cb467a6421c2cdf273fe55c4f1f5b9303d8d5b/soundcard/pulseaudio.py#L66
Could you please make it configurable so applications using this project can tell PulseAudio their name? Optimally this would mean that multiple contexts can be created, but using
pa_context_set_name
for the global context is probably sufficient for most applications.*The fact that using a microphone symbol and message is wrong when using a monitor is besides the point here, but tracked in KDE bug 410637 if anyone is interested