Setting these callbacks adds the HW_{VOLUME,MUTE}_CTRL flag even when
PulseAudio is solely responsible for performing attenuation whilst only
keeping the peer posted on changes. For this case the hardware callback
is not registered at all but instead a hook is attached to catch
PA_CORE_HOOK_{SINK,SOURCE}_VOLUME_CHANGED. Only when the peer performs
attenuation (the peer is in HeadSet/HandsFree role) are the callbacks
used, without touching PA software volume at all. A future change could
potentially use software volume to compensate for the extremely coarse
16 steps of volume control in HSP and HFP, and to allow volume over
100%.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/519>
Since commit cb91d7a1 the watermark is increased when there is nothing to rewind.
This is also done in the case when there was actually no rewind requested at all,
so the watermark is increased needlessly.
This patch fixes the issue by skipping the rewind if none is requested.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/530>
Originally written for A2DP this rework of that patch enables late-bound
hardware volume control on HFP and HSP. As per the specification the
headphones (where gain control for both speaker and microphone could
happen in hardware on the peer) are supposed to send initial values for
these before the SCO connection is created; these `AT+VG[MS]` commands
are also used to determine support for it. PA uses this information in
`add_{sink,source}` to attach hardware volume callbacks, _if_ it is
supported. Otherwise PA performs the attenuation in software.
Unfortunately headphones like the WH-1000XM3's connect to A2DP
initially and only send `AT+VGS` (microphone hardware gain is not
supported) _during_ SCO connection when the user switches to the HFP
profile afterwards; the callbacks set up dynamically in
`rfcomm_io_callback` are written after the sink and source have been
created (`add_{sink,source}`), leaving them without hardware volume
callbacks and with software volume when adjusted on the PA side. (The
headphones can still send volume updates resulting in abrupt changes if
software and peer volume differ. Furthermore the same attenuation is
applied twice - once in PA software, once on the peer).
To solve this problem we simply check whether the callbacks have been
attached whenever the peer sends a volume change, and if not attach the
callbacks to the sink/source and reset software volume.
Fixes: d510ddc7f ("bluetooth: Perform software attenuation until HF/HS reports gain control")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/528>
HF/HS hardware attenuation is optional on HFP: the peer indicates
support with the AT+BRSF command, when bit 4 is set. That does not
explicitly mandate speaker or microphone gain control; either is
dynamically detected as soon as `AT+VG[MS]=` is received. Otherwise
software attenuation is performed.
It is also optional on HSP but nothing is mentioned about feature
detection, assume it is the same as HFP: perform software attenuation
until the HF/HS peer sends an `AT+VG[MS]=` command.
When PA is a HS/HF (and the peer the AG) we attenuate both channels in
software and unconditionally keep the peer up to date with
`AT+VGM/AT+VGS` commands.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/521>
Generalize the distinction between local and peer-attenuated volumes
into a function, paving the way for future changes where this needs to
be checked in more places and when A2DP Absolute Volume support is
added.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/521>
Sink and source naming is more generic when dealing with audio that is
directional in the sense that it either goes to or comes from the other
device, but not necessarily a microphone or speaker. A concrete example
is the swapped meaning when the current device is in the HeadSet
profile. The incoming audio can come from any source, not necessarily a
microphone. Likewise, audio captured by the microphone of the headset is
not necessarily played back by a speaker on the AG, it is merely acting
as a sink for the data: further handling is irrelevant to the naming.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/521>
For the upcoming A2DP AVRCP Absolute Volume feature the code in BlueZ5
has to be generic to be reusable. Move this conversion so that it
becomes possible to implement A2DP volume - which uses different values
- on top without duplicating existing callback functionality.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/521>
The format of COMMAND line sent from HS to AG is COMMAND<cr>
The format of RESPONSE line sent from AG to HS is <cr><lf>RESPONSE<cr><lf>
Split rfcomm_write into rfcomm_write_command and rfcomm_write_response to handle
line formatting correctly.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/520>
Commit 4868fcf5f3 ("daemon: Rely on
systemd unit file for X11 plugin initialization") added a new systemd
unit file, pulseaudio-x11.service, generated from a respective .in file.
Unfortunately, this was only hooked up to meson, and is not currently
installed by autotools. Among other breakage, "make dist" produces a
tarball that meson is then unable to build (because a file is missing).
Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/514>
On cpu-volume-test, cpu_info is initialized only on i386/amd64 systems,
and otherwise passed on to pa_cpu_init_orc() uninitialized.
If one was unlucky enough, they could end up with cpu_info.cpu_type ==
PA_CPU_X86 on a non-x86 system, and use and test the Orc codepath
without that being functional, and thus with the test failing.
This has been observed in the wild on the ppc64el Debian buildds. See
Debian bug #982740 for more context.
Define cpu_info here in the same way as in other tests.
Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/511>
Intel TGL HDMI/DP codec provides 9 pins (Linux kernel, 9a11ba7388f16:
ALSA: hda: hdmi - add Tigerlake support), and with the DP MST enabled,
the linux kernel will build 11 output devices (3, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16), and the alsa-lib will map 11 PCM devices from HDMI:0
to HDMI:10, but current pulseaudio only supports 8 HDMI/DP devices,
if users plug the HDMI/DP monitor to the last 3 ports, the users will
not see the output device from pulseaudio or gnome.
We have experienced this issue on a dell TGL machine with a dock, we
plugged 2 HDMP/DP monitors on the dock, but we could only see 1
HDMI/DP output device from pulseaudio or gnome, through investigation,
we found one monitor is plugged in the 2nd port from last.
Here we add 3 HDMI/DP output devices.
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/495>