Summary: | multichannel USB audio device reports only 2 channels via SNDCTL_AUDIOINFO | ||
---|---|---|---|
Product: | Base System | Reporter: | Ed Maste <emaste> |
Component: | usb | Assignee: | freebsd-usb (Nobody) <usb> |
Status: | New --- | ||
Severity: | Affects Only Me | CC: | hselasky, sascha.folie |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Ed Maste
2021-01-17 01:04:08 UTC
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 Any news here? --HPS (In reply to Hans Petter Selasky from comment #1) I have a 20-in/18-out device and would like to use vchans. So far I only managed to use the audio interface with virtual_oss. Is anyone working on changing the limit from 8 to 127? uaudio0 on uhub4 uaudio0: <Audiofuse Studio> on usbus1 uaudio0: Play[0]: 192000 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play[0]: 176400 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play[0]: 96000 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play[0]: 88200 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play[0]: 48000 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Play[0]: 44100 Hz, 18 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 192000 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 176400 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 96000 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 88200 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 48000 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: Record[0]: 44100 Hz, 20 ch, 32-bit S-LE PCM format, 2x8ms buffer. uaudio0: MIDI sequencer. pcm4: <USB audio> on uaudio0 When there are more than 8 channels, vchannels are disabled and bitperfect is enabled. Then you have to use virtual_oss if your application does not support bitperfect. The vchannel limit of 8 channels was chosen because surround use 8 channels. --HPS > Is anyone working on changing the limit from 8 to 127?
Not as I'm aware of.
|