From 71aa4720a4194e9602271634d9042b8e56a8217f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 24 Nov 2020 18:57:41 +0200 Subject: [PATCH] alsa-mixer: Add OnePlus Bullets udev rule --- src/modules/alsa/90-pulseaudio.rules | 3 ++ .../profile-sets/simple-headphones-mic.conf | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/modules/alsa/mixer/profile-sets/simple-headphones-mic.conf diff --git a/src/modules/alsa/90-pulseaudio.rules b/src/modules/alsa/90-pulseaudio.rules index 83b257df6..4de40127e 100644 --- a/src/modules/alsa/90-pulseaudio.rules +++ b/src/modules/alsa/90-pulseaudio.rules @@ -147,6 +147,9 @@ ATTRS{idVendor}=="0951", ATTRS{idProduct}=="16ff", ENV{ID_ID}="usb-HyperX_Cloud_ ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1702", ENV{ID_ID}="usb-HyperX_Cloud_Orbit_S_Hi-Res_2Ch-$env{ID_USB_INTERFACE_NUM}" ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1703", ENV{ID_ID}="usb-HyperX_Cloud_Orbit_S_3D_8Ch-$env{ID_USB_INTERFACE_NUM}" +# OnePlus Type-C Bullets (ED117) +ATTRS{idVendor}=="2a70", ATTRS{idProduct}=="1881", ENV{PULSE_PROFILE_SET}="simple-headphones-mic.conf" + GOTO="pulseaudio_end" LABEL="pulseaudio_check_pci" diff --git a/src/modules/alsa/mixer/profile-sets/simple-headphones-mic.conf b/src/modules/alsa/mixer/profile-sets/simple-headphones-mic.conf new file mode 100644 index 000000000..809d01587 --- /dev/null +++ b/src/modules/alsa/mixer/profile-sets/simple-headphones-mic.conf @@ -0,0 +1,42 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +; This is a profile meant for simple (stereo + mic) headphones. +; default.conf also works but using this one will hide some profiles +; that don't make sense like IEC958 and multichannel inputs. + +[General] +auto-profiles = yes + +[Mapping analog-stereo] +device-strings = front:%f +channel-map = left,right +paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-headphones analog-output-headphones-2 +paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic +priority = 15 + +# If everything else fails, try to use hw:0 as a stereo device... +[Mapping stereo-fallback] +device-strings = hw:%f +fallback = yes +channel-map = front-left,front-right +paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-headphones analog-output-headphones-2 +paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic analog-input-headset-mic +priority = 1 + +[Mapping analog-mono] +device-strings = hw:%f,0,0 +channel-map = mono +direction = input