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

Audio: Sync while popup is opened #337

Open
leb-kuchen opened this issue Apr 7, 2024 · 3 comments
Open

Audio: Sync while popup is opened #337

leb-kuchen opened this issue Apr 7, 2024 · 3 comments

Comments

@leb-kuchen
Copy link
Contributor

Currently pulse audio is synced at every toggle and there is no subscription.
The disadvantages are that an audio device may be disconnected or the volume is changed with keybindings. Also more complex features, like sink inputs can be become quite surprising, as users may try to change the volume of a removed sink input.
I do not know, if this is possible with the standard mainloop, though the threaded mainloop is not as efficient and 2 threads are spawned.

@ids1024
Copy link
Member

ids1024 commented Apr 8, 2024

https://github.com/pop-os/cosmic-osd/blob/master/src/subscriptions/pulse.rs has a subscription for monitoring volume changes. That code should probably be moved somewhere and shared in the applet.

@leb-kuchen
Copy link
Contributor Author

The applet also listens for messages from the GUI, so it's not a main loop run. Or are you thinking about 2 subscriptions?

@leb-kuchen
Copy link
Contributor Author

The alternative would be doing something like https://github.com/jantap/rsmixer/blob/master/src/pa/pa_interface.rs, if you wanted a single subscription.

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

No branches or pull requests

2 participants