Skip to content

Claude: add support for multichannel interfaces on iOS/iPadOS#3746

Open
rdica wants to merge 2 commits into
jamulussoftware:mainfrom
rdica:multichannel-ios
Open

Claude: add support for multichannel interfaces on iOS/iPadOS#3746
rdica wants to merge 2 commits into
jamulussoftware:mainfrom
rdica:multichannel-ios

Conversation

@rdica

@rdica rdica commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Short description of changes

Adds support for external multichannel interfaces and provides ability to choose inputs on iOS/iPadOS devices.

CHANGELOG: Added support for external multichannel interfaces and ability to choose inputs on iOS/iPadOS devices.

Context: Fixes an issue?

Fixes: 3735

Does this change need documentation? What needs to be documented and how?

I don't know.

Status of this Pull Request

What is missing until this pull request can be merged?

This absolutely needs testing as I have no means to do so.

I don't really expect this to work but hopefully it provides a starting point.

Claude summary:
What was missing: src/sound/coreaudio-ios/sound.mm hardcoded a 2-channel (stereo) input format on the RemoteIO audio unit and never queried AVAudioSession for a device's actual channel count, so any external multichannel interface (USB/Lightning audio interface) was silently truncated to its first two channels.

Changes (src/sound/coreaudio-ios/sound.{h,mm}):

  • Negotiate channel count via AVAudioSession.maximumInputNumberOfChannels / setPreferredInputNumberOfChannels: / inputNumberOfChannels whenever a device is selected (SwitchDevice).
  • Split the single audio format into separate input (now iNumInChan-wide) and output (still stereo, since iOS playback is always 2-channel) AudioStreamBasicDescriptions applied to the RemoteIO unit.
  • GetAvailableInOutDevices() now lists every AVAudioSessionPortDescription in availableInputs (built-in mic, headset, external interfaces) instead of just "default" vs "built-in mic".
  • Added UpdateInputChannelInfo() to populate per-channel names (from AVAudioSessionChannelDescription) and clamp the current selection when the device changes.
  • processBufferList() now indexes the interleaved N-channel buffer using the user-selected left/right channel instead of assuming channel 0/1.
  • Implemented GetNumInputChannels, GetInputChannelName, SetLeft/RightInputChannel, GetLeft/RightInputChannel overrides — these plug straight into the existing generic channel-selection UI in clientsettingsdlg.cpp, which is already gated on __APPLE__ (true for iOS) and just was never exercised because the backend always reported 2 channels.

No GUI changes were needed — the settings dialog's channel-selection frame already supports any platform reporting more than 2 channels.

Caveat: I don't have macOS/Xcode in this environment to actually build and run on a device, so this hasn't been compiled or tested against real hardware — please build it in Xcode and verify with an actual multichannel interface (e.g. plugged in via USB-C/Lightning) before merging.

END Summary

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant