Recording sound output of a program (was Re: Capture audio from the FreeBSD sound system)

Polytropon freebsd at edvax.de
Fri Sep 26 04:03:34 UTC 2014


On Thu, 25 Sep 2014 14:10:59 +0200, Aymeric Mansoux wrote:
> For external sound via mic/line of an internal or external soundcard,
> this is straight forward yes, but I'm trying to record the sound
> produced by a software without any external setup.
> 
> playback software -> PCM audio infrastructure -> recording software

If I understand the involved parts correctly, this depends
on the ability of the sound card driver, which in turn relies
on the actual sound hardware. For example, the Logitech SoundMan
sound card had the feature you're describing: You could select
one of the output channels as recording source. I think this
was also possible on some models of the Creative Labs Sound Blaster.



> I thought it would be possible to do it by using the internal audio
> loopback of my soundcard, but regardless of which source I set as
> recording device (Line, Mix, Mic, Monitor) I only get sound from the
> mic.

How did you get to select "monitor" as source?

	% mixer =rec mic
	Recording source: mic
	% mixer =rec cd
	Recording source: cd
	% mixer =rec line
	Recording source: line
	% mixer =rec monitor
	mixer: unknown recording device: monitor
	usage: mixer [-f device] [-s | -S] [dev [+|-][voll[:[+|-]volr]] ...
	       mixer [-f device] [-s | -S] recsrc ...
	       mixer [-f device] [-s | -S] {^|+|-|=}rec rdev ...
	 devices: vol, pcm, line, mic, cd, rec, igain, monitor
	 rec devices: line, mic, cd
	% _

I'm using the built-in sound "card" with the snd_hda driver.

	% dmesg | grep pcm
	pcm0: <HDA VIA VT1708_8 PCM #0 Analog> at cad 0 nid 1 on hdac0
	pcm1: <HDA VIA VT1708_8 PCM #1 Analog> at cad 0 nid 1 on hdac0
	pcm2: <HDA VIA VT1708_8 PCM #2 Digital> at cad 0 nid 1 on hdac0

But maybe this is a starting point for you: When I query the
sndstat facility, I get this:

	% cat /dev/sndstat 
	FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
	Installed devices:
	pcm0: <HDA VIA VT1708_8 PCM #0 Analog> (play/rec) default
	pcm1: <HDA VIA VT1708_8 PCM #1 Analog> (rec)
	pcm2: <HDA VIA VT1708_8 PCM #2 Digital> (play)

Here, pcm1 is another "rec" device. Do you have something similar?
Maybe recording from that one will capture the output of the other
one?





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list