Date: Wed, 26 Jul 2017 18:37:18 +0200 From: Hans Petter Selasky <hps@selasky.org> To: Marcel Bonnet <marcelbonnet@gmail.com> Cc: FreeBSD multimedia <freebsd-multimedia@freebsd.org> Subject: Re: snd_uaudio monitor recording Message-ID: <a62dc1ef-58fe-a548-b8ab-24d299dde47b@selasky.org> In-Reply-To: <CAPe0dBkDAAdYRSNsrAmu1Xq%2BU6gN_pZG0c22b1FRQrAJ-kK8iw@mail.gmail.com> References: <CAPe0dB=wUyr4NZPxEDSfe7jh%2BiJ-17EpgfhJLFjqysV4DBshLw@mail.gmail.com> <a567dbbb-c533-c450-828e-7207f46f7738@selasky.org> <CAPe0dBkDAAdYRSNsrAmu1Xq%2BU6gN_pZG0c22b1FRQrAJ-kK8iw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/26/17 18:18, Marcel Bonnet wrote: > On 25 July 2017 at 14:18, Hans Petter Selasky <hps@selasky.org> wrote: >> >> On 07/25/17 17:00, Marcel Bonnet wrote: >>> >>> Hi. >>> >>> I'd like to record to a file whatever the sound card is actually playing, >>> essentially when I am not using jackd server. >>> I don't know if I just did not figure how to do it, or if depends on a new >>> driver functionality ? >>> Thanks in advance, >>> >> >> You'd need to use virtual_oss to do that. > Thanks. But, I didn't understand how to use it. Can you help me, please? > > I tried an example from the man page (I changed the sample rate, > because my USB Fast Track Pro is set to 44100 Hz): > > [@machine tmp]$ virtual_oss -C 2 -c 2 -r 44100 -b 16 -s 1024 -f > /dev/dsp3.0 -w dsp.wav -d dsp > hw.snd.basename_clone: 1 > sysctl: hw.snd.basename_clone=0: Operation not permitted > virtual_oss: Could not create CUSE DSP device > > So, I tried with sudo: > > [@machine tmp]$ sudo virtual_oss -C 2 -c 2 -r 44100 -b 16 -s 1024 -f > /dev/dsp3.0 -w dsp.wav -d dsp > hw.snd.basename_clone: 1 -> 0 > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > virtual_oss: Could not open DSP device '/dev/dsp3.0': Device busy > > I never know why I have so much /dev/dsp3.x units. When using jack > server, I always attach to the first one (3.0) and it is ok. I tried > the other 3.x units, with no success. > > Thanks in advance. > > My environment: > > [@machine tmp]$ ls /dev/dsp* ; cat /dev/sndstat ; sysctl hw.snd.default_unit > > /dev/dsp0.1 /dev/dsp1.1 /dev/dsp2.1 /dev/dsp3.0 /dev/dsp3.1 > /dev/dsp3.2 /dev/dsp3.3 > > FreeBSD Audio Driver (64bit 2009061500/amd64) > Installed devices: > pcm0: <Realtek ALC269 (Analog)> on hdaa0 (1p:2v/1r:1v) > pcm1: <Realtek ALC269 (Analog)> on hdaa0 (1p:1v/1r:1v) > pcm2: <Intel Panther Point (HDMI/DP 8ch)> on hdaa1 (1p:1v/0r:0v) > pcm3: <USB audio> at ? kld snd_uaudio (1p:2v/1r:1v) default > No devices installed from userspace. > > hw.snd.default_unit: 3 > > [@machine tmp]$ sysctl dev.pcm.3 > dev.pcm.3.feedback_rate: 0 > dev.pcm.3.bitperfect: 0 > dev.pcm.3.buffersize: 0 > dev.pcm.3.rec.vchanformat: s16le:2.0 > dev.pcm.3.rec.vchanrate: 44100 > dev.pcm.3.rec.vchanmode: fixed > dev.pcm.3.rec.vchans: 1 > dev.pcm.3.play.vchanformat: s16le:2.0 > dev.pcm.3.play.vchanrate: 44100 > dev.pcm.3.play.vchanmode: fixed > dev.pcm.3.play.vchans: 2 > dev.pcm.3.hwvol_mixer: vol > dev.pcm.3.hwvol_step: 5 > dev.pcm.3.%parent: uaudio0 > dev.pcm.3.%pnpinfo: > dev.pcm.3.%location: > dev.pcm.3.%driver: pcm > dev.pcm.3.%desc: USB audio >> >> --HPS > Hi, Try this: sudo virtual_oss -S -C 2 -c 2 -r 44100 -b 16 -s 1024 \ -f /dev/dsp3 -d dsp -w dsp.rec.wav -l dsp.rec Then either: dd if=/dev/dsp.rec.wav of=myfile.wav bs=1024 Or use a program like audacity (not sox, due to reading one and one sample) to record from /dev/dsp.rec . --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a62dc1ef-58fe-a548-b8ab-24d299dde47b>