From owner-freebsd-multimedia@freebsd.org Wed Jul 26 16:39:31 2017 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4650EDA93DF for ; Wed, 26 Jul 2017 16:39:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEC366A638 for ; Wed, 26 Jul 2017 16:39:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 17BBB2600E4; Wed, 26 Jul 2017 18:39:29 +0200 (CEST) Subject: Re: snd_uaudio monitor recording To: Marcel Bonnet Cc: FreeBSD multimedia References: From: Hans Petter Selasky Message-ID: Date: Wed, 26 Jul 2017 18:37:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2017 16:39:31 -0000 On 07/26/17 18:18, Marcel Bonnet wrote: > On 25 July 2017 at 14:18, Hans Petter Selasky 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: on hdaa0 (1p:2v/1r:1v) > pcm1: on hdaa0 (1p:1v/1r:1v) > pcm2: on hdaa1 (1p:1v/0r:0v) > pcm3: 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