After attaching an 18-in / 18-out device: ugen0.7: <BEHRINGER X18/XR18> at usbus0 uaudio0 on uhub0 uaudio0: <X18/XR18> on usbus0 uaudio0: Play[0]: 48000 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 48000 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: MIDI sequencer. pcm2: <USB audio> on uaudio0 uaudio0: No HID volume keys found. SNDCTL_AUDIOINFO reports min_channels = 2, max_channels = 2 pcm/dsp.c::dsp_oss_audioinfo() only reports 1 or 2 for min/max it appears: for (i = 0; caps->fmtlist[i]; i++) { fmts |= caps->fmtlist[i]; if (AFMT_CHANNEL(caps->fmtlist[i]) > 1) { minch = (minch == 0) ? 2 : minch; maxch = 2; } else { minch = 1; maxch = (maxch == 0) ? 1 : maxch; } }
FreeBSD OSS use stereo mode by default, unless you set "dev.pcm.<n>.play.vchanformat" and "dev.pcm.<n>.rec.vchanformat". If there is more than 8 channels, then only bitperfect mode is supported. Maybe the audioinfo could need an update in that regards. I think we support up to 127 channels, limited by AFMT. --HPS
Indeed, this attaches with bitperfect mode enabled dev.pcm.2.bitperfect: 1 The 2nd problem I encountered is Audacity's OSS support via PortAudio does not support beyond S16_NE. I will try (sometime) to have a look at improving audioinfo reporting in this case.
I've submitted a few pull requests to PortAudio related to the work that prompted this PR: https://github.com/PortAudio/portaudio/pull/448 https://github.com/PortAudio/portaudio/pull/449 https://github.com/PortAudio/portaudio/pull/450 with these applied as well as addition of cases for AFMT_S32_NE I can now record from the XR18 in 2 channel mode with bitperfect=1. Attempting to record in 18 channel mode results in a PA assertion: 21:42:13: Debug: GetBestRate() suggested rate 48000 Hz 21:42:13: Debug: GetBestRate() Returning 48000 Hz Assertion failed: (firstChannel + channelCount <= bp->inputChannelCount), function PaUtil_SetInterleavedInputChannels, file src/common/pa_process.c, line 482. Abort trap (core dumped)
Looks like PA OSS only tries up to 16 channels: https://github.com/PortAudio/portaudio/blob/master/src/hostapi/oss/pa_unix_oss.c#L358 /* Negotiate for the maximum number of channels for this device. PLB20010927 * Consider up to 16 as the upper number of channels. * Variable maxNumChannels should contain the actual upper limit after the call. * Thanks to John Lazzaro and Heiko Purnhagen for suggestions. */ maxNumChannels = 0; for( numChannels = 1; numChannels <= 16; numChannels++ ) {
That's not directly the cause of the assertion though, the values involved in the assertion expression: firstChannel=0 channelCount=18 bp->inputChannelCount=2