From owner-freebsd-questions@freebsd.org Sun Sep 13 23:42:03 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 B389E3ECA45 for ; Sun, 13 Sep 2020 23:42:03 +0000 (UTC) (envelope-from tim@timpreston.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BqQy24yfbz3grh for ; Sun, 13 Sep 2020 23:42:02 +0000 (UTC) (envelope-from tim@timpreston.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C390F5C00F7 for ; Sun, 13 Sep 2020 19:42:01 -0400 (EDT) Received: from imap35 ([10.202.2.85]) by compute2.internal (MEProxy); Sun, 13 Sep 2020 19:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timpreston.net; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=mesmtp; bh=jZDZHluJwHjrYIeTSs8ssz4379Kk M/vyQAeDAK3AUoY=; b=Jjo5+fsqj3AaEvIpssxg2jJSsz5jfJlrSJ74n7jpSntF nNkonagBDjcPwi2OmdSifRT8p9f77xfKDVYxmSnCIB8feTQIAaBh5W1oqho6MoFD EOkvvsYGI/YdGt4VPYkZPHUKoVqMJmF9XEc4sPAGAcAcajSJks2+vxMFa3WIuxk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=jZDZHl uJwHjrYIeTSs8ssz4379KkM/vyQAeDAK3AUoY=; b=hBjuzq6wag9HKiqSS/nCdr m45UxcqZGLxTfd4yhpuIg0KNdL4pF9g11FrrAZjaK3YN1zobkz/aaknROLPZJN7R YP7ahTyzZpTliXji1v6swSH9u94Ry+5pGqPP0vyEWaOUsuE7j779wvAVLHWA+7x7 QUtqLclrglFKzSYI1+nlO5l89GKNZs4c54eSt3mhGXDiGjT+PbMQA4M7t05ihVaW VIqNX0VnlQ6ctQFVgONmUFBqusHal9KWAyw3PHWaAtrCwtQjzZ7c/zmzK3UeFh46 kZk3L5hucJDEanzfpUZWbdYI0gehFTLBgNmG0mquoaxMvU7TNDmugGM9W5+o0aQA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeihedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfvfhimhcurfhrvghsthhonhdfuceothhimhesthhimhhp rhgvshhtohhnrdhnvghtqeenucggtffrrghtthgvrhhnpeeuffegjeeltedthefhlefhie etveduffehgedtkefhkeefueejhefhkedthefgieenucffohhmrghinhepfhhrvggvsghs ugdrohhrghdpthgvugdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehtihhmsehtihhmphhrvghsthhonhdrnhgvth X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 580BF14C0911; Sun, 13 Sep 2020 19:42:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-259-g88fbbfa-fm-20200903.003-g88fbbfa3 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Mon, 14 Sep 2020 09:41:36 +1000 From: "Tim Preston" To: freebsd-questions@freebsd.org Subject: Re: USB sound devices with FreeBSD-CURRENT Content-Type: text/plain X-Rspamd-Queue-Id: 4BqQy24yfbz3grh X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=timpreston.net header.s=mesmtp header.b=Jjo5+fsq; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=hBjuzq6w; dmarc=none; spf=pass (mx1.freebsd.org: domain of tim@timpreston.net designates 66.111.4.26 as permitted sender) smtp.mailfrom=tim@timpreston.net X-Spamd-Result: default: False [-2.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; R_DKIM_ALLOW(-0.20)[timpreston.net:s=mesmtp,messagingengine.com:s=fm3]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.26:from]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.02)[-1.019]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[timpreston.net]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; DKIM_TRACE(0.00)[timpreston.net:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-0.52)[-0.519]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.26:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_WWW(0.50)[]; MAILMAN_DEST(0.00)[freebsd-questions] 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: Sun, 13 Sep 2020 23:42:03 -0000 Hi Graham, The best article I've found so far is https://wiki.freebsd.org/Sound Hopefully you can find something useful there. I'm not switching any devices on the fly, but I am combining two USB devices (2 channel audio interface for headphones and a webcam with mic) into a single virtual device with virtual_oss, then run sndio over the top for video chat in both Firefox and Chromium (needs to be compiled with sndio support). Regards, Tim > Date: Sun, 13 Sep 2020 10:21:52 +0100 > From: Graham Perrin > To: FreeBSD CURRENT , FreeBSD questions > > Subject: USB sound devices with FreeBSD-CURRENT > Message-ID: <9551111b-5dfb-c42b-6f58-81f6c8b8bbd1@gmail.com> > Content-Type: text/plain; charset=utf-8; format=flowed > > I'm confused about use of USB devices for audio (primarily with Firefox > and Chromium). > > Re: > > under 'switching dsp-devices on-the-fly' > > > ? hw.snd.default_unit to "0", which will automatically assign > > hw.snd.default_unit to the newly-attached devices. ?" > > ? so in sysctl.conf I experimented with: > > hw.snd.default_unit="0" > > ? and after signing in (to KDE Plasma) I attach first the USB microphone > (Alctron USB700 Alctron USB700) then a USB headset (SteelSeries > SteelSeries Siberia 350). > > virtual_oss and sndiod are enabled. > > With this setup, as far as I can tell: > > 1. Chromium simply does not play AV content e.g. > ? after > a click to play, there's a moment of visual motion but no playback > > 2. if Firefox media.cubeb.backend set to oss then behaviour is the same > as Chromium > > 3. if Firefox media.cubeb.backend is not set (audio backend defaults to > pulse-rust) then playback occurs through IDT 92HD81B1X (Analog) ? not USB. > > ---- > > root@momh167-gjp4-8570p:~ # date ; uname -v > Sun Sep 13 08:25:39 BST 2020 > FreeBSD 13.0-CURRENT #64 r365364: Sun Sep? 6 01:38:18 BST 2020 > root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG > root@momh167-gjp4-8570p:~ # service virtual_oss start ; service sndiod > start ; service virtual_oss status ; service sndiod status ; cat > /dev/sndstat ; grep " -f /dev/" /usr/local/etc/rc.d/virtual_oss | grep > -v \# ; sysctl hw.snd.default_unit > Starting Virtual OSS config dsp ...hw.snd.basename_clone: 0 -> 0 > ?done > Starting sndiod. > virtual_oss is running as pid 5688. > sndiod is running as pid 5697. > Installed devices: > pcm0: (play) default > pcm1: (play/rec) > pcm2: (play/rec) > pcm3: (rec) > pcm4: (play/rec) > Installed devices from userspace: > dsp: (play/rec) > ? -f /dev/dsp0 \ > hw.snd.default_unit: 0 > root@momh167-gjp4-8570p:~ # > > ---- > > In addition, as far as I can tell: > > 4. if I remove then reconnect the two USB devices, the devices are no > longer driven > > * neither device 'lights up' > > * playback in Firefox (with oss) and Chromium is visible, but no longer > audible on any device > > * playback in Firefox (with puse-rust) is visible, but no longer audible > on any device. > > ---- > > root@momh167-gjp4-8570p:~ # grep Alctron /var/log/messages > Sep 13 06:17:08 momh167-gjp4-8570p kernel: ugen0.7: Alctron USB700> at usbus0 (disconnected) > Sep 13 06:19:07 momh167-gjp4-8570p kernel: ugen0.3: Alctron USB700> at usbus0 > Sep 13 06:19:07 momh167-gjp4-8570p kernel: uaudio0: Alctron USB700, class 0/0, rev 1.10/1.00, addr 11> on usbus0 > Sep 13 06:19:07 momh167-gjp4-8570p kernel: uhid1: Alctron USB700, class 0/0, rev 1.10/1.00, addr 11> on usbus0 > Sep 13 09:13:08 momh167-gjp4-8570p kernel: ugen0.5: Alctron USB700> at usbus0 > Sep 13 09:13:08 momh167-gjp4-8570p kernel: uaudio1: Alctron USB700, class 0/0, rev 1.10/1.00, addr 4> on usbus0 > Sep 13 09:13:08 momh167-gjp4-8570p kernel: uhid0: Alctron USB700, class 0/0, rev 1.10/1.00, addr 4> on usbus0 > Sep 13 09:48:51 momh167-gjp4-8570p kernel: ugen0.5: Alctron USB700> at usbus0 (disconnected) > root@momh167-gjp4-8570p:~ # grep SteelSeries /var/log/messages > Sep 13 06:17:22 momh167-gjp4-8570p kernel: ugen0.6: SteelSeries Siberia 350> at usbus0 (disconnected) > Sep 13 06:17:51 momh167-gjp4-8570p kernel: ugen0.6: SteelSeries Siberia 350> at usbus0 > Sep 13 06:17:51 momh167-gjp4-8570p kernel: uaudio0: SteelSeries Siberia 350, class 0/0, rev 1.10/2.08, addr 10> on usbus0 > Sep 13 06:19:00 momh167-gjp4-8570p kernel: ugen0.6: SteelSeries Siberia 350> at usbus0 (disconnected) > Sep 13 06:19:12 momh167-gjp4-8570p kernel: ugen0.7: SteelSeries Siberia 350> at usbus0 > Sep 13 06:19:12 momh167-gjp4-8570p kernel: uaudio1: SteelSeries Siberia 350, class 0/0, rev 1.10/2.08, addr 13> on usbus0 > Sep 13 09:13:08 momh167-gjp4-8570p kernel: ugen0.4: SteelSeries Siberia 350> at usbus0 > Sep 13 09:13:08 momh167-gjp4-8570p kernel: uaudio0: SteelSeries Siberia 350, class 0/0, rev 1.10/2.08, addr 3> on usbus0 > root@momh167-gjp4-8570p:~ # tail /var/log/messages > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: unregister: mixer busy > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: Waiting for sound > application to exit! > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: unregister: mixer busy > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: Waiting for sound > application to exit! > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: unregister: mixer busy > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: Waiting for sound > application to exit! > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: unregister: mixer busy > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: Waiting for sound > application to exit! > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: unregister: mixer busy > Sep 13 10:11:39 momh167-gjp4-8570p kernel: pcm4: Waiting for sound > application to exit! > root@momh167-gjp4-8570p:~ # > > ---- > > Clearly I'm doing something wrong. > > If on-the-fly use of USB audio devices is not possible, then must I keep > the devices connected whilst I'm signed in to the desktop environment? >