From owner-freebsd-current@freebsd.org Sun Sep 13 12:56:57 2020 Return-Path: Delivered-To: freebsd-current@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 6F59E3D93B6; Sun, 13 Sep 2020 12:56:57 +0000 (UTC) (envelope-from samy.mahmoudi@gmail.com) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 4Bq8dh2y76z48tr; Sun, 13 Sep 2020 12:56:56 +0000 (UTC) (envelope-from samy.mahmoudi@gmail.com) Received: by mail-pj1-x102c.google.com with SMTP id jw11so3986147pjb.0; Sun, 13 Sep 2020 05:56:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xCHqxnRmtCEkuIit5Ar6hogVFzSz8d9pu/nTHGGTnVY=; b=SB6LTF5mibWxbia5SZMLqvcFPOfVc8YPir6Y4I0F0w7VG99cZvhQp8xtZq4cbatkyG X2K/MJH5Y33xd6aHq56m41JxCzKGbaEYoEGJqMeFp4o9sAUGxgghx7r2DfQIxHCTCkKv RcWNmu7XmIELQyD+zTR2Ll/S9MCaz+2ErcslQ7Or5Q1fZIh9dUdrSWXQBgkDMGu4gl74 Y1BKbKXjwEfAPJIE8HtzcM2eP7fHRLgZ6ghBUr9AeVuZ4GuxyhW+E8NUfJqxJAdm+JSt IUxovVbhB5Dk3UaBW5O7X002duxZnayvCkgHMiAlScHVGgjzeWjRpS5ntqzlC0LWa4eh wwUg== X-Gm-Message-State: AOAM532mOlG+EAUslNxMJFuL+dXYxWNdEG/kZLcozGe2qBFz1jStchBz Rzn3l+VZqP+tlzieYodPhvphJEZenWjH7brq0Xc= X-Google-Smtp-Source: ABdhPJwfN+Rv40AmnZtpk59sLBeGFBaYy152fbLg8TJrj6qKF1qnsPipjmgyGK0ZYmYTQPL+GwUE1uRjvoDUNEgDmzY= X-Received: by 2002:a17:90a:9a92:: with SMTP id e18mr9766299pjp.211.1600001814830; Sun, 13 Sep 2020 05:56:54 -0700 (PDT) MIME-Version: 1.0 References: <9551111b-5dfb-c42b-6f58-81f6c8b8bbd1@gmail.com> In-Reply-To: From: Samy Mahmoudi Date: Sun, 13 Sep 2020 14:56:43 +0200 Message-ID: Subject: Re: USB sound devices with FreeBSD-CURRENT To: Tomasz CEDRO Cc: Graham Perrin , FreeBSD CURRENT , FreeBSD questions X-Rspamd-Queue-Id: 4Bq8dh2y76z48tr X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.63 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.03)[-1.030]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; NEURAL_HAM_LONG(-0.97)[-0.973]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102c:from]; NEURAL_HAM_SHORT(-0.63)[-0.629]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current,freebsd-questions]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 12:56:57 -0000 Hi, If reducing the audio buffer size in virtual_oss does not solve the issue and you temporarily resort to use PulseAudio to achieve switching devices on-the-fly (which does work very well with PulseAudio), you could indeed 'keep the devices connected' and use a variant of the following script: #!/usr/local/bin/zsh SINK_INDEX1=1 SINK_INDEX2=4 ACTIVE_SINK=$(pacmd list-sinks | grep '* index:' | /usr/local/bin/grep -o '[0-9]*') if [ "$ACTIVE_SINK" = $SINK_INDEX1 ] ; then pacmd set-default-sink $SINK_INDEX2 pacmd list-sink-inputs | awk '/index:/{print $2}' | xargs -r -I{} pacmd move-sink-input {} $SINK_INDEX2 else pacmd set-default-sink $SINK_INDEX1 pacmd list-sink-inputs | awk '/index:/{print $2}' | xargs -r -I{} pacmd move-sink-input {} $SINK_INDEX1 fi In its current form, it allowed me to switch devices on-the-fly with a keyboard shortcut. The problem is I had to use a poudriere to build relevant ports with option PULSEAUDIO (chromium, firefox, mpv, audacious, virtualbox, etc.) and there may have been (I can not remember precisely) another problem if the USB headset was either hot-plugged or hot-unplugged. Please let us know if you manage to sort this out with virtual_oss.