More than 2 channels of sound fails

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

More than 2 channels of sound fails

Евгений Б. Спамаковский
What does one need to do to record >2 channels of audio?
Here is my problem: A device has 6 record channels -
$ dmesg | grep uaud
uaudio0 on uhub8
uaudio0: <Scarlett 6i6 USB> on usbus0
uaudio0: Play: 192000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 176400 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 96000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 88200 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 48000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 44100 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 192000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 176400 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 96000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 88200 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 48000 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 44100 Hz, 6 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: MIDI sequencer.
pcm6: <USB audio> on uaudio0
uaudio0: No HID volume keys found.
$

However trying to record or play 6 channels fails, at least using two
different programs:
$ AUDIODEV=/dev/dsp6 rec -c 6 -b 32 -r 48000 /tmp/out.raw
rec WARN formats: can't set 6 channels; using 2
...or,
$ rawrec -d /dev/dsp6 -c 6 /tmp/out.wav
rawrec: the number of channels (-c) could not be set to the intended value of 6
$ rawrec -d /dev/dsp6 -c 2 /tmp/out.wav
(works)

$ sysctl -a |grep pcm\\.6
dev.pcm.6.feedback_rate: 0
dev.pcm.6.bitperfect: 0
dev.pcm.6.buffersize: 0
dev.pcm.6.rec.vchanformat: s32le:6.0
dev.pcm.6.rec.vchanrate: 48000
dev.pcm.6.rec.vchanmode: fixed
dev.pcm.6.rec.vchans: 1
dev.pcm.6.play.vchanformat: s32le:6.0
dev.pcm.6.play.vchanrate: 48000
dev.pcm.6.play.vchanmode: fixed
dev.pcm.6.play.vchans: 1
dev.pcm.6.hwvol_mixer: vol
dev.pcm.6.hwvol_step: 5
dev.pcm.6.%parent: uaudio0
dev.pcm.6.%pnpinfo:
dev.pcm.6.%location:
dev.pcm.6.%driver: pcm
dev.pcm.6.%desc: USB audio
$

(I have also tried a few things like disable vchans, set bitperfect
mode etc. but nothing changes the availability of channels.)

I have not yet gone down the rabbit hole of examining the code.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: More than 2 channels of sound fails

Hans Petter Selasky-6
On 07/10/18 15:26, Евгений Б. Спамаковский wrote:
> However trying to record or play 6 channels fails, at least using two
> different programs:
> $ AUDIODEV=/dev/dsp6 rec -c 6 -b 32 -r 48000 /tmp/out.raw
> rec WARN formats: can't set 6 channels; using 2
> ...or,
> $ rawrec -d /dev/dsp6 -c 6 /tmp/out.wav

Hi,

Did you try with Audacity?

Check the source code for rawrec, if it sets the channels and AFMT
correctly.

Compare with the source code for virtual_oss in ports. It might also
help you setup a recording device.

--HPS
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: More than 2 channels of sound fails

Евгений Б. Спамаковский
On Tue, Jul 10, 2018 at 4:12 PM Hans Petter Selasky <[hidden email]> wrote:
> Check the source code for rawrec, if it sets the channels and AFMT
> correctly.
>
> Compare with the source code for virtual_oss in ports. It might also
> help you setup a recording device.

This allowed me to hack up a trivial test program to set format
(AFMT_S32_NE), samplerate (48k), and channels (6) and measure the time
it takes to read 6 * sizeof(int32) * 48000 bytes from the device. That
turns out to be 1.0000 plus/minus epsilon seconds which is promising;
i.e. the two first programs I tried (sox and rawrec) both suck.

Thank you sir for those pointers.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: More than 2 channels of sound fails

Shane Ambler-5
On 11/07/2018 22:25, Евгений Б. Спамаковский wrote:

> On Tue, Jul 10, 2018 at 4:12 PM Hans Petter Selasky <[hidden email]> wrote:
>> Check the source code for rawrec, if it sets the channels and AFMT
>> correctly.
>>
>> Compare with the source code for virtual_oss in ports. It might also
>> help you setup a recording device.
>
> This allowed me to hack up a trivial test program to set format
> (AFMT_S32_NE), samplerate (48k), and channels (6) and measure the time
> it takes to read 6 * sizeof(int32) * 48000 bytes from the device. That
> turns out to be 1.0000 plus/minus epsilon seconds which is promising;
> i.e. the two first programs I tried (sox and rawrec) both suck.
>
> Thank you sir for those pointers.

Does audio/jack see the channels? You probably want qjackctl or patchage
to connect them.

While it may take a while to learn, audio/ardour5 is designed for
multichannel mixing/recording.

--
FreeBSD - the place to B...Software Developing

Shane Ambler

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
To unsubscribe, send any mail to "[hidden email]"