jamulussoftware / jamulussoftware/jamulus
Allow mono input device and channel selection for stereo input devices.
- Dominant language
- C
- Stars
- 1.1k
- Forks
- 248
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
Momentarily it is impossible to use a mono input device and also impossible to select input channels for stereo devices, though there seems to be no reason why this should not be possible, since it is possible to select twice the same input channel with devices with more than two input channels.
Also in some cases it would be handy to swap L/R output channels which is currently also impossible for two channel devices.
**To Reproduce**
Just try different devices:
mono input device: Error not 2 ch.
stereo input device: no input/output selection possible
more than 2 channel device: all is possible.
**Expected behavior**
Always being able to select L/R channels for input and output. (and for mono input devices always select twice the same mono input)
**Screenshots**
n.a.
**Operating system**
All OS'es
**Version of Jamulus**
All versions
**Additional context**
Also discussed on [discussion #2268](https://github.com/jamulussoftware/jamulus/discussions/2268#discussioncomment-2114430)
changes for v3.8.1 windows release:
Add in sound.h:
(In my opinion these and some other definitions in sound.h should actually be defined in global.h since they are client, and not OS, related, but are of the same category as MAX_NUM_IN_OUT_CHANNELS which is defined in global.h)
```
42 #define MIN_IN_CHANNELS 1
43 #define MIN_OUT_CHANNELS 2
```
Chances in sound.cpp:
```
168 if ( ( lNumInChan < MIN_IN_CHANNELS ) || ( lNumOutChan < MIN_OUT_CHANNELS ) )
586 vSelectedInputChannels[1] = GetNumInputChannels() > 1 ? 1 : 0;
588 vSelectedOutputChannels[1] = GetNumOutputChannels() > 1 ? 1 : 0;
```
Same (alike) changes also have to be done for Mac/Linux/Android sound.cpp, sound.h
Chance in clientsettingsdlg.cpp
```
823 if ( ( iNumInChannels < MIN_IN_CHANNELS ) || ( iNumOutChannels < MIN_OUT_CHANNELS ) )
```
I don't think there is any other impact on the GUI, but that has to be further checked/tested.
Contributor guide
Research direction
Start with sound.h, the platform-specific sound.cpp files, and clientsettingsdlg.cpp, focusing on the channel-count checks and selected-channel initialization identified in the issue. Reproduce the behavior with mono, stereo, and multichannel devices across the affected platforms, then verify that input and output channel selection works as described without breaking existing devices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100