From owner-freebsd-questions@freebsd.org Thu Jul 23 00:50:40 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 3E048365577 for ; Thu, 23 Jul 2020 00:50:40 +0000 (UTC) (envelope-from rcarter@pinyon.org) Received: from h2.pinyon.org (h2.pinyon.org [65.101.20.170]) (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 4BBtzg25RYz3TLr for ; Thu, 23 Jul 2020 00:50:39 +0000 (UTC) (envelope-from rcarter@pinyon.org) Received: from [10.0.10.15] (unknown [10.0.10.15]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by h2.pinyon.org (Postfix) with ESMTPSA id CB26D43103 for ; Wed, 22 Jul 2020 17:50:31 -0700 (MST) Subject: Re: forwarding audio from a (bhyve) vm To: freebsd-questions@freebsd.org 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> <20200721022754.GM67461@aurora.gregv.net> From: "Russell L. Carter" Message-ID: <93920d59-a06c-62c6-7393-c19a2db2ed88@pinyon.org> Date: Wed, 22 Jul 2020 17:50:31 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200721022754.GM67461@aurora.gregv.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BBtzg25RYz3TLr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rcarter@pinyon.org designates 65.101.20.170 as permitted sender) smtp.mailfrom=rcarter@pinyon.org X-Spamd-Result: default: False [-1.53 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_SPAM_SHORT(0.27)[0.274]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[10.0.2.1:email]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.95)[-0.953]; DMARC_NA(0.00)[pinyon.org]; DBL_PROHIBIT(0.00)[10.0.2.1:email]; NEURAL_HAM_MEDIUM(-0.55)[-0.555]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:209, ipnet:65.101.0.0/18, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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: Thu, 23 Jul 2020 00:50:40 -0000 Hi Greg, sndio, if it can be made to work, also appears perfect. In summary, I want to run multiple vm's in a Facebook cast-off server that has 32 threads and 128GB of memory... but no audio hardware. Adding the hda device to bhyve doesn't seem to work, I am guessing, because there is no physical audio hw in the bhyve host. The latest tarball of sndio compiles and installs cleanly on ancienne Debian 9. But what about sound devices? A couple of questions inline, if possible: On 2020-07-20 19:27, Greg Veldman wrote: > 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" You don't need to start sndiod on the audio server system for the client system to connect? > > 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" That looks very good. My target system has a non-default "default". Thank you, Russell > $ 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. >