platform/upstream/pulseaudio.git
3 years agotests: Update ladspa-dbus to Python 3
Marijn Suijten [Tue, 19 Jan 2021 19:33:11 +0000 (20:33 +0100)]
tests: Update ladspa-dbus to Python 3

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/477>

3 years agotreewide: Use DBus defines instead of direct string literals
Marijn Suijten [Thu, 7 Jan 2021 23:36:06 +0000 (00:36 +0100)]
treewide: Use DBus defines instead of direct string literals

While cleaning up the BlueZ counterpart of strings defined in
preprocessor macros it is only consistent to take care of all DBUS_
macros as a whole.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/477>

3 years agobluetooth: Consistently use BlueZ defines for strings
Marijn Suijten [Tue, 19 Jan 2021 19:27:35 +0000 (20:27 +0100)]
bluetooth: Consistently use BlueZ defines for strings

These errors and interface names shoudld all reuse predefined constants.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/477>

3 years agobluetooth: Unify BlueZ macro defines shared between util and native
Marijn Suijten [Thu, 7 Jan 2021 23:45:24 +0000 (00:45 +0100)]
bluetooth: Unify BlueZ macro defines shared between util and native

Define all BLUEZ_ macros once in the shared header, instead of twice in
both backend-native.c and bluez5-util.h.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/477>

3 years agobluetooth: improve indentation around dbus_message_iter_open_container
Marijn Suijten [Thu, 7 Jan 2021 23:48:55 +0000 (00:48 +0100)]
bluetooth: improve indentation around dbus_message_iter_open_container

Consistently use newlines and the same indentation style for all calls
to dbus_message_iter_open_container in Bluetooth code.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/477>

3 years agonull-source: Change max_rewind when the latency changes
Georg Chini [Sun, 31 Jan 2021 19:13:16 +0000 (20:13 +0100)]
null-source: Change max_rewind when the latency changes

The null-source did not change max_rewind when changing the latency. This
patch fixes the issue.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/493>

3 years agosink: Unlink monitor source before unlinking sink
Georg Chini [Sun, 31 Jan 2021 19:08:11 +0000 (20:08 +0100)]
sink: Unlink monitor source before unlinking sink

Unlinking the monitor source after unlinking the sink leads to a crash when the monitor
source is master of a virtual source. Changing the unlink order fixes the problem.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/493>

3 years agoalsa: fix the plug: PCM device name creation
Jaroslav Kysela [Thu, 28 Jan 2021 07:48:03 +0000 (08:48 +0100)]
alsa: fix the plug: PCM device name creation

The plug: ALSA PCM device name can pass any device name
even with argument, but the syntax is:

plug:SLAVE='<pcm_device_name>'

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/75#issuecomment-768555182
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/492>

3 years agobluetooth: pass output_rate_refresh_interval_ms module parameter
Igor V. Kovalenko [Tue, 26 Jan 2021 06:10:02 +0000 (09:10 +0300)]
bluetooth: pass output_rate_refresh_interval_ms module parameter

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/488>

3 years agobluetooth: ldac: Use format as FLOAT32LE
Sanchayan Maity [Fri, 22 Jan 2021 10:56:52 +0000 (16:26 +0530)]
bluetooth: ldac: Use format as FLOAT32LE

LDAC encoder already supports S16, S24, S32 and F32LE. Using FLOAT32LE
for the sample format would avoid the additional call for conversion to
pa_sconv_s32le_from_float32ne. perf tool shows this as being the function
called frequently after encode. So, just avoid this by using sample format
as F32LE.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/486>

3 years agobluetooth/gst: Move common enc/dec initialization back to generic init
Marijn Suijten [Fri, 22 Jan 2021 09:55:02 +0000 (10:55 +0100)]
bluetooth/gst: Move common enc/dec initialization back to generic init

Now that codec-specific code only touches its own bin and not any
elements (appsink/src) outside of it, make things official by
initializng them later in gst_codec_init where they are actually needed.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>

3 years agobluetooth/aptx: Use capsfilter instead of appsink/appsrc "caps" prop
Marijn Suijten [Thu, 21 Jan 2021 23:01:20 +0000 (00:01 +0100)]
bluetooth/aptx: Use capsfilter instead of appsink/appsrc "caps" prop

Make the codec-specific initializer more generic by not touching any
elements outside of its own GstBin.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>

3 years agobluetooth/aptx: Deduplicate caps setup for encoding and decoding
Marijn Suijten [Thu, 21 Jan 2021 22:59:57 +0000 (23:59 +0100)]
bluetooth/aptx: Deduplicate caps setup for encoding and decoding

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>

3 years agobluetooth/gst: Determine PA input/output caps in generic code
Marijn Suijten [Thu, 21 Jan 2021 08:43:16 +0000 (09:43 +0100)]
bluetooth/gst: Determine PA input/output caps in generic code

