All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Behun <marek.behun@nic.cz>
To: Roderick Colenbrander <roderick@gaikai.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Pavel Machek <pavel@ucw.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	pobm@protonmail.com,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	linux-leds@vger.kernel.org,
	Roderick Colenbrander <roderick.colenbrander@sony.com>
Subject: Re: [PATCH v6 2/4] HID: playstation: add microphone mute support for DualSense.
Date: Mon, 15 Feb 2021 19:17:57 +0100	[thread overview]
Message-ID: <20210215191757.58992f44@nic.cz> (raw)
In-Reply-To: <CANndSK=6TAzJJCvcgtRe_ASLbcqb73Y81gXPu3Qhg62Dxyvmuw@mail.gmail.com>

On Mon, 15 Feb 2021 10:07:29 -0800
Roderick Colenbrander <roderick@gaikai.com> wrote:

> On Mon, Feb 15, 2021 at 6:40 AM Marek Behun <marek.behun@nic.cz> wrote:
> >
> > On Sun, 14 Feb 2021 16:45:47 -0800
> > Roderick Colenbrander <roderick@gaikai.com> wrote:
> >  
> > > From: Roderick Colenbrander <roderick.colenbrander@sony.com>
> > >
> > > The DualSense controller has a built-in microphone exposed as an
> > > audio device over USB (or HID using Bluetooth). A dedicated
> > > button on the controller handles mute, but software has to configure
> > > the device to mute the audio stream.
> > >
> > > This patch captures the mute button and schedules an output report
> > > to mute/unmute the audio stream as well as toggle the mute LED.
> > >
> > > Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>  
> >
> > Is the microphone supported via Linux? I.e. is there an audio driver
> > for it?  
> 
> Yes and no. The microphone is supported using USB, not yet using
> Bluetooth (uses a custom protocol). Actually there are various other
> audio features in the DualSense (headphone jack, speaker, volume
> controls,..) and they all work using custom protocols. We were
> planning to defer this work through future patches as the features are
> very complicated and need a deep analysis on how to realize them. For
> example audio controls work through HID, but for USB the audio driver
> is a generic hda audio device I think. Bluetooth is a custom protocol
> and will be yet a different audio driver somewhere.
> 
> > If it is, look at the audio-micmute LED trigger.
> >  
> 
> I'm not sure if the expected behavior for the DualSense is similar to
> the standard audio mute use cases. My understanding of these triggers
> (please correct me if I'm wrong) is for e.g. an audio driver or user
> space to send a signal to anything registering for a particular
> trigger. In this case a global micmute. Is that, right?
> 
> In our case for PlayStation games, there are often multiple
> controllers connected and each user has their own microphone in their
> controller. All can function at the same time (different from a
> standard PC use case). That's why I'm wondering if this makes sense.I
> know we are on Linux, but for Sony we want to properly support such
> use cases.

If there aren't audio drivers yet for this, simply have this driver
also register a private LED trigger (with name "joystick-audiomute"
or something similar), and when registering the LED, set the
trigger_type member. Look at trigger_type in include/linux/leds.h, and
in LED Documentation.

When this trigger is enabled for your LED, have your code switch LED
state like it does now. When there is no trigger enabled, the userspace
will be able to set brightness of this LED via sysfs. Before registering
the LED, assign default_trigger member so that this trigger is enabled
during registration.

This is why we have support for private LED triggers.

Marek

> > If you can't use the audio-micmute trigger because the microphone isn't
> > supported via Linux, I still think the LED should the LED should be
> > read-write. You can then register a LED private trigger. The driver should
> > change the state of the LED according to the microphone mute state only
> > if these trigger is enabled.
> >
> > Marek  
> 
> Roderick


  reply	other threads:[~2021-02-15 18:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15  0:45 [PATCH v6 00/4] HID: new driver for PS5 'DualSense' controller Roderick Colenbrander
2021-02-15  0:45 ` [PATCH v6 1/4] HID: playstation: add DualSense lightbar support Roderick Colenbrander
2021-02-15 13:31   ` Marek Behun
2021-02-15 15:36     ` Roderick Colenbrander
2021-02-15 15:55       ` Marek Behun
2021-02-15 17:51         ` Roderick Colenbrander
2021-02-15 18:21           ` Marek Behun
2021-02-16 17:29             ` Benjamin Tissoires
2021-02-16 17:56               ` Marek Behun
2021-02-16 18:14                 ` Benjamin Tissoires
2021-02-16 20:28                   ` Marek Behun
2021-02-15  0:45 ` [PATCH v6 2/4] HID: playstation: add microphone mute support for DualSense Roderick Colenbrander
2021-02-15 14:40   ` Marek Behun
2021-02-15 18:07     ` Roderick Colenbrander
2021-02-15 18:17       ` Marek Behun [this message]
2021-02-16  8:33         ` Roderick Colenbrander
2021-02-16 16:41           ` Marek Behun
2021-02-16 17:12             ` Benjamin Tissoires
2021-02-16 17:21               ` Marek Behun
2021-02-16 17:40                 ` Marek Behun
2021-02-16 17:42                 ` Benjamin Tissoires
2021-02-16 18:00                   ` Marek Behun
2021-02-15  0:45 ` [PATCH v6 3/4] HID: playstation: add DualSense player LEDs support Roderick Colenbrander
2021-02-15 23:00   ` Roderick Colenbrander
2021-02-16  0:33     ` Marek Behun
2021-02-16  1:11       ` Roderick Colenbrander
2021-02-16  2:37         ` Marek Behun
2021-02-16 17:19           ` Benjamin Tissoires
2021-02-16 17:43             ` Marek Behun
2021-02-15  0:45 ` [PATCH v6 4/4] HID: playstation: DualSense set LEDs to default player id Roderick Colenbrander
2021-02-15 14:29 ` [PATCH v6 00/4] HID: new driver for PS5 'DualSense' controller Marek Behun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210215191757.58992f44@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pobm@protonmail.com \
    --cc=roderick.colenbrander@sony.com \
    --cc=roderick@gaikai.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.