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

Rewrite audio system using libcrossaudio #5408

Open
Krzmbrzl opened this issue Jan 8, 2022 · 5 comments
Open

Rewrite audio system using libcrossaudio #5408

Krzmbrzl opened this issue Jan 8, 2022 · 5 comments
Labels
audio client code feature-request This issue or PR deals with a new feature

Comments

@Krzmbrzl
Copy link
Member

Krzmbrzl commented Jan 8, 2022

Context

The currently used audio system in the client is rather messy and has quite a few quirks that can't be easily fixed.
On top of that the code itself is written in a pretty bad style that makes it rather hard to grasp what is going on.

Description

For this reason, the audio handling should be rewritten from scratch and while doing so, special attention should be paid to fixing the currently experienced audio issues.

Mumble component

Client

OS-specific?

No

Additional information

The current issues that need to be fixed are:

On the code side, we should

  • get rid of goto statements
  • split processing into smaller functions
  • Use smart-pointers
  • Use more descriptive variable names
  • Don't use global variables (that much)
  • Don't use magic & hardcoded numbers; prefer named constants

Furthermore:

@vimpostor
Copy link
Contributor

Also a rather controversial design decision is that the Audio backend can be different for output and input. Is there actually any usecase for this? This does not only complicate the code but it also is unintuitive for the user, as you have to change the backend in the settings twice (unless using the Audio wizard).
Is there anyone that actually uses different backends? Otherwise I would vote to remove this implementation detail, which would also allow to make other things easier such as registering Mumble as a single node (with input and output ports) in the Pipewire/Jack node graph, instead of registering two nodes with one having the input ports and the other the output ports.

@TerryGeng
Copy link
Contributor

TerryGeng commented Jan 18, 2022

I agree with @vimpostor 's idea. In fact, the separation of the backend for input and output is not very compatible with macOS, especially when it comes to the native echo cancellation of Mac...

The biggest barricade is (and has always been the case for audio-related challenges): our current audio system supports so many backends and so many OSs, which make refactoring a daunting task in general. I think perhaps someone in Mumble team should take the lead and print out a general roadmap and structure, so other volunteers may easily catch up and start to work on a very specific backend/OS.

@davidebeatrici
Copy link
Member

The backend separation was extremely useful on Linux before PipeWire became a thing: it was not rare to see JACK as input and PulseAudio as output.

Right now I can only think of Windows with WASAPI + ASIO as a reason for the feature to exist, but as far as I know it's not an ideal setup anymore now that WASAPI itself can deliver low latency (related: #3503).

@AtmanActive
Copy link

One extremely useful feature for me is the ability to use two distinct audio devices via WASAPI, one for input, the other for output, each with it's own bitrate/depth and have Mumble work flawlessly with it.

@Krzmbrzl
Copy link
Member Author

Krzmbrzl commented Feb 9, 2023

@davidebeatrici davidebeatrici changed the title Rewrite audio system Rewrite audio system using libcrossaudio Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio client code feature-request This issue or PR deals with a new feature
Projects
None yet
Development

No branches or pull requests

5 participants