[PATCH 0/9] ALSA: usb-audio: Support jack detection on Sony DualSense PS5

Cristian Ciocaltea posted 9 patches 6 months, 3 weeks ago
sound/usb/mixer_quirks.c | 571 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 418 insertions(+), 153 deletions(-)
[PATCH 0/9] ALSA: usb-audio: Support jack detection on Sony DualSense PS5
Posted by Cristian Ciocaltea 6 months, 3 weeks ago
The Sony DualSense PS5 controller has an internal mono speaker, but it
also provides a 3.5mm jack socket for headphone output and headset
microphone input.

Since this is a UAC1 device, it doesn't advertise any jack detection
capability.  However, the controller is able to report HP & MIC insert
events via HID, i.e. through a dedicated input device managed by the
hid-playstation driver [1].

This patch series implements a quirk to create the jack controls for
headphone and headset mic, respectively, and registers an input handler
for each of them in order to intercept the related hotplug events.

It's worth noting there is no hard dependency on the HID patch set [1],
as the usb-audio driver will simply bind the jack controls to the input
devices when they become available - this is managed internally by the
input handler framework.

Unrelated to the above, the series also provides fixes to a bunch of
general coding style issues as reported by checkpatch.

[1] https://lore.kernel.org/all/20250526-dualsense-hid-jack-v1-0-a65fee4a60cc@collabora.com/

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Cristian Ciocaltea (9):
      ALSA: usb-audio: Fix code alignment in mixer_quirks
      ALSA: usb-audio: Fix whitespace & blank line issues in mixer_quirks
      ALSA: usb-audio: Avoid precedence issues in mixer_quirks macros
      ALSA: usb-audio: Fix block comments in mixer_quirks
      ALSA: usb-audio: Drop unnecessary parentheses in mixer_quirks
      ALSA: usb-audio: Avoid multiple assignments in mixer_quirks
      ALSA: usb-audio: Simplify NULL comparison in mixer_quirks
      ALSA: usb-audio: Remove unneeded wmb() in mixer_quirks
      ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5

 sound/usb/mixer_quirks.c | 571 ++++++++++++++++++++++++++++++++++-------------
 1 file changed, 418 insertions(+), 153 deletions(-)
---
base-commit: 7bac2c97af4078d7a627500c9bcdd5b033f97718
change-id: 20250526-dualsense-alsa-jack-480cb1d7dff4
Re: [PATCH 0/9] ALSA: usb-audio: Support jack detection on Sony DualSense PS5
Posted by Takashi Iwai 6 months, 2 weeks ago
On Mon, 26 May 2025 16:07:39 +0200,
Cristian Ciocaltea wrote:
> 
> The Sony DualSense PS5 controller has an internal mono speaker, but it
> also provides a 3.5mm jack socket for headphone output and headset
> microphone input.
> 
> Since this is a UAC1 device, it doesn't advertise any jack detection
> capability.  However, the controller is able to report HP & MIC insert
> events via HID, i.e. through a dedicated input device managed by the
> hid-playstation driver [1].
> 
> This patch series implements a quirk to create the jack controls for
> headphone and headset mic, respectively, and registers an input handler
> for each of them in order to intercept the related hotplug events.
> 
> It's worth noting there is no hard dependency on the HID patch set [1],
> as the usb-audio driver will simply bind the jack controls to the input
> devices when they become available - this is managed internally by the
> input handler framework.
> 
> Unrelated to the above, the series also provides fixes to a bunch of
> general coding style issues as reported by checkpatch.
> 
> [1] https://lore.kernel.org/all/20250526-dualsense-hid-jack-v1-0-a65fee4a60cc@collabora.com/
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

Thanks for patches.  Through a quick glance, the code change looks OK,
but since it's with significant amount of changes, so I'll postpone
after 6.16 merge window (once after I'm back from traveling).


Takashi
Re: [PATCH 0/9] ALSA: usb-audio: Support jack detection on Sony DualSense PS5
Posted by Cristian Ciocaltea 6 months, 2 weeks ago
On 6/2/25 5:55 PM, Takashi Iwai wrote:
> On Mon, 26 May 2025 16:07:39 +0200,
> Cristian Ciocaltea wrote:
>>
>> The Sony DualSense PS5 controller has an internal mono speaker, but it
>> also provides a 3.5mm jack socket for headphone output and headset
>> microphone input.
>>
>> Since this is a UAC1 device, it doesn't advertise any jack detection
>> capability.  However, the controller is able to report HP & MIC insert
>> events via HID, i.e. through a dedicated input device managed by the
>> hid-playstation driver [1].
>>
>> This patch series implements a quirk to create the jack controls for
>> headphone and headset mic, respectively, and registers an input handler
>> for each of them in order to intercept the related hotplug events.
>>
>> It's worth noting there is no hard dependency on the HID patch set [1],
>> as the usb-audio driver will simply bind the jack controls to the input
>> devices when they become available - this is managed internally by the
>> input handler framework.
>>
>> Unrelated to the above, the series also provides fixes to a bunch of
>> general coding style issues as reported by checkpatch.
>>
>> [1] https://lore.kernel.org/all/20250526-dualsense-hid-jack-v1-0-a65fee4a60cc@collabora.com/
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> 
> Thanks for patches.  Through a quick glance, the code change looks OK,
> but since it's with significant amount of changes, so I'll postpone
> after 6.16 merge window (once after I'm back from traveling).

Sure, no worries, take your time!  Thanks for the early feedback!

Cristian
Re: [PATCH 0/9] ALSA: usb-audio: Support jack detection on Sony DualSense PS5
Posted by Takashi Iwai 6 months, 1 week ago
On Mon, 26 May 2025 16:07:39 +0200,
Cristian Ciocaltea wrote:
> 
> The Sony DualSense PS5 controller has an internal mono speaker, but it
> also provides a 3.5mm jack socket for headphone output and headset
> microphone input.
> 
> Since this is a UAC1 device, it doesn't advertise any jack detection
> capability.  However, the controller is able to report HP & MIC insert
> events via HID, i.e. through a dedicated input device managed by the
> hid-playstation driver [1].
> 
> This patch series implements a quirk to create the jack controls for
> headphone and headset mic, respectively, and registers an input handler
> for each of them in order to intercept the related hotplug events.
> 
> It's worth noting there is no hard dependency on the HID patch set [1],
> as the usb-audio driver will simply bind the jack controls to the input
> devices when they become available - this is managed internally by the
> input handler framework.
> 
> Unrelated to the above, the series also provides fixes to a bunch of
> general coding style issues as reported by checkpatch.
> 
> [1] https://lore.kernel.org/all/20250526-dualsense-hid-jack-v1-0-a65fee4a60cc@collabora.com/
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Cristian Ciocaltea (9):
>       ALSA: usb-audio: Fix code alignment in mixer_quirks
>       ALSA: usb-audio: Fix whitespace & blank line issues in mixer_quirks
>       ALSA: usb-audio: Avoid precedence issues in mixer_quirks macros
>       ALSA: usb-audio: Fix block comments in mixer_quirks
>       ALSA: usb-audio: Drop unnecessary parentheses in mixer_quirks
>       ALSA: usb-audio: Avoid multiple assignments in mixer_quirks
>       ALSA: usb-audio: Simplify NULL comparison in mixer_quirks
>       ALSA: usb-audio: Remove unneeded wmb() in mixer_quirks
>       ALSA: usb-audio: Add mixer quirk for Sony DualSense PS5

Now merged to for-next branch.


thanks,

Takashi