jamulussoftware / jamulus

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

List of selectable audio devices incomplete in Jamulus preferences #3216

Open heepm opened 10 months ago

heepm commented 10 months ago

When having a lot of audio devices connected / active on the computer, not all audio device combinations will be listed in the Jamulus drop down menu. This seems to appear when having around 10 audio devices available in system preferences. Reducing the number of audio devices connected to the computer makes the missing devices available again in the drop down menu.

Issue can be reproduced by creating several audio aggregate devices in audio midi setup.

Operating system: macOS Sonoma 14.1.2 Jamulus version: 3.10.0, downloaded from website

In addition: drop down menu which lists all possible combinations of audio input and output devices is very unhandy.

Suggestion: splitting drop down menu in 2 separate menus as every other DAW has for input and output. Then list only the devices to choose.

photo 1 suggestion

ann0see commented 10 months ago

Hi @heepm Thanks for opening this issue.

In addition: drop down menu which lists all possible combinations of audio input and output devices is very unhandy.

I agree. Not sure why it was designed like that, but there's probably a reason. I remember that we talked about it in the past. @pljones Do you remember? Maybe some implementation thing?

I think if you have 10 devices, we just have a massive combination of devices in theory it should still show up.

Do all devices have the same sample rate and preferably the same clock source?

Related code fragment: src/sound/coreaudio-mac/sound.cpp

ann0see commented 10 months ago

The code says

// we add combined entries for input and output for each device so that we // do not need two combo boxes in the GUI for input and output (therefore // all possible combinations are required which can be a large number)

Probably the problem is that Windows and Linux use non "native" drivers (ASIO/JACK). So we might need to sketch a working UI for that too.

pljones commented 10 months ago

The audio settings screen is platform dependent. I can't comment on the Mac one. Maybe we could provide a JACK build for Mac?

ann0see commented 10 months ago

Maybe we could provide a JACK build for Mac?

Probably yes, but not part of this issue.

Building via Xcode on macOS is currently a bit difficult. I only have access to an old machine which doesn't run Xcode too well. But we can do some sketches. The bug itself needs investigation. @heepm Could you please take a picture when the bug occurs?

heepm commented 10 months ago

@ann0see yes, as far as I can investigate this, sample rate and clock source are the same and not related to the issue.

Concerning the building issue with Xcode: maybe I can support you and try to build a test build for us. I have a little bit of experience in c++ and swift.

Screenshot when the bug occurs see attached. The first pictures contains all audio drivers / devices installed on the machine. The second and third picture show the drop down menu of Jamulus. As you can see the hierarchy of the audio devices in the audio midi setup determine the drop down list in Jamulus. The devices in the lower section do not appear. If I connect additional devices being in higher hierarchy of the audio midi setup list, devices in Jamulus that were available before disappear too, I observed.

Note: I tested this issue also on a second machine running macOS 12.7.2 with different audio drivers and devices installed. Same issue occurs.

Let me know if I can contribute further.

picture 1 picture 3 picture 2

ann0see commented 10 months ago

Thanks. Sorry for the delay. I have the feeling that there could be an array out of bounds error?

ann0see commented 10 months ago

Do you have knowledge of macOS development? If yes, you can try compiling the app via deploy_mac.sh

ann0see commented 10 months ago

Wait. I forgot that there's a fix I found some time ago. https://github.com/jamulussoftware/jamulus/issues/3078

softins commented 10 months ago

I have the feeling that there could be an array out of bounds error?

No, I don't think so. The relevant arrays are sized as MAX_NUMBER_SOUND_CARDS, which has the value 129 set in https://github.com/jamulussoftware/jamulus/blob/7720fcda218435b9dadabcf6f287b694f9dacead/src/global.h#L184-L185

When filling the arrays for a Mac, it correctly checks against this value:

https://github.com/jamulussoftware/jamulus/blob/7720fcda218435b9dadabcf6f287b694f9dacead/src/sound/coreaudio-mac/sound.cpp#L151-L160

This prevents array out of bounds, but causes all the I/O combinations beyond this number just to be ignored.

Could try compiling with a larger number for MAX_NUMBER_SOUND_CARDS.

I agree a better solution would be setting In and Out devices separately, even if just for Mac.

ann0see commented 10 months ago

Ok. That would also make sense. Then the problem should be clear. But yes, preferably we'd let macOS and iOS select in/outputs manually and use an #ifdef there.

macOS/iOS (maybe also android) would show "device" -> new UI Everything else would show "Driver" -> current UI

ann0see commented 8 months ago

I'd like to work on the splitting of in and out devices in the next time (but no guarantees). I might need some help for testing on macOS (only have access to older mac hardware...)

pljones commented 8 months ago

How about splitting out the very platform-specific settings onto a separate tab? image

The audio channels and quality are actually as much network issues as anything (they affect bandwidth and server side processing).

Buffer Delay is the odd one out - it's related to the client sound I/O rather than network - it could be a fixed component on a tab extended per-platform.

ann0see commented 8 months ago

No. Things should still be easily visible. More tabs = more complexity => more confusion

pljones commented 8 months ago

Currently the tab is a bit mixed up and inconsistent between platforms. Having to explain that introduces complexity and confusion anyway. Separating out the platform-specific parts so they can be addressed separately under platform-specific headings with clear, non-confusing screenshots might reduce confusion.

ann0see commented 7 months ago

I haven't forgotten that, but currently a bit short on coding time. This should be done for the next release...

ann0see commented 6 months ago

Ok. After some more looking into the code, we may need to do some bigger refactoring with the "sound card" abstraction also.