mumble-voip / mumble

Mumble is an open-source, low-latency, high quality voice chat software.
https://www.mumble.info
Other
6.41k stars 1.12k forks source link

[jack output] use one port per user in the channel #3686

Open Yamakaky opened 5 years ago

Yamakaky commented 5 years ago

We use Mumble to record the audio in a channel for live - podcasting, with transmission via jack to liquidsoap for processing. The major downside is that all the voices are mixed. I would like to add effects per voice, like compression and equalizer.

The solution that I think would be the most practical would be for Mumble to use a dedicated jack port per user. It could be named with the username, a user ID...

Would that be possible to implement?

davidebeatrici commented 5 years ago

Totally possible.

Yamakaky commented 5 years ago

Nice! My c++ is a bit rusty, but I can try. Do you have some pointers on where I could start?

davidebeatrici commented 5 years ago

Sure!

  1. Change the JACK backend (src/mumble/JackAudio.cpp/h) so that it doesn't use an hardcoded number of channels (currently 1 or 2).
  2. Add two new functions to our audio output backend system (src/mumble/AudioOutput.cpp): one called when a user connects to the channel and one when a user disconnects. They are required in order to keep the number of JACK ports synced with the number of users in the channel. Ideally, the username should be passed to the functions, that way each port can be named accordingly (as you proposed) and we can keep track of the port <-> user relation.
  3. Change the audio mixing behavior in the following function: https://github.com/mumble-voip/mumble/blob/d7378675f46afa4ab5549514781fd3ae6f4dfffe/src/mumble/AudioOutput.cpp#L355-L580
  4. Add a setting in the audio output dialog to toggle the new feature (different audio mixing behavior and number of JACK ports synced to the number of users).
gilou commented 4 years ago

This would definitely make mumble the first candidate for duplex/remote situations, so we can use a proper mixer to handle each speaker...