Make the code ever so slightly more generic by not using appsrc and
appsink in codec-specific logic when assigning caps specific to the raw
(PCM) format provided by or returned to PA.

Note that caps have to be set (= event) after starting, can't send
events in flushing state.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>

3 years agobluetooth/gst: Add assertions around element_add_pad and bin_add
Marijn Suijten [Thu, 21 Jan 2021 11:04:23 +0000 (12:04 +0100)]
bluetooth/gst: Add assertions around element_add_pad and bin_add

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>

3 years agoi18n: Update .pot and .po files
Tanu Kaskinen [Fri, 22 Jan 2021 07:12:32 +0000 (09:12 +0200)]
i18n: Update .pot and .po files

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/485>

3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Mon, 18 Jan 2021 13:35:59 +0000 (13:35 +0000)]
Translated using Weblate (Finnish)

Currently translated at 95.1% (472 of 496 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fi/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/485>

3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Mon, 11 Jan 2021 16:29:44 +0000 (16:29 +0000)]
Translated using Weblate (Finnish)

Currently translated at 94.9% (471 of 496 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fi/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/485>

3 years agobluetooth: allow increasing SBC output bitrate
Igor V. Kovalenko [Wed, 13 Jan 2021 16:19:52 +0000 (19:19 +0300)]
bluetooth: allow increasing SBC output bitrate

SBC codec decrements bitpool value by fixed amount each time it is asked to
reduce output bitrate. This results in reduced audio quality with SBC codec.

Implement increase_encoder_bitrate for SBC codec by adding 1 to bitpool value
each time encoder bitrate needs to be increased to restore SBC audio quality.
While at it, remove bitpool decrement limit to use connection agreed value
instead as we will be able to restore quality later.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/474>

3 years agobluetooth: allow increasing output bitrate
Igor V. Kovalenko [Wed, 20 Jan 2021 09:51:14 +0000 (12:51 +0300)]
bluetooth: allow increasing output bitrate

Bluetooth thread may ask encoder to reduce bitrate if writing is not keeping up
with inputs or writing to bluetooth socket takes too much time.

Assuming conditions leading to reduced bitrate are intermittent, allow periodic
attempts to increase encoder bitrate, by default at most twice per second.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/481>

3 years agobluetooth: Add missing can_be_supported check to is_codec_available
Marijn Suijten [Tue, 19 Jan 2021 23:07:48 +0000 (00:07 +0100)]
bluetooth: Add missing can_be_supported check to is_codec_available

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/479>

3 years agobluetooth: Check support for encoding and decoding separately
Marijn Suijten [Tue, 19 Jan 2021 22:20:07 +0000 (23:20 +0100)]
bluetooth: Check support for encoding and decoding separately

As suggested in [1]:

This way it is possible for a codec to have both the encoding and
decoding part optional, instead of getting both or nothing (where PA
theoretically supports both).

In addition this cleans up code that was previously checking the
existence of a function pointer, or nothing at all (switch_codec).

[1]: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440#note_768146

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/479>

3 years agobluetooth: Fix unregistering of the message handler
Sanchayan Maity [Thu, 21 Jan 2021 13:11:25 +0000 (18:41 +0530)]
bluetooth: Fix unregistering of the message handler

In cases, where codec initialisation may fail, we still try
unregistering the message handler. Do not try unregistering
the handler if it was not registered in the first place.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/483>

3 years agogitignore: Add install/ for local prefixed installs
Arun Raghavan [Tue, 20 Oct 2020 20:22:46 +0000 (16:22 -0400)]
gitignore: Add install/ for local prefixed installs

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/475>

3 years agobluetooth/bluez5-util: Do not reply to ClearConfiguration
Marijn Suijten [Wed, 13 Jan 2021 13:23:54 +0000 (14:23 +0100)]
bluetooth/bluez5-util: Do not reply to ClearConfiguration

Similar to the situation/comment in `endpoint_release` BlueZ does not
request any reply to `ClearConfiguration()` either; sending one results
in the same "0 matched rules" warning from dbus-daemon:

    dbus-daemon[1309]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.71" (uid=1000 pid=87548 comm="../build/src/daemon/pulseaudio -vvvv -n -F ../buil") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.3" (uid=0 pid=1308 comm="/usr/lib/bluetooth/bluetoothd -d ")

Solve this by only creating a return message when an (othwise empty)
reply is solicited for, just like in `endpoint_release`.

Unfortunately we also have to make sure to not send any error back if no
reply is requested, but fortunately an argument parsing error here is
extremely unlikely.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/472>

3 years agobluetooth: Move codec specific bits to their own respective files
Sanchayan Maity [Tue, 5 Jan 2021 10:27:06 +0000 (15:57 +0530)]
bluetooth: Move codec specific bits to their own respective files

We move the codec specific bits to their own respective files and now
make the codec specific initialisation use a GstBin, which the generic
GStreamer module now uses in the pipeline.

It is job of the codec specific function to add elements in the GstBin
and link the added elements in the bin. It should also set up the ghost
pads as a GstBin has no pads of it's own and without which the bin
cannot be linked to the appsrc/appsink.

Also, we now only initialise either the encoding or the decoding
pipeline and not both. The codec init API already gets passed the
for_encoding flag. We pass and use the same to codec specific init
functions.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Register an endpoint according to encode or decode support
Sanchayan Maity [Thu, 7 Jan 2021 12:22:22 +0000 (17:52 +0530)]
bluetooth: Register an endpoint according to encode or decode support

As we now support codecs other than SBC, we might have codec which does
not have an encode or a decode capability. Specifically, in the case of
LDAC there isn't a known decoder implementation available. For such a
case, we should not register the corresponding endpoint.

In case of LDAC, as decoding cannot be supported, we should not register
a sink endpoint or vice versa in the other scenario.

To do this, we check if encode_buffer or decode_buffer entry for a codec
has been set in pa_a2dp_codec and accordingly prevent or allow it's
registration.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Make GStreamer threads realtime
Igor V. Kovalenko [Mon, 4 Jan 2021 16:40:08 +0000 (19:40 +0300)]
bluetooth: Make GStreamer threads realtime

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Prevent registration of an unavailable codec at runtime
Sanchayan Maity [Fri, 1 Jan 2021 14:08:48 +0000 (19:38 +0530)]
bluetooth: Prevent registration of an unavailable codec at runtime

When it comes to codecs provided via GStreamer, we register all codecs
if GStreamer option is enabled for bluez5 via meson. However, the
GStreamer plugin required for the codec might not be present on the
system. This results in the codec being available for registration with
the bluez stack or selection by the user, but, trying to use the said
codec then fails.

To prevent the above, we now use the can_be_supported codec API to check
if the codec is usable and if not, we do not register the said codec and
also prevent users from switching to it.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Introduce a can_be_supported API for A2DP codecs
Sanchayan Maity [Fri, 1 Jan 2021 14:02:37 +0000 (19:32 +0530)]
bluetooth: Introduce a can_be_supported API for A2DP codecs

This API internally checks if a requested codec can be supported on the
system. This is especially required for codecs supported via GStreamer
where the availability of a plugin decides if the said codec can be
supported.

This will be used to prevent registration of a codec which the remote
endpoint device might be able to support, but, PulseAudio can't as the
codec is not available on the system due to the absence of a plugin.
We can also prevent listing or switching to an unavailable codec.

Note that the codec negotiation happens with the bluez stack even before
a device is connected. Because of this, we need to make sure that gst_init
is called before checking for the availability of a plugin. Since
module-bluez5-device gets loaded only after a connection to the device
has been established, doing the gst_init in that or one of the bluetooth
modules is not feasible.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add support for getting current active codec
Sanchayan Maity [Fri, 1 Jan 2021 06:18:11 +0000 (11:48 +0530)]
bluetooth: Add support for getting current active codec

For example, using the following on the command line will return the
current codec for a bluetooth device

pacmd send-message /card/bluez_card.4C_BC_98_80_01_9B/bluez get-codec

where 4C_BC_98_80_01_9B is the bluetooth device.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add currently active codec name to card/sink/source proplist
Sanchayan Maity [Thu, 31 Dec 2020 08:29:40 +0000 (13:59 +0530)]
bluetooth: Add currently active codec name to card/sink/source proplist

This exposes the currently active codec on the source or sink via the
proplist and can be seen in output of pacmd list-sinks/list-sources.
Also set it on the card. In case of a bi-directional codec, the codec
for the sink and source could be different. For example, for aptX-LL,
the codec name on card, sink and source would be aptx-ll, aptx and sbc
respectively.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add support for getting list of negotiated codecs
Sanchayan Maity [Wed, 23 Dec 2020 18:03:48 +0000 (21:03 +0300)]
bluetooth: Add support for getting list of negotiated codecs

For example, using the following on the command line will return the
list of possible codecs for a bluetooth device

pacmd send-message /card/bluez_card.4C_BC_98_80_01_9B/bluez list-codecs

where 4C_BC_98_80_01_9B is the bluetooth device.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add aptX support via GStreamer
Sanchayan Maity [Mon, 21 Dec 2020 07:07:31 +0000 (12:37 +0530)]
bluetooth: Add aptX support via GStreamer

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add LDAC support via GStreamer
Sanchayan Maity [Mon, 21 Dec 2020 06:58:23 +0000 (12:28 +0530)]
bluetooth: Add LDAC support via GStreamer

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Add a generic GStreamer codec module
Sanchayan Maity [Tue, 27 Oct 2020 11:28:21 +0000 (16:58 +0530)]
bluetooth: Add a generic GStreamer codec module

This adds a generic gstreamer codec module based on which other
bluetooth codecs viz. aptX, aptX-HD, LDAC and AAC can be supported.

The GStreamer codec plugins used here themselves depend on the native
codec implementation.

aptX/aptX-HD -> libopenaptx
LDAC         -> libldac
AAC          -> Fraunhofer FDK AAC

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: Support A2DP codec switching via messaging API
Sanchayan Maity [Fri, 18 Dec 2020 11:35:44 +0000 (17:05 +0530)]
bluetooth: Support A2DP codec switching via messaging API

This uses the messaging API to initiate a codec switch.

While a particular codec might be applicable only for a particular
profile, for eg. aptX can only be applicable for A2DP sink or source
and not for let's say HSP, the codec switching logic has not been
tied to the logic for switching profiles.

Codec can be switched by running the following on the command line.

pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec{"ldac_hq"}
pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec {"ldac_mq"}
pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec {"ldac_sq"}
pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec {"aptx_hd"}
pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec {"aptx"}
pacmd send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec {"sbc"}

Codec name passed above is matched against pa_a2dp_codec->name. Note that
the match is case sensitive. XX_XX_XX_XX_XX_XX needs to be substituted with
the actual bluetooth device id.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluez5-util: Add support for using RegisterApplication D-Bus API
Sanchayan Maity [Tue, 15 Dec 2020 11:21:11 +0000 (16:51 +0530)]
bluez5-util: Add support for using RegisterApplication D-Bus API

A2DP codec switching needs new version of bluez as older version does not
provide needed org.freedesktop.DBus.ObjectManager and RegisterApplication
DBus APIs. As a preparation for the next step of adding codecs and then
codec switching, add support for using the new API.

Getting list of supported codecs by remote device is supported only by new
version of bluez daemon. If the RegisterApplication API fails, we
fallback to the older RegisterEndpoint API and only register the SBC
codec.

For more information, see
https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/media-api.txt

This changeset has been taken from Pali Rohár's A2DP codec patch
series but separated out to only include the D-Bus specific changes.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agobluetooth: a2dp-codec-util: Use lower index for higher priority
Sanchayan Maity [Tue, 15 Dec 2020 11:14:24 +0000 (16:44 +0530)]
bluetooth: a2dp-codec-util: Use lower index for higher priority

Instead of letting a codec with higher index have higher priority,
just use a lower index for high priority. This allows the for loop
iterating over the codecs to be written in a straightforward manner
and not have to iterate from the end. FWIW Pipewire does the same.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>

3 years agomap-file: regenerate
Igor V. Kovalenko [Mon, 18 Jan 2021 16:32:52 +0000 (19:32 +0300)]
map-file: regenerate

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/461>

3 years agobuildsys: meson: implement update-map-file target
Igor V. Kovalenko [Sat, 9 Jan 2021 14:57:23 +0000 (17:57 +0300)]
buildsys: meson: implement update-map-file target

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/461>

3 years agobuildsys: autotools: move map-file to src/pulse
Igor V. Kovalenko [Mon, 18 Jan 2021 15:38:19 +0000 (18:38 +0300)]
buildsys: autotools: move map-file to src/pulse

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/461>

3 years agoswitch-on-port-available: checking the off profile when switching profile
Hui Wang [Thu, 20 Aug 2020 08:21:08 +0000 (16:21 +0800)]
switch-on-port-available: checking the off profile when switching profile

If the current active profile is off, it has no sinks and sources, and
if users plug a headset to the audio port, the profile including this
audio port becomes available and should be selected as active profile.

But with the current design, the profile_good_for_output() will return
false because the sources in off profile and target profile doesn't
match.

For example:
(Before users plug headset)
Profiles:
         HiFi (Speaker): Default (sinks: 1, sources: 1, priority: 8100, available: no)
         HiFi (Headphones): Default (sinks: 1, sources: 1, priority: 8200, available: no)
         off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: off

(After users plug headset)
Profiles:
         HiFi (Speaker): Default (sinks: 1, sources: 1, priority: 8100, available: yes)
         HiFi (Headphones): Default (sinks: 1, sources: 1, priority: 8200, available: yes)
         off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: off

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/354>

3 years agobuild-sys: meson: only warn about lack of udev on Linux
Greg V [Wed, 6 Jan 2021 11:43:14 +0000 (14:43 +0300)]
build-sys: meson: only warn about lack of udev on Linux

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoatomic-test: unbreak on FreeBSD (cpuset_t)
Greg V [Sun, 29 Nov 2020 18:31:27 +0000 (21:31 +0300)]
atomic-test: unbreak on FreeBSD (cpuset_t)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agomodule-devd-detect: new module for soundcard hotplug on FreeBSD
Greg V [Fri, 3 Apr 2020 12:37:24 +0000 (15:37 +0300)]
module-devd-detect: new module for soundcard hotplug on FreeBSD

Used in addition to module-detect, since devd only provides hotplug events.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agooss: parse device names correctly on FreeBSD
Greg V [Fri, 3 Apr 2020 11:23:34 +0000 (14:23 +0300)]
oss: parse device names correctly on FreeBSD

This fixes devices being named just "/dev/dspN" instead of actual
soundcard names.

Also synchronizes some things like the unsigned type with the
detect module.

Loosely based on patch by lightside <lightside@gmx.com>.

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245156

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agooss: support hot-unplug on FreeBSD
Greg V [Thu, 2 Apr 2020 16:18:29 +0000 (19:18 +0300)]
oss: support hot-unplug on FreeBSD

Patch by Hans Petter Selasky <hselasky@FreeBSD.org>

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194727#c27

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agooss: support 24-bit sample formats
Greg V [Thu, 2 Apr 2020 16:15:29 +0000 (19:15 +0300)]
oss: support 24-bit sample formats

This works perfectly fine and is required for bitperfect mode on
some soundcards, according to Romain Tartière <romain@FreeBSD.org>

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198567#c6

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agooss: do not fall back to write() mode on FreeBSD
Greg V [Thu, 2 Apr 2020 16:13:58 +0000 (19:13 +0300)]
oss: do not fall back to write() mode on FreeBSD

This has been patched out in FreeBSD Ports for ages.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agodetect: fix/improve FreeBSD support
Greg V [Thu, 2 Apr 2020 15:56:53 +0000 (18:56 +0300)]
detect: fix/improve FreeBSD support

Apply patch from FreeBSD Ports.
Thanks to: Koop Mast <kwm@FreeBSD.org>, lightside <lightside@gmx.com>

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoutil: implement pa_get_binary_name on FreeBSD without procfs requirement
Greg V [Thu, 2 Apr 2020 15:49:58 +0000 (18:49 +0300)]
util: implement pa_get_binary_name on FreeBSD without procfs requirement

procfs is not mounted by default, sysctl offers a bulletproof way
of requesting this information.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agopulsecore: remove ancient __FreeBSD_version < 600000 code
Greg V [Thu, 2 Apr 2020 15:42:59 +0000 (18:42 +0300)]
pulsecore: remove ancient __FreeBSD_version < 600000 code

None of this is relevant in the modern age

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoiochannel: support credentials passing on FreeBSD
Greg V [Fri, 3 Apr 2020 16:52:04 +0000 (19:52 +0300)]
iochannel: support credentials passing on FreeBSD

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: support memfd without SYS_memfd_create (FreeBSD 13)
Greg V [Fri, 3 Apr 2020 16:05:22 +0000 (19:05 +0300)]
build-sys: meson: support memfd without SYS_memfd_create (FreeBSD 13)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: add execinfo dependency for FreeBSD
Greg V [Thu, 2 Apr 2020 14:34:32 +0000 (17:34 +0300)]
build-sys: meson: add execinfo dependency for FreeBSD

For 'backtrace' and related symbols

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoraop: add missing netinet include on FreeBSD
Greg V [Thu, 2 Apr 2020 14:33:17 +0000 (17:33 +0300)]
raop: add missing netinet include on FreeBSD

For 'struct sockaddr_in'

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agopadsp: fix build on FreeBSD (use same ioctl signature as glibc)
Greg V [Thu, 2 Apr 2020 14:32:37 +0000 (17:32 +0300)]
padsp: fix build on FreeBSD (use same ioctl signature as glibc)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: add missing pthread dependency on alsa tests
Greg V [Thu, 2 Apr 2020 14:31:41 +0000 (17:31 +0300)]
build-sys: meson: add missing pthread dependency on alsa tests

For symbol 'pthread_setschedparam'

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: check for shm_open even if it's in libc (FreeBSD), not librt
Greg V [Thu, 2 Apr 2020 14:18:22 +0000 (17:18 +0300)]
build-sys: meson: check for shm_open even if it's in libc (FreeBSD), not librt

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: when libc iconv is used, tell libiconv header to pretend to be...
Greg V [Fri, 3 Apr 2020 15:51:59 +0000 (18:51 +0300)]
build-sys: meson: when libc iconv is used, tell libiconv header to pretend to be libc's iconv

The libiconv header on FreeBSD would be preferred by include path, but
we don't want to link to libiconv, so tell its header to act like
the system header.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: set HAVE_DLADDR even if it's in libc (FreeBSD), not libdl
Greg V [Thu, 2 Apr 2020 14:11:20 +0000 (17:11 +0300)]
build-sys: meson: set HAVE_DLADDR even if it's in libc (FreeBSD), not libdl

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoalsa-mixer: Accept negative max_dB when using decibel fixes
Tanu Kaskinen [Mon, 18 Jan 2021 15:36:20 +0000 (17:36 +0200)]
alsa-mixer: Accept negative max_dB when using decibel fixes

Sometimes decibel fixes are used as a trick to set a maximum hardware
volume, and in these cases max_dB may be negative yet still valid.
Here's an example:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/292#note_671300

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447>

3 years agoalsa-mixer: disable has_dB if max_dB is negative
Benjamin Valentin [Mon, 28 Dec 2020 18:45:08 +0000 (19:45 +0100)]
alsa-mixer: disable has_dB if max_dB is negative

Volume scaling in dB mode is broken if max dB is negative.

I have a Nobsound USB amplifier (1908:2220) that reports a dB range
of -127.07 dB to -128 dB in Alsa.
While this is likely a driver/device bug, in my naive imagination
userspace wouldn't bother too much with the absolute values and just set

out_dB(percent) = min_dB + (max_dB - min_dB) * percent

However, this is not what PulseAudio is doing, instead max_dB is used
as base_volume with which the desired software volume is multiplied
while min_dB does not seem to be taken into account.

The result is that with this device only a tiny portion of the volume
slider is usable.
Setting it to 97% already reaches min_dB which effectively turns any
(software) audio knob to an on/off switch.

To work around this, simply set the has_dB flag to false if max_dB is
negative.
This falls back to using raw Alsa values (ranging from 0 - 255), now
the settings in pavucontrol perfectly mirror those in alsamixer.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447>

3 years agodaemon: Rely on systemd unit file for X11 plugin initialization
Carlos Garnacho [Wed, 4 Nov 2020 10:16:27 +0000 (11:16 +0100)]
daemon: Rely on systemd unit file for X11 plugin initialization

For GNOME X11 sessions, avoid relying on xdg autostart desktop files
to initialize the X11 plugins. This is now handled via a systemd unit
file.

The xdg autostart is still installed, but has been made to instruct
GNOME to skip it with X-GNOME-HiddenUnderSystemd. This is still the
primary way to initialize X11 plugins for other DEs.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agodaemon: Install start-pulseadio-x11 as a Xwayland-session.d script
Carlos Garnacho [Wed, 4 Nov 2020 10:11:57 +0000 (11:11 +0100)]
daemon: Install start-pulseadio-x11 as a Xwayland-session.d script

The scripts in this directory are loaded (in GNOME sessions thus far)
at the time of starting Xwayland for X11 clients (may happen on session
start, or on demand whenever X11 clients are started).

This will ensure the relevant X11 modules are loaded as long as there's
a Xwayland instance, thus X11 clients that might make use of them.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agodaemon: Add "stop" argument to start-pulseaudio-x11 script
Carlos Garnacho [Wed, 4 Nov 2020 10:10:01 +0000 (11:10 +0100)]
daemon: Add "stop" argument to start-pulseaudio-x11 script

As contradicting as it sounds, seems better than changing the script
name. This "stop" argument makes it unload all X11 related modules,
as opposed to the default behavior.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agoalsa-mixer: add support for SteelSeries Arctis 9
Igor V. Kovalenko [Mon, 11 Jan 2021 18:50:00 +0000 (21:50 +0300)]
alsa-mixer: add support for SteelSeries Arctis 9

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/462>

3 years agoi18n: Remove src/pulsecore/dllmain.c from POTFILES.in
Piotr Drąg [Sat, 16 Jan 2021 12:11:03 +0000 (13:11 +0100)]
i18n: Remove src/pulsecore/dllmain.c from POTFILES.in

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/469>

3 years agoalsa-card: add dynamic priority bonus base for alsa profiles
Hui Wang [Fri, 21 Aug 2020 09:34:25 +0000 (17:34 +0800)]
alsa-card: add dynamic priority bonus base for alsa profiles

After applying the commit 0d50e787 ("alsa-card: improve the profile
availability logic"), we met an new issue. when system selects the
initial profile, the profile off is selected instead of a profile with
a valid output device on it. That is the issue we met:

Profiles:
  HiFi: Default (sinks: 2, sources: 2, priority: 8000, available: no)
  off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: off
Ports:
  [Out] Headphones: Headphones (priority: 300, latency offset: 0 usec, not available)
   Part of profile(s): HiFi
  [Out] Speaker: Speaker (priority: 100, latency offset: 0 usec)
   Part of profile(s): HiFi
...

I know the commit 0d50e787 really fixed something, but we still need
to fix the new issue, to do so, this patch introduces a priority bonus
for alsa profiles and separate the alsa profiles to 3 groups:
group a (will be granted priority bonus dynamically):
a profile has only output ports and at least one port is not unavailable
a profile has only input ports and at least one port is not unavailable
a profile has both input and output ports, and at least one output and
one input ports are not unavailable

group b (will be marked unavailable)
a profile has only output ports and all ports are unavailable
a profile has only input ports and all ports are unavailable
a profile has both output and input ports, and all ports are unavailable

group c
the rest profiles, their priority and availability is not changed.

With this change, the profile HiFi will become avaialbe:yes, and will
not be granted priority bonus if no input port is plugged.

The priority bonus provides a higher priority base to profiles, this
guarantees this patch doesn't break the fix of 0d50e787.

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/927

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/355>

3 years agoUpdate NEWS
Tanu Kaskinen [Sat, 16 Jan 2021 17:31:30 +0000 (19:31 +0200)]
Update NEWS

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>

3 years agoUpdate NEWS
Arun Raghavan [Wed, 13 Jan 2021 02:43:40 +0000 (21:43 -0500)]
Update NEWS

Add notes for 14.1.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>

3 years agoswitch-on-port-available: Pass correct port_pointers to switch_to_port()
Tanu Kaskinen [Fri, 15 Jan 2021 16:16:59 +0000 (18:16 +0200)]
switch-on-port-available: Pass correct port_pointers to switch_to_port()

The pp variable contains information for the port that became
unavailable, but switch_to_port() needs the information for the port
that we're switching to.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1096
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/468>

3 years agowin32: Fix privlibdir for running on Windows
Patrick Gaskin [Sun, 3 Jan 2021 09:07:11 +0000 (04:07 -0500)]
win32: Fix privlibdir for running on Windows

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix format specifiers for DWORD values
Patrick Gaskin [Sun, 3 Jan 2021 09:07:09 +0000 (04:07 -0500)]
win32: Fix format specifiers for DWORD values

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds
Patrick Gaskin [Sun, 3 Jan 2021 09:07:07 +0000 (04:07 -0500)]
win32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h
Patrick Gaskin [Sun, 3 Jan 2021 09:07:05 +0000 (04:07 -0500)]
win32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h

When _WIN32_WINNT >= 0x6000 (Vista), ws2tcpip.h provides inet_ntop and
inet_pton, and winsock2.h provides the equivalent of poll.h.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix WSAStartup issues
Patrick Gaskin [Sun, 3 Jan 2021 09:01:40 +0000 (04:01 -0500)]
win32: Fix WSAStartup issues

WSAStartup was not being called for pacat and pactl built with meson,
causing them to fail in pa_mainloop_new with "cannot create wakeup
pipe". This issue also affects other applications linking to libpulse
other than the pulseaudio daemon, which calls WSAStartup itself.

When built with autotools, WSAStartup would have been called in
DllMain, which is recommended against by the documentation [1].

To fix these issues, the WSAStartup/WSACleanup calls can be moved
into pa_mainloop_new/pa_mainloop_free.

[1] https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/456>

3 years agoclient: Make auto_connect_localhost respect HAVE_IPv6 and OS_IS_WIN32
Patrick Gaskin [Sun, 3 Jan 2021 08:41:36 +0000 (03:41 -0500)]
client: Make auto_connect_localhost respect HAVE_IPv6 and OS_IS_WIN32

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/455>

3 years agowaveout: Fix compile warnings
Patrick Gaskin [Sun, 3 Jan 2021 09:04:52 +0000 (04:04 -0500)]
waveout: Fix compile warnings

* Include pulse/util.h for pa_thread_make_realtime.
* Explicitly cast HWAVEOUT to UINT_PTR for waveOutGetDevCaps.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/457>

3 years agoUpdate NEWS
Arun Raghavan [Wed, 13 Jan 2021 02:36:01 +0000 (21:36 -0500)]
Update NEWS

Missed this in the 14.0 release.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/465>

3 years agoi18n: Update pulseaudio.pot
Tanu Kaskinen [Mon, 11 Jan 2021 19:25:08 +0000 (21:25 +0200)]
i18n: Update pulseaudio.pot

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (German)
Tobias Weise [Fri, 8 Jan 2021 10:47:09 +0000 (10:47 +0000)]
Translated using Weblate (German)

Currently translated at 100.0% (526 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/de/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Sun, 3 Jan 2021 18:04:52 +0000 (18:04 +0000)]
Translated using Weblate (Finnish)

Currently translated at 94.9% (471 of 496 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fi/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (French)
Julien Humbert [Sat, 12 Dec 2020 07:00:58 +0000 (07:00 +0000)]
Translated using Weblate (French)

Currently translated at 100.0% (517 of 517 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fr/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (German)
Fabian Affolter [Sat, 12 Dec 2020 16:44:16 +0000 (16:44 +0000)]
Translated using Weblate (German)

Currently translated at 100.0% (526 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/de/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agocli: Fix crash when using .include with an empty directory
Patrick Gaskin [Sun, 3 Jan 2021 08:29:35 +0000 (03:29 -0500)]
cli: Fix crash when using .include with an empty directory

This would previously fail the size > 0 assertion in pa_xmalloc.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/454>

3 years agodatabase: clean up remaining references to CANONICAL_HOST
Igor V. Kovalenko [Mon, 21 Dec 2020 16:55:00 +0000 (19:55 +0300)]
database: clean up remaining references to CANONICAL_HOST

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: pick old database file from any arch
Igor V. Kovalenko [Mon, 21 Dec 2020 16:27:53 +0000 (19:27 +0300)]
database: pick old database file from any arch

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: drop arch from newly created database file name
Igor V. Kovalenko [Sun, 20 Dec 2020 18:36:21 +0000 (21:36 +0300)]
database: drop arch from newly created database file name

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: use existing database matching same architecture prefix
Igor V. Kovalenko [Sun, 29 Nov 2020 12:16:26 +0000 (15:16 +0300)]
database: use existing database matching same architecture prefix

State database binary file format may depend on system architecture,
for instance gdbm binary format depends on architecture word size,
making x86 and x64 gdbm files incompatible.

If this is the case, it is handled by adding system architecture name to
database file name using automatically configured CANONICAL_HOST string.
Meson build define CANONICAL_HOST to be system architecture name, while
autotools build extends this with vendor and and operating system components.

Switch autotools build to use host_cpu for CANONICAL_HOST to match Meson
configuration. For backwards compatibility always use existing database file
matching CANONICAL_HOST prefix if it exists.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: extract common method to handle machine id and architecture
Igor V. Kovalenko [Sun, 29 Nov 2020 08:21:29 +0000 (11:21 +0300)]
database: extract common method to handle machine id and architecture

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agoloopback: Fix sink latency calculation if source is alsa source with fixed latency
Georg Chini [Mon, 4 Jan 2021 20:08:05 +0000 (21:08 +0100)]
loopback: Fix sink latency calculation if source is alsa source with fixed latency

When an alsa source with fixed latency is used, the actual latency of the source
will only be one fragment size. This is not taken into account when the required
sink latency is calculated.

This patch fixes the issue.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/451>

3 years agodaemon: fix default daemon.conf when running from build tree
Igor V. Kovalenko [Sun, 27 Dec 2020 09:40:18 +0000 (12:40 +0300)]
daemon: fix default daemon.conf when running from build tree

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/446>

3 years agox11: gracefully handle ICE connection error
Igor V. Kovalenko [Wed, 23 Dec 2020 07:31:18 +0000 (10:31 +0300)]
x11: gracefully handle ICE connection error

Implementation is largely inspired by GNOME/mutter ICE session handling.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>

3 years agox11: gracefully handle X11 connection error
Igor V. Kovalenko [Tue, 22 Dec 2020 17:54:40 +0000 (20:54 +0300)]
x11: gracefully handle X11 connection error

Perform X11 connection recovery via XSetIOErrorExitHandler mechanism.

Implementation is largely inspired by this change to GNOME/mutter
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>

3 years agodoc: Add some contributor guidelines
Arun Raghavan [Fri, 25 Dec 2020 16:10:30 +0000 (11:10 -0500)]
doc: Add some contributor guidelines

Document some things that should be helpful to at least new
contributors. Since we don't have a way to show this when people are
creating MRs, also copy over the next to a merge request template so
that creates a dropdown that folks might look at when creating an MR.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/444>

3 years agoladspa-sink: do not call pa_sink_suspend if PA_SINK_IS_LINKED is false
Igor V. Kovalenko [Sun, 27 Dec 2020 12:25:40 +0000 (15:25 +0300)]
ladspa-sink: do not call pa_sink_suspend if PA_SINK_IS_LINKED is false

While module-ladspa-sink is still being loaded and before pa_sink_put() is
called there may be an attempt to reconfigure master sink when avoid-resampling
is true. This breaks attempting to suspend ladspa-sink which is still in INIT
state.

Fix this by skipping pa_sink_suspend if PA_SINK_IS_LINKED is false.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/445>

3 years agomessage-params: Fix array reading functions
Georg Chini [Fri, 1 Jan 2021 20:35:41 +0000 (21:35 +0100)]
message-params: Fix array reading functions

The array read functions need the state pointer as an additional argument because the
array may be in the middle of a parameter list and the state pointer must be advanced
to the element after the array.

Additionally fixes some compiler warnings.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/450>

3 years agoalsa-mixer: Add support for the Headphone,1 element
Tanu Kaskinen [Sat, 26 Dec 2020 20:29:06 +0000 (22:29 +0200)]
alsa-mixer: Add support for the Headphone,1 element

This is seen at least on HP EliteDesk 800 DM and HP EliteDesk 800 SFF.

This is used by the analog-output-headphones-2 path, but all other paths
on the same sink need to handle the element too. The existing
configuration is inconsistent between files regarding whether headphone
outputs should be muted or not when not using them. I chose to be
consistent within files, which means that Headphone,1 handling is
inconsistent between files in the same way that the existing Headphone
and Headphone2 handling is. (My opinion is that unused paths should be
always muted, but I didn't want to do that policy change in this patch.)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>