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

Unload problematic modules automatically (PulseAudio) & Improve Multi-Threading #268

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Curve
Copy link
Member

@Curve Curve commented Jun 18, 2021

This PR implements some changes on how we handle problematic modules proposed by @D3SOX.

The Problem

Currently we only detect if the switch-on-connect module is loaded and if so we prompt the user to unload it.
However the module role-cork is also causing problems.
Adding a detection for that modules would require us to show the user yet another prompt.

This may impact users differently:

  • Users without much knowledge
    • May be intimidated by a big red prompt telling them they have to unload the module
  • Users that don't want to permanently disable the module / Users that don't know how to (in case they didn't read our wiki entry regarding this issue)
    • Always have to click through the prompts on start up and are required to reload the modules themselves after soundux exits

Proposed Solution

Our proposed solution is to automatically unload those modules from soundux and reload them once soundux exits.
That way the user is not required to click through dozens of prompts to use the application and continue to make use of the problematic modules after soundux exits.

Possible Improvements

  • Notify the user about what we do, in form of a prompt in the frontend (@D3SOX ?) - So that the user doesn't experience problems without knowing where they come from (in this case they may be caused because we unloaded some modules)

This change will unload all problematic PulseAudio modules automatically and reload them when soundux exits
@Curve Curve added enhancement New feature or request backend Something that needs to be changed in the backend linux Something that's specific to linux labels Jun 18, 2021
@Curve Curve requested a review from D3SOX June 18, 2021 20:07
@Curve Curve self-assigned this Jun 18, 2021
@Curve Curve added this to the 0.3.0 milestone Jun 18, 2021
chore(deps): update lockpp, webviewpp
refactor: UI now holds all playingSounds
refactor: PlayingSound now provides methods to pause/resume/setVolume ...
refactor: make PlayingSound manage mutexes instead of gAudio
@Curve Curve changed the title Unload problematic modules automatically (PulseAudio) Unload problematic modules automatically (PulseAudio) & Improve Mutli-Threading Jun 25, 2021
@Curve
Copy link
Member Author

Curve commented Jun 25, 2021

I just pushed another change that greatly improves Mutli-Threading, however it's not yet fully complete.

The Problem

The program would often dead-lock and the mutex-code was really messy.

Proposed Solution

  • Update lockpp to make mutex-access more explicit.
  • Make PlayingSound hold and control it's own mutexes (This was previously done by gAudio), that way we greatly improve the messy code
  • Rethink the Multi-Threading

Further (required) improvements

  • Adjust Windows Code to new changes
  • Adjust gData to new changes

@D3SOX D3SOX changed the title Unload problematic modules automatically (PulseAudio) & Improve Mutli-Threading Unload problematic modules automatically (PulseAudio) & Improve Multi-Threading Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Something that needs to be changed in the backend enhancement New feature or request linux Something that's specific to linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant