From owner-freebsd-questions@freebsd.org Wed Dec 13 13:33:09 2017 Return-Path: Delivered-To: freebsd-questions@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 8F97FE9E373; Wed, 13 Dec 2017 13:33:09 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5565F70AF6; Wed, 13 Dec 2017 13:33:09 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-it0-x234.google.com with SMTP id f143so3643752itb.0; Wed, 13 Dec 2017 05:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=38Fke/EiYT6rieSgkGtFfkaVhV47rYIoC0fX8Nmt7EI=; b=u17Ry+XfZA+OVj8N9Enqfd+1d5F31uxTC/M4mlsbYr2gRZgVMLl2OKUA8hDB345b8o EH3QKBzfPSVMSZGh0KLzveyw6twMYxTXDeg04YheXGtI11MGgdoFvCtcENQKuVjbebHR jx5GA2/XVXda62doST1NdmsHwMTrmMnoLYUG+Omo9Ve1HrknYFopB9WGjznZ40H4xQ42 vm7aaWbzYQHUukqMJp0TSS7IFCpJpIzA8oTBXH4yaE4cXZpYfz1RsLm1DskEed3HKyuT ee9S4wYAW1NuDgC3mAa5AeGB4GuFPeS6VDSDNsLyLSXLxFlg/FTS4pvguZduG+W2s9cB Ffgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=38Fke/EiYT6rieSgkGtFfkaVhV47rYIoC0fX8Nmt7EI=; b=DOKpbhpdvMaYlWi4ru5/cwxPch5+t4WYeS6JfRkXFEVgnG8sqm7Wx5Wnm/LwV8Vnj2 rx1DWjN9vnLsD5Fkw6TnsjhyZD9rcAxm6VIfBQtr81RTOW0JkxlWqKUgU0yZ7JxKbce6 gUXxnzl0vAH3D4Xgk6fvl7tgtz4lISxpVgaLCWu8VUJW8ZeFc/XNUkH4469mL1rx6LWN CCaKmcKa+13Uex91ibyLE1vlZ2jL/7bVsN9Or0w4zKLbZR3oBQ2EkvGxE2pvQNVvXDO/ Ox9bT7xNzdyEPu/5XuAOBTh1Tl+j+WOUyNyTa73cFYI+Y1YEfshprD7GgdSc05WCUhic wmUA== X-Gm-Message-State: AKGB3mKYAbZnKCX3nqLHoGeBquOet5jnvIm518gBjWAsFX+wep2Dg+74 rqR5D6mK5WjdzC5kZ2jk6KmTKUAPpRyRuN2cpr2lsQ== X-Google-Smtp-Source: ACJfBovA3VTqACAtEYy2ue1BZQB4nFbhyVElcWitAPVOs5cZKTwXaq5NFsVmzhj1sZ1DybVjOxVSJoLK1d60i0dQtWw= X-Received: by 10.36.151.198 with SMTP id k189mr3055567ite.100.1513171988521; Wed, 13 Dec 2017 05:33:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.11.31 with HTTP; Wed, 13 Dec 2017 05:33:07 -0800 (PST) In-Reply-To: References: From: blubee blubeeme Date: Wed, 13 Dec 2017 21:33:07 +0800 Message-ID: Subject: Re: How to capture audio with FreeBSD? To: "Onno K." Cc: Freebsd-multimedia@freebsd.org, FreeBSD Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 13:33:09 -0000 On Wed, Dec 13, 2017 at 9:23 PM, Onno K. wrote: > Dear list, > > I have got my Raspberry Pi 3 (ARM64) working with FreeBSD 12-CURRENT - > cool stuff! > > Though I believe this to be unrelated to the RPi, I cannot figure out how > to capture audio with it. The RPi only has audio output and no input, so I > am using a simple USB-dongle audio device that has both input and output. > It is recognised as following by FreeBSD 12-CURRENT Nov 30 2017 snapshot: > > > .. > uaudio0 on uhub1 > uaudio0: 1.10/1.00, addr 4> on usbus0 > uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer. > uaudio0: Play: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer. > uaudio0: Record: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer. > uaudio0: Record: 44100 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer. > uaudio0: No MIDI sequencer. > pcm0: on uaudio0 > uaudio0: HID volume keys found. > .. > > > Looks good to me! Additionally, /dev/sndstat reveals: > > > Installed devices: > pcm0: (play/rec) default > No devices installed from userspace. > > > A more verbose /dev/sndstat reads: > > > # sysctl hw.snd.verbose=2 > hw.snd.verbose: 0 -> 2 > # cat /dev/sndstat > FreeBSD Audio Driver (64bit 2009061500/aarch64) > Installed devices: > pcm0: at ? kld snd_uaudio (1p:1v/1r:1v) default > snddev flags=0x2e6 REGISTERED,VPC> > [pcm0:play:dsp0.p0]: spd 48000, fmt 0x00200010, flags 0x00002100, > 0x00000004 > interrupts 0, underruns 0, feed 0, ready 0 > [b:3072/1536/2|bs:4096/2048/2] > channel flags=0x2100 > {userland} -> feeder_mixer(0x00200010) -> {hardware} > pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp0]: spd 8000, fmt > 0x00100008, flags 0x10000000, 0x00000000 > interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0] > channel flags=0x10000000 > {userland} -> feeder_root(0x00000000) -> {hardware} > [pcm0:record:dsp0.r0]: spd 48000, fmt 0x00200010/0x00100010, flags > 0x00002100, 0x00000045 > interrupts 0, overruns 0, feed 0, hfree 1536, sfree 4096 > [b:1536/768/2|bs:4096/2048/2] > channel flags=0x2100 > {hardware} -> feeder_root(0x00100010) -> feeder_matrix(1.0 -> 2.0) > -> feeder_mixer(0x00200010) -> {userland} > pcm0:record:dsp0.r0[pcm0:virtual:dsp0.vr0]: spd 8000, fmt > 0x00100008, flags 0x10000000, 0x00000000 > interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 > [b:0/0/0|bs:0/0/0] > channel flags=0x10000000 > {hardware} -> feeder_root(0x00000000) -> {userland} > No devices installed from userspace. > > > On Linux platform, I had success with capturing audio using the same > hardware using the 'aplay' and 'arecord' tools from the ALSA library. So > the hardware works, on Linux, but not on FreeBSD. It appears not to detect > the sound card: > > > # aplay -l > aplay: device_list:273: no soundcards found... > # arecord -l > arecord: device_list:273: no soundcards found... > > > So at first glance, ALSA does not work (out of the box, after installing > pkg) with FreeBSD. But 'alsamixer' does appear to work, since the volume > buttons on the USB dongle would affect the sound level in alsamixer. > > Now my questions: > -> Does ALSA even work in FreeBSD or is any configuration required to get > it to work? > -> How can one capture audio on FreeBSD? > -> Any hints in general on how to proceed? > > Addendum: > -> The handbook was not very useful to me. Nothing about capturing audio > mentioned: https://www.freebsd.org/doc/handbook/sound-setup.html. > -> I did read something about being able to use 'dd' to directly capture > audio to a file. Any examples on such a command would be appreciated, as my > simple 'dd if=/dev/dsp of=test.wav' did not work properly for me. > > Thanks for any help! > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to "freebsd-multimedia- > unsubscribe@freebsd.org" > Try this, install audio/oss from ports then use ossrecord app to record from the detected audio recording device. on my device running ossinfo returns this: ossinfo Version info: FreeBSD native OSS ABI 1200054 (0x00040000) BSD Platform: FreeBSD/amd64 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r326056: Tue Nov 21 14:54:55 UTC 2017 root@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC (blubee) Number of audio devices: 10 Number of audio engines: 10 Number of MIDI devices: 0 Number of mixer devices: 3 Device objects 0: pcm0 Realtek ALC899 (Analog) on hdaa0 1: pcm1 Realtek ALC899 (Rear Analog Line-out) on hdaa0 2: pcm2 Realtek ALC899 (Rear Digital) on hdaa0 MIDI devices (/dev/midi*) Mixer devices 0: pcm0:mixer (Mixer 0 of device object 0) 1: pcm1:mixer (Mixer 0 of device object 1) 2: pcm2:mixer (Mixer 0 of device object 2) Audio devices pcm0:play:dsp0.p0 /dev/dsp0.p0 (device index 0) pcm0:virtual:dsp0.vp0 /dev/dsp0.vp0 (device index 1) pcm0:virtual:dsp0.vp1 /dev/dsp0.vp1 (device index 2) pcm0:virtual:dsp0.vp2 /dev/dsp0.vp2 (device index 3) pcm0:record:dsp0.r0 /dev/dsp0.r0 (device index 4) pcm0:virtual:dsp0.vr0 /dev/dsp0.vr0 (device index 5) pcm1:play:dsp1.p0 /dev/dsp1.p0 (device index 6) pcm1:virtual:dsp1.vp0 /dev/dsp1.vp0 (device index 7) pcm2:play:dsp2.p0 /dev/dsp2.p0 (device index 8) pcm2:virtual:dsp2.vp0 /dev/dsp2.vp0 (device index 9) give that a shot and report back.