From nobody Wed Apr 19 20:38:51 2023 X-Original-To: freebsd-multimedia@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q1t1N4RqZz46Qrv for ; Wed, 19 Apr 2023 20:39:04 +0000 (UTC) (envelope-from tmarjeski@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q1t1N1NlSz3Mhv for ; Wed, 19 Apr 2023 20:39:04 +0000 (UTC) (envelope-from tmarjeski@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f18123d9f6so1239135e9.0 for ; Wed, 19 Apr 2023 13:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681936743; x=1684528743; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JNMrIVpCDM0qbbeEEKSrvmxtKWv0KFt3a2/YZA0Vu1g=; b=hI+vgUnFXgIlouzNeOR5G5/nkn5fSAYSR2rJfYsUa+HrlqOzf+lWwjMWVAndqwN291 xosBTgwz/WJ1A2+UaYD22EkrPVuZyJ3V/D7cOWSrusncbIG0zMPrBqx9Lidw2OJQdmOF ClGZTKnUDUoJvCGg7u4wl6CJoQ1CsAajQJKntQaJhEGUtiL8ISzNwdvbfzed+uw9Yz0E y9INIF6+DT4bjyqfsfTRNsUKpIsgmOk5yizCoLSC1Hv4687PVxmhoGUGymyyJKQiOFSX 3ncQ7UPEVbAay1fq1ngUlaCr//vWYkwoAs2HOIW/oNVGSeoyb8QEelzlmQORrcaXlbVn k0MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681936743; x=1684528743; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JNMrIVpCDM0qbbeEEKSrvmxtKWv0KFt3a2/YZA0Vu1g=; b=TNospS/TxCVTLPZ47s8fiC/HUVmAY7L/nPY8EZifPvBwk7fEnwUZUc/6Koh2+KA4ZA 7UX6hPrCj/1EF0oE9XxUhVUbtX6I5HAGCBILBrXrbagPb5AUqaoT6LF4ltDbFrcGXdAl rBOsLhYZzwbRAPQm5UpQTK3ClHyd1ZUWC/ppJ97fDYbATaAFdxj07HEa0dLycFSsPlaa JWNOKo6BuCwR75oB1atMcdaUd4DUVx7dB4Wir59Ivg9gmtGoXfvJKuZkRxuSOFhA3kUf p66Eh4yvBF0JMFBrEnGblxjXOgm20+GTUX7zjgd4WjseTbyE0LuFXdsh5au3lkpo7GD8 A9sw== X-Gm-Message-State: AAQBX9eVzEmBaJSyyOeDieBhrCToLqjIoYxfaqOcwiGGCupQ1yLwybQz Irsty/p3N5Ao/iuJzTWqPiO7K1LSFYh2Hp/6D6crfHoaRx9QFg== X-Google-Smtp-Source: AKy350YK1T9Y72JVyPgXMLAE/uuRbe/nIXg2x2Xclk7d7l4sHF9d0qsuUrASDmOjKX/KsvTPUzGLcJu/HSFVLXE5ep4= X-Received: by 2002:a5d:674f:0:b0:2f7:53ff:723c with SMTP id l15-20020a5d674f000000b002f753ff723cmr5128088wrw.66.1681936742850; Wed, 19 Apr 2023 13:39:02 -0700 (PDT) List-Id: Multimedia discussions List-Archive: https://lists.freebsd.org/archives/freebsd-multimedia List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-multimedia@freebsd.org MIME-Version: 1.0 References: <0b5091eb-342f-5e0f-2b6e-01c1b6a8af70@selasky.org> In-Reply-To: <0b5091eb-342f-5e0f-2b6e-01c1b6a8af70@selasky.org> From: Trevor Arjeski Date: Wed, 19 Apr 2023 23:38:51 +0300 Message-ID: Subject: Re: Possibility of remapping USB PCM device To: Hans Petter Selasky Cc: freebsd-multimedia@freebsd.org Content-Type: multipart/alternative; boundary="00000000000017a3c605f9b66aa3" X-Rspamd-Queue-Id: 4Q1t1N1NlSz3Mhv X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000017a3c605f9b66aa3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Hans, It seems that virtual_oss could do what I need, except that I don't think I can control the devices from mixer(1), which was my main goal. I basically want to tell the pcm driver how to set up the usb headset sinks and mic, but maybe there is no way to do that either. I thought that device.hints(5) was the way to go, but I don't know what the heck I'm doing! Trevor On Wed, Apr 19, 2023 at 12:42=E2=80=AFAM Hans Petter Selasky wrote: > On 4/18/23 20:56, Trevor Arjeski wrote: > > Hi all, > > I am new to FreeBSD and I am in the midst of setting up things the way = I > > like them on my desktop. I have a strange USB headset that requires a > > special configuration on linux - pulseaudio includes this configuration= , > > and I was wondering if there is a possibility it can be done in FreeBSD= . > > > > Below is a description of the device from the pulseaudio source code fr= om > > this commit > > > https://github.com/pulseaudio/pulseaudio/commit/814419cc3d788acb9113a3d62= c373deb1a911e75 > > > > | Steelseries Arctis 7 USB headset mono output path. The headset has tw= o > > | output devices. The first one is mono, meant for voice audio, and the > > | second one is stereo, meant for everything else. The purpose of this > > | unusual design is to provide separate volume controls for voice and > > | other audio, which can be useful in gaming. > > | This path doesn't provide hardware volume control, because the stereo > > | output is controlled by the PCM element with index 1, and currently > > | PulseAudio only supports elements with index 0. > > > > The last sentence is what I am trying to achieve, somehow, so that I ca= n > > control the volume. > > > > I have already gone through all the sysctl's on the two pcm devices, an= d > > messed with all the available mixer settings. My assumption is that > FreeBSD > > is doing what Linux was doing before the pulseaudio patch - not allowin= g > > "index 1" - whatever that means. > > > > Any information is welcome. I would even be interested in patching some > of > > the driver code for my own learning (doesn't need to go upstream). I am > > running CURRENT and can rebuild the system and kernel. > > > > Thanks. > > > > Hi, > > Maybe virtual_oss (my own invention) can solve your problem. > > It allows you to create a virtual /dev/dsp device. > > During usage you can run: > > virtual_oss_cmd /dev/vdsp.ctl -P /dev/dspX > > To change the playback device only, or -f to change both. > > Then all applications using /dev/dsp follow this change, with no need to > restart anything! > > --HPS > --00000000000017a3c605f9b66aa3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Hans,

It seems that v= irtual_oss could do what I need, except that I don't think I can contro= l the devices from mixer(1), which was my main goal.
I basically = want to tell the pcm driver how to set up the usb headset sinks and mic, b= ut maybe there is no way to do that either.
I thought that device= .hints(5) was the way to go, but I don't know what the heck I'm doi= ng!

Trevor

On Wed, Apr 19, 2023 at 12:42= =E2=80=AFAM Hans Petter Selasky <hps@= selasky.org> wrote:
On 4/18/23 20:56, Trevor Arjeski wrote:
> Hi all,
> I am new to FreeBSD and I am in the midst of setting up things the way= I
> like them on my desktop. I have a strange USB headset that requires a<= br> > special configuration on linux - pulseaudio includes this configuratio= n,
> and I was wondering if there is a possibility it can be done in FreeBS= D.
>
> Below is a description of the device from the pulseaudio source code f= rom
> this commit
> https:/= /github.com/pulseaudio/pulseaudio/commit/814419cc3d788acb9113a3d62c373deb1a= 911e75
>
> | Steelseries Arctis 7 USB headset mono output path. The headset has t= wo
> | output devices. The first one is mono, meant for voice audio, and th= e
> | second one is stereo, meant for everything else. The purpose of this=
> | unusual design is to provide separate volume controls for voice and<= br> > | other audio, which can be useful in gaming.
> | This path doesn't provide hardware volume control, because the s= tereo
> | output is controlled by the PCM element with index 1, and currently<= br> > | PulseAudio only supports elements with index 0.
>
> The last sentence is what I am trying to achieve, somehow, so that I c= an
> control the volume.
>
> I have already gone through all the sysctl's on the two pcm device= s, and
> messed with all the available mixer settings. My assumption is that Fr= eeBSD
> is doing what Linux was doing before the pulseaudio patch - not allowi= ng
> "index 1" - whatever that means.
>
> Any information is welcome. I would even be interested in patching som= e of
> the driver code for my own learning (doesn't need to go upstream).= I am
> running CURRENT and can rebuild the system and kernel.
>
> Thanks.
>

Hi,

Maybe virtual_oss (my own invention) can solve your problem.

It allows you to create a virtual /dev/dsp device.

During usage you can run:

virtual_oss_cmd /dev/vdsp.ctl -P /dev/dspX

To change the playback device only, or -f to change both.

Then all applications using /dev/dsp follow this change, with no need to restart anything!

--HPS
--00000000000017a3c605f9b66aa3--