Date: Fri, 28 Jul 2017 10:55:03 -0300 From: Marcel Bonnet <marcelbonnet@gmail.com> To: Hans Petter Selasky <hps@selasky.org> Cc: FreeBSD multimedia <freebsd-multimedia@freebsd.org> Subject: Re: snd_uaudio monitor recording Message-ID: <CAPe0dBk5cbq9VU=yD89qiMU2F27xb5E%2Bsfr3CmxdLVL2M_nn9Q@mail.gmail.com> In-Reply-To: <a62dc1ef-58fe-a548-b8ab-24d299dde47b@selasky.org> References: <CAPe0dB=wUyr4NZPxEDSfe7jh%2BiJ-17EpgfhJLFjqysV4DBshLw@mail.gmail.com> <a567dbbb-c533-c450-828e-7207f46f7738@selasky.org> <CAPe0dBkDAAdYRSNsrAmu1Xq%2BU6gN_pZG0c22b1FRQrAJ-kK8iw@mail.gmail.com> <a62dc1ef-58fe-a548-b8ab-24d299dde47b@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 26 July 2017 at 13:37, Hans Petter Selasky <hps@selasky.org> wrote: > 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 > Thanks, Hans! I ran virtual_oss as above: 1. when I'm playing with mplayer, it was possible to capture the sound. The same works if I connect jack server to the new device. Very cool! 2. Browsers: 2.1 But, when I started YouTube (chromium browser), virtual_oss stopped with a message: Floating point exception . After crash, I had no sound anymore. I had to re run virtual_oss to get system sound again. 2.2 No crashes with Firefox, except that no sound was captured, although I was hearing what I was playing (1. youtube ; 2. a mp3 file from local system played with the browser). Can virtual_oss capture the sound from thoses browsers ? They were compiled with ALSA lib, is that the cause of a crash for Chromium and no sound captured when playing youtube from Firefox? chromium-57.0.2987.133 Options : ALSA : on CODECS : on DEBUG : off DRIVER : on GCONF : on KERBEROS : on PULSEAUDIO : off TEST : off firefox-52.0.2,1 Options : ALSA : on BUNDLED_CAIRO : on CANBERRA : off DBUS : on DEBUG : off DTRACE : on FFMPEG : on GCONF : off GNOMEUI : off GTK2 : off GTK3 : on INTEGER_SAMPLES: off LIBPROXY : off OPTIMIZED_CFLAGS: on PGO : off PROFILE : off PULSEAUDIO : on RUST : on SNDIO : off TEST : off Thanks, again! -- Marcel Bonnet
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPe0dBk5cbq9VU=yD89qiMU2F27xb5E%2Bsfr3CmxdLVL2M_nn9Q>