Skip to content
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

Allow specifying application name in PulseAudio context creation #81

Closed
flying-sheep opened this issue Apr 21, 2020 · 2 comments · Fixed by #82
Closed

Allow specifying application name in PulseAudio context creation #81

flying-sheep opened this issue Apr 21, 2020 · 2 comments · Fixed by #82

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Apr 21, 2020

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:

self.context = _pa.pa_context_new(self.mainloop_api, b"audio")

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

@bastibe
Copy link
Owner

bastibe commented Apr 21, 2020

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.

@flying-sheep
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants