From owner-freebsd-questions@freebsd.org Tue Jul 21 02:28:01 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD8C33726E0 for ; Tue, 21 Jul 2020 02:28:01 +0000 (UTC) (envelope-from freebsd@gregv.net) Received: from aurora.gregv.net (aurora.gregv.net [192.111.144.138]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9jDw5y47z3gJk for ; Tue, 21 Jul 2020 02:28:00 +0000 (UTC) (envelope-from freebsd@gregv.net) Received: by aurora.gregv.net (Postfix, from userid 1001) id 9C4BF70; Mon, 20 Jul 2020 22:27:54 -0400 (EDT) Date: Mon, 20 Jul 2020 22:27:54 -0400 From: Greg Veldman To: "Russell L. Carter" Cc: freebsd-questions@freebsd.org Subject: Re: forwarding audio from a (bhyve) vm Message-ID: <20200721022754.GM67461@aurora.gregv.net> References: <295d43ec-b5dc-2899-5d22-fb0b5d8ff5cb@pinyon.org> <20200720120813.4b020a5b.freebsd@edvax.de> <08284be8-6508-0451-312b-b575dc6d4331@pinyon.org> <42870245-d3c6-be29-242b-67b7697d7402@pinyon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42870245-d3c6-be29-242b-67b7697d7402@pinyon.org> X-Rspamd-Queue-Id: 4B9jDw5y47z3gJk X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gregv.net has no SPF policy when checking 192.111.144.138) smtp.mailfrom=freebsd@gregv.net X-Spamd-Result: default: False [1.21 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.03)[-0.028]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[10.0.2.1:email]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gregv.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DBL_PROHIBIT(0.00)[10.0.2.1:email]; NEURAL_HAM_SHORT(-0.20)[-0.204]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.54)[0.541]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:31863, ipnet:192.111.144.0/20, country:US] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 02:28:01 -0000 On Mon, Jul 20, 2020 at 04:00:22PM -0700, Russell L. Carter wrote: > On 2020-07-20 15:06, Russell L. Carter wrote: > > Seren looks perfect.?? However it uses alsa to access the "sound card", > > which I see from googling should be achievable in a bhyve vm by > > configuring the HDA emulation. Evidently, after consulting > > https://wiki.freebsd.org/SummerOfCode2016/HDAudioEmulationForBhyve > > and > > https://forums.freebsd.org/threads/what-is-the-current-status-of-audio-emulation-in-bhyve.74557/ > > > > > > I should be able to achieve this using vm-bhyve by setting > > > > bhyve_options="-s 9,hda,play=/dev/dsp1,rec=/dev/dsp1" > > > > in the vm template file. > > Oh well, the vm fails to start with this template configuration. > I am not sure how to fix it. There is only one vm running, so > I don't think bhyve should be running out of slots/devices. > There is no audio hardware in the bhyve host... is that a > problem? I don't want to listen on the bhyve host, I want to > ship the audio over the physical network to another FreeBSD > system. > > Both the bhyve host and the target system are running FreeBSD > 12/stable from the beginning of July. I currently do this with some of my systems, I use sndio and have had no issues at all. My current setup is all FreeBSD hosts, but sndio runs on GNU/Linux and NetBSD, OpenBSD (in fact it's originally from OpenBSD I believe). On the host you wish to send the audio from: $ grep -i audio .bashrc export AUDIODEVICE="snd@10.0.2.1/0" On the host you wish to hear the audio on: $ grep -i sndio /etc/rc.conf sndiod_enable="YES" sndiod_dev="rsnd/$($SYSCTL -n hw.snd.default_unit)" sndiod_flags="-f ${sndiod_dev} -c 0:7 -j off -s default -m mon -s monitor -L 10.0.2.1" $ grep -i snd /etc/sysctl.conf # Default sound device (from /dev/sndstat) hw.snd.default_unit=2 See the sndio(7) manpage for setting up the cookie on both hosts to handle authentication. -- Greg Veldman freebsd@gregv.net