From owner-freebsd-questions@freebsd.org Sun Sep 13 09:21:56 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 91EDD3D1F1D; Sun, 13 Sep 2020 09:21:56 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bq3sb5qz4z3gLC; Sun, 13 Sep 2020 09:21:55 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id q9so7951670wmj.2; Sun, 13 Sep 2020 02:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=S7aYPjKOuPU2lizQy/3aaYKiFxYSTfOKHJ382aYlpt8=; b=fQqRFj3vjYLr4oomaSddhg3CpB1gubWnTDcD5vW5K6GmkoEiXLeXL5QnY5cTcqJurD gb98D18ARZDh7a/o5Bb9Xr0XfXW7XKtq9eQcuztXPPsr9LFFTN4/hrG8U59WLehSLVGZ Dtc+ZFUgBsCrNxQ/Wb0WjzqFlxyJBzypqVL8wHAXUntm8OtsJBb2NCZJcnRgGvqOqxdK ZUuXqCUacxb/GIRinA3zcl1D7cpPgvjwx5UxyDVKcEg7s+dqUQDkvM3o9PoQ1kh+nAPB MS5J5IWPi7190zL/Uw4chnp7a6tSicjBD2+/op9SYugh7qfzi/xsxTcdEjM4GmGfUg19 n2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=S7aYPjKOuPU2lizQy/3aaYKiFxYSTfOKHJ382aYlpt8=; b=W3eT7EPS6IcO7NQhwXfDGpTCRhE8m/ni+X9QPwp1e+KsLhudlwEV6G7mzdHhi8lQWx VR41Qd3l9ErYUzomlr0AmTwpvJ4jHmYDPaEz1BXpqZ6NXTbZKy0opN01EIrnbaSd9Ss3 Hrsn5zhAcBWNSPryK9AirOM4jfkP0ZI9rMDQddgV1lP9nM0L1HpNWGMw+sXHcd1wy93o kBSj8DVTnlav3cEi+HftTtuV29ukMP9VV65uhniAAOVCgyFtQmtYpB5FOorb4XEYzJec hGOSKcIrMatv53q1bnoEXcI4IGiBr6OhMrrKHe9Mn0jmF7jLLZinvVCxCP+Ke2Y20EB3 jH1g== X-Gm-Message-State: AOAM530MhazM1oWRhx06sZ4oAAOGzPO7AIKLpbJwYvXAeanigchlieHE Y7G6jiwNN8JzoJevaoSaEoxQUamUmV526w== X-Google-Smtp-Source: ABdhPJz15IksVnI41Lb+b7lp7L+4uEkMB9mLZZJbZ8vKzssIk+64MbVR7Qg4hNMVVgQVcVqZ7rctaQ== X-Received: by 2002:a1c:bdc4:: with SMTP id n187mr9977135wmf.109.1599988913851; Sun, 13 Sep 2020 02:21:53 -0700 (PDT) Received: from [192.168.2.22] (79-66-147-78.dynamic.dsl.as9105.com. [79.66.147.78]) by smtp.gmail.com with ESMTPSA id b194sm14481064wmd.42.2020.09.13.02.21.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Sep 2020 02:21:53 -0700 (PDT) From: Graham Perrin Subject: USB sound devices with FreeBSD-CURRENT To: FreeBSD CURRENT , FreeBSD questions Message-ID: <9551111b-5dfb-c42b-6f58-81f6c8b8bbd1@gmail.com> Date: Sun, 13 Sep 2020 10:21:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 4Bq3sb5qz4z3gLC X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fQqRFj3v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of grahamperrin@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=grahamperrin@gmail.com X-Spamd-Result: default: False [-3.37 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.28)[-0.278]; RECEIVED_SPAMHAUS_PBL(0.00)[79.66.147.78:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.09)[-1.091]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions,freebsd-current] 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 09:21:56 -0000 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: at usbus0 (disconnected) Sep 13 06:19:07 momh167-gjp4-8570p kernel: ugen0.3: at usbus0 Sep 13 06:19:07 momh167-gjp4-8570p kernel: uaudio0: on usbus0 Sep 13 06:19:07 momh167-gjp4-8570p kernel: uhid1: on usbus0 Sep 13 09:13:08 momh167-gjp4-8570p kernel: ugen0.5: at usbus0 Sep 13 09:13:08 momh167-gjp4-8570p kernel: uaudio1: on usbus0 Sep 13 09:13:08 momh167-gjp4-8570p kernel: uhid0: on usbus0 Sep 13 09:48:51 momh167-gjp4-8570p kernel: ugen0.5: at usbus0 (disconnected) root@momh167-gjp4-8570p:~ # grep SteelSeries /var/log/messages Sep 13 06:17:22 momh167-gjp4-8570p kernel: ugen0.6: at usbus0 (disconnected) Sep 13 06:17:51 momh167-gjp4-8570p kernel: ugen0.6: at usbus0 Sep 13 06:17:51 momh167-gjp4-8570p kernel: uaudio0: on usbus0 Sep 13 06:19:00 momh167-gjp4-8570p kernel: ugen0.6: at usbus0 (disconnected) Sep 13 06:19:12 momh167-gjp4-8570p kernel: ugen0.7: at usbus0 Sep 13 06:19:12 momh167-gjp4-8570p kernel: uaudio1: on usbus0 Sep 13 09:13:08 momh167-gjp4-8570p kernel: ugen0.4: at usbus0 Sep 13 09:13:08 momh167-gjp4-8570p kernel: uaudio0: 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?