jamulussoftware / jamulus

Jamulus enables musicians to perform real-time jam sessions over the internet.
https://jamulus.io
Other
997 stars 222 forks source link

Separate sound card input and output selection #681

Closed kwindrem closed 3 years ago

kwindrem commented 3 years ago

The soundcard list can get extremely long if more than a couple of soundcards are active. This is because the list is build for all combinations of input and output soundcards. For example, if there are 4 sound cards, the list has 16 entries. Selecting the proper one in the list is error prone. I suggest the sound card selection be split into separate input and output selections.

After further thought, I've had some additional ideas that change the device selection and interaction with Audio Channels. These proposed changes not only make sound card configuration easier and less error prone, but provide some additional functionality.

Proposal:

The Soundcard area of the Settings dialog is changed as shown in the attached image.

U:I changes.pdf

The single Device selection is split into separate Input Device and and Output Device drop-downs which reduces the number of choices significantly. (The current Device list includes every combination of all input and output devices which can grow to 40 or more choices. The new lists would be only 6-7 or so each for the same 40 combinations.) The Input Channel Mapping and Output Channel Mapping drop-downs are shown even if the device only has one or two channels. "None" is added to the channel lists indicating that no audio interface will be routed to that specific input or output channel.

A "Mono" check box is added next to each pair of channel selectors.

For the Input Device if Mono is selected, the active channels are summed to mono and sent to the Jamulus server as mono. This is identical behavior to the Audio Channels: Mono or Mono in/Stereo out mode.

If Input Device Mono is unchecked, the left and right channels are sent to Jamulus independently. If one of the channels is set to None then silence is sent for that channel.

For the Output Device if Mono is checked, the Jamulus mixer output is summed to mono and sent to the active output channels.

If the Output Device Mono is not checked, the Jamulus mixer routes a stereo signal to the selected channels.

What happens if either the left or right Output Device channels are set to None? There are two possibilities. The mixer could simply drop the "None" channel; or the mixer could act as if Mono were checked.

The next change to the user interfaces is to eliminate the Audio Channels selection in the Misc section. The Audio Channels selection provides 3 of the 4 selections possible with separartete input/output Mono check boxes. (Stereo in/Mono out is missing and could be added.) I belive sepatate input and output mono selections is easier to understand. Because of other interactions, I feel the correct place for the Mono check boxes is in the Soundcard area as I've drawn it.

The remainder of the Soundcard area remains unchanged.

When selecting an Input Device or Output Device, the L and R selectors are set to 1 and 2, respectively even if there are additional channels. This means that for simple setups the user doesn't need to make channel selections. Some audio interfaces only have one input. If such a device is selected, the L and R selections would both be set to 1. This says that mono source would appear in the center of the sound image.

Other abnormal but potentially useful settings:

Setting R to None and NOT checking Mono, would result in the left source appearing only on the left side of a mix. No left source with Mono unchecked would force the source to the right side of the mix.

Generally, an output device will be two channels and receive a stereo mix. But there may be times when you want to listen to the mix in mono. Checking the Output Mono check box would premit that.

It would be possible to route the mix to only one channel of the output device by setting L or R to none. In that case, you'd receive only the left or right side of the mix unless the output Mono check box was checked.

These changes permit the same audio devie to be used by separate instances of Jamulus. Separate instances allows one musician to provide for example voice and guitar independently to the session. In this scenario, the musician would be interested in only one mix and one of the Jamulus instances could turn off both channels of the output device.

In a similar way, Jamulus could be set up for "listen only" by turning off both input device channels. This is technically like Mute Myself, but an enhancement to the system would be to not instantiate a mixer input for the client in this case. Other clients would then not see a fader, etc for a signal that could never exist. You could also hide the Input meters, Mute Myself for this client, or gray them out.

chrisrimple commented 3 years ago

I can't help with the coding, but I LOVE these suggestions. For those of us that are regularly participating in the WorldJam, running 2 or more Jamulus instances, these changes certainly make life easier. :)

WolfganP commented 3 years ago

Good ideas! For those who have multiple audio devices in their setup, this may be an excellent enhancement to tune and troubleshoot audio issues. My only concern will be with less technical users, as this area (devices, ASIO, ...) seems to be one that brings the most difficulties in nailing it down. Maybe offer separate interfaces management while in advanced mode of sorts?

kwindrem commented 3 years ago

I like the idea of a simple device configuration mode to keep the U/I uncluttered for less technical people. I sometimes forget that too many choices can overwhelm.

Here's some new layouts for consideration. I have shown separate layouts for a simplified and an advanced setup, and for both a fully configurable and for less configurable audio environments as I understand them.

"Separate Input / Output Devices check box controls whether the simplified or advanced interface is shown.

The simplified U/I shows only a single Device drop-down. The list does NOT show all combinations of inputs and outpus as the current list does. Rather it lists each device once. Making a selection changes both the input and output devices and selects the first two channels for L and R for both input and output devices.

With the simplified U/I, the channel selections are not presented and changing the interface always select the first two channels. If only one channel exists (as with a USB microphone), it would be routed to both left and right Jamulus input channels.

The real estate used for channel and separate output device selections is used to display details of the device configuration (channels, mainly) with non-editable text.

The advanced U/I provides separate Input Device and Output Device selectors as well as L/R channel selectors as previously described.

For Unix-like OS, I believe the only choice is Jack. In this case, a drop-down isn't needed at all, so obviously, checking Separate Input/Output Devices woudn't add additional selections. Correct me if my observations are incorrect.

For Windows, it appears (and again I could be wrong) you can select different audio devices but that the input and output devices must be the same. If this is the case, Separate Input/Output Devices it may be possible to provide channel selections but not separate devices for in and out. But there is a button that opens the ASIO setup for the selected device.

I also elimiated the Mono buttons and switched back to using the existing Audio Channels drop-down since that's the way it's been for some time and changing it could confuse existing users.

U:I changes.pdf

kwindrem commented 3 years ago

I may be wrong about the ability of Windows to select different input and output devices. I checked Zoom and it DOES allow selecting different input and output devices.

Is this a limitation of the Windows version of Jamulus? If so, what's the effort to allow separate input and output device selections? This would make Jamulus function like it does in Mac OS and minimize U/I variations.

I believe the Unix-line OS variation of Jamulus only supports Jack connections and uses ~/.jackdrc to start Jack if it's not already running. This implies that Jack needs to be configured before Jamulus is started. An attempt to make changes with qjackctl causes Jamulus to quit when Jack is stopped so there isn't even an opportunity to provide a Jack Setup link like is done for ASIO Setup in the Windows version.

With these limitations, there would be no Soundcard selections in the Unix version of Jamulus. Maybe the soundcard area should include text describing that changes require quitting Jamulus and reconfiguring with a Jack setup app (like qjackctl) and restarting Jamulus.

True? Or am I missing something?

npostavs commented 3 years ago

I may be wrong about the ability of Windows to select different input and output devices. I checked Zoom and it DOES allow selecting different input and output devices.

Is this a limitation of the Windows version of Jamulus?

The Windows ASIO API (which Jamulus currently uses) only supports a single device at a time. Other Windows audio APIs (e.g., WASAPI or WDM) represent input and output devices separately (that is, a single physical device is listed as two virtual devices, one with input channels, and the other with only output channels), similar to how it works on macOS. I hope to add support for the other Windows APIs when I get the portaudio library integration working (see #821 for current status).

Note that if your audio interface comes with a suitable driver, ASIO will give the lowest latency, so we'll still want to keep supporting it. That would mean supporting both single device & split input/output device selection. For reference, here's how some other similar programs handle it:

gilgongo commented 3 years ago

Hi all - since this is UI-related, and we've yet to arrive at an actionable spec for a work ticket on this, I'm going to move it to Discussions if that's OK. Once we have something solid to put on the backlog we can create the relevant Issue(s) for it.