From nobody Sat Apr 26 15:59:12 2025 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZlDt110pvz5tN7B for ; Sat, 26 Apr 2025 15:59:21 +0000 (UTC) (envelope-from tembun@bk.ru) Received: from send127.i.mail.ru (send127.i.mail.ru [89.221.237.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZlDt03nV7z3qBZ for ; Sat, 26 Apr 2025 15:59:20 +0000 (UTC) (envelope-from tembun@bk.ru) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bk.ru; s=mail4; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References: In-Reply-To:Message-Id:Subject:Cc:To:From:Date:From:Sender:Reply-To:To:Cc: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive:X-Cloud-Ids:Disposition-Notification-To; bh=NWWwzs3HVTlU+8GToiude7jCGGl9/dA+dU4RZcGETJE=; t=1745683160; x=1745773160; b=c3xBWbBIUvMJUE6fC6+aq4S2BqQ7t6tzdzxifKfykkseAH1wqpmCw+Tn+gb6hrez7osCzhsh8Bw FBkd/K/YO8qC8uK3yPnJZRjV7FD5C87cHaqBhiRfl+Vv5f1+EiVrnCRu71XOQCq5GgvfYo3i1PHlL wUb+QQwM8KSc8JEyK7K4mrRnNs6NrTTUCMGfKPBTZZxONYWHNksYNdTJdCUo6oM3DAF1VaWgmms+K 1zzOXuXsY7+7KRVobnd5gZBVHfiV0Dkhw9DdxHSLQdXDDqJJxdt7mTzCa5wlswqTVyPFe7my66PsP si7ZlpcWzNpcm2hPFN0cwQEeohlJ8S/dUzCQ==; Received: by exim-smtp-546bdf5556-77j9f with esmtpa (envelope-from ) id 1u8hvt-00000000TNH-26ZH; Sat, 26 Apr 2025 18:59:13 +0300 Date: Sat, 26 Apr 2025 18:59:12 +0300 From: Artem Bunichev To: Carl Johnson Cc: freebsd-questions@freebsd.org Subject: Re: How to record audio from multiple mixer(8) devices simultaneously Message-Id: <20250426185912.5da275286d0574816f9807f2@bk.ru> In-Reply-To: <86h62a2acv.fsf@bay.localnet> References: <20250426000125.db4e9ac0ac4ed2c2ae6fdb1e@bk.ru> <86h62a2acv.fsf@bay.localnet> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.2) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD96B6D2FE69D52BFED4F3E4DD1C46049EF607956584116838F182A05F5380850404261AE2AC4C2EAE13DE06ABAFEAF6705C8ADA793B000F3BCAA1B8A0D1EFCC171319BEE7C65456626 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE721B3E54BB37EA0B4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375668B77978056C333618DCF26E2133927041A7F0F8F481B6E3D41A14B7BBAE504428EEF46B7454FC60B9742502CCDD46D0D062BEEFFB5F8EA3EF6B57BC7E64490618DEB871D839B73339E8FC8737B5C224936DA1BED736F9328CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A29E2F051442AF778941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C0AB900635900CC50B7B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F140C956E756FBB7A2AE38A8E97BAFFB1B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B38B2F2E9F2BEE38D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A51C0ACDCCA8F7478E5002B1117B3ED6966D1248510178512DC638DF663A625AFA823CB91A9FED034534781492E4B8EEAD925E54A35C6A7718BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742DC8270968E61249B1004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34D4140D813EC137C676AA9E977F121589F1BBAA64C5A9E5C53F5DCE22D9C089EE2C73A4C8756237971D7E09C32AA3244CAFB4CD3E3D33528F77DD89D51EBB77421850C44F78227218EA455F16B58544A2E30DDF7C44BCB90D8F2EB4EFC5515AAD2F60AD443A3420F5CC2E138FFB4ACBED X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVS+uSU+BUhgvRvrdsyy+lWU= X-Mailru-Sender: 412FB63E61E70785586E1AA7573D5DF3CFA98DFC755D20343DE06ABAFEAF6705C8ADA793B000F3BC87BBD21BC54961EB70B422D6B4B97F575A92E71CC7C3152D073A268A3A4203B86463BD5ADB651FAA0FC2F2912F0F98E1C77752E0C033A69E3453F38A29522196 X-Mras: Ok X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:47764, ipnet:89.221.236.0/22, country:RU] X-Rspamd-Queue-Id: 4ZlDt03nV7z3qBZ X-Spamd-Bar: ---- On Sat, 26 Apr 2025 08:47:28 -0700 Carl Johnson wrote: > Artem Bunichev writes: > > > Hi! > > > > I'm running FreeBSD 14-STABLE on ThinkPad X220 and I want to record sound from > > the integrated microphone and the system sound (sound from applications) at the > > same time. So far, I've figured how to record only one of them at a time: I > > can do this by means of setting the recording device in mixer(8). If I want > > to record from microphone, I do: mixer monitor.recsrc=set, and if I want to > > record the desktop sound, I do: mixer mic.recsrc=set. As I understand, > > recording device sets the device, which output I will get when I read > > from /dev/dsp. > > > > Actually, I want to record an audio for screencast, which I do with: > > ffmpeg -f x11grab -i :0 -f oss -i /dev/dsp -vcodec libx264 -preset fast out.mkv. > > > > So, I guess I need to find a way to make both sound from microphone and system > > sound go into /dev/dsp. But I don't know how to do this, since as I can see in > > mixer(8), only _one_ device can be used for recording. > > > > Here's the output of /dev/sndstat: > > Installed devices: > > pcm0: (play/rec) default > > pcm1: (play) > > pcm2: (play) > > pcm3: (play) > > No devices installed from userspace. > > > > The output of mixer: > > pcm0:mixer: on hdaa0 (play/rec) (default) > > vol = 1.00:1.00 pbk > > pcm = 1.00:1.00 pbk > > speaker = 1.00:1.00 pbk > > mic = 1.00:1.00 rec > > rec = 1.00:1.00 pbk > > monitor = 0.37:0.37 rec src > > > > Is the thing I want to do is even possible? If yes, how can I do that? > > I don't know if you have an answer yet, but the virtual_oss port (or > package) looks like it would probably allow you to do what you want. > > Hope that helps. > -- > Carl Johnson carlj@peak.org > Thank you for the answer, Carl! I will check it out. However, I'm quite interested in making this without third-party packages, using only base system (I like to understand how things work internally). Do I understand correctly, that current implementation of /dev/dsp in FreeBSD 14-STABLE does not allow to do what I want? Does this patch seems to allow this when applied: https://reviews.freebsd.org/D49216? Artem.