platform/upstream/pulseaudio.git
6 years agostream: pa_stream_[writable|readable]_size: constify
Lyndon Brown [Sun, 27 May 2018 04:57:52 +0000 (05:57 +0100)]
stream: pa_stream_[writable|readable]_size: constify

6 years agostream: pa_stream_is_[suspended|corked]: constify
Lyndon Brown [Sun, 27 May 2018 04:54:02 +0000 (05:54 +0100)]
stream: pa_stream_is_[suspended|corked]: constify

6 years agostream: pa_stream_get_device_[index|name]: constify
Lyndon Brown [Sun, 27 May 2018 04:51:30 +0000 (05:51 +0100)]
stream: pa_stream_get_device_[index|name]: constify

6 years agostream: pa_stream_get_index: constify
Lyndon Brown [Sun, 27 May 2018 04:49:23 +0000 (05:49 +0100)]
stream: pa_stream_get_index: constify

6 years agostream: pa_stream_get_context: constify
Lyndon Brown [Sun, 27 May 2018 04:45:36 +0000 (05:45 +0100)]
stream: pa_stream_get_context: constify

6 years agostream: pa_stream_get_state: constify
Lyndon Brown [Sun, 27 May 2018 04:43:01 +0000 (05:43 +0100)]
stream: pa_stream_get_state: constify

6 years agooperation: pa_operation_get_state: constify
Lyndon Brown [Sun, 27 May 2018 05:14:29 +0000 (06:14 +0100)]
operation: pa_operation_get_state: constify

6 years agomainloop: constify get_retval functions
Lyndon Brown [Sun, 27 May 2018 05:39:11 +0000 (06:39 +0100)]
mainloop: constify get_retval functions

6 years agocontext: pa_context_get_state: constify
Lyndon Brown [Sun, 27 May 2018 05:24:17 +0000 (06:24 +0100)]
context: pa_context_get_state: constify

6 years agocontext: pa_context_get_protocol_version: constify
Lyndon Brown [Mon, 28 May 2018 00:12:39 +0000 (01:12 +0100)]
context: pa_context_get_protocol_version: constify

6 years agocontext: pa_context_new_with_proplist: constify proplist param
Lyndon Brown [Sat, 26 May 2018 22:50:55 +0000 (23:50 +0100)]
context: pa_context_new_with_proplist: constify proplist param

6 years agovolume: pa_cvolume_get_position: constify
Lyndon Brown [Sun, 27 May 2018 06:56:11 +0000 (07:56 +0100)]
volume: pa_cvolume_get_position: constify

6 years agoalsa-mixer: make the mono mapping a fallback only
Tanu Kaskinen [Fri, 1 Jun 2018 08:24:01 +0000 (11:24 +0300)]
alsa-mixer: make the mono mapping a fallback only

If a sound card doesn't have the "front" device defined for it, we have
to use the "hw" device for stereo. Not so long ago, the analog-stereo
mapping had "hw:%f" in its device-strings and everything worked great,
except that it caused trouble with the Intel HDMI LPE driver that uses
the first "hw" device for HDMI, and we were incorrectly detecting it as
an analog device. That problem was fixed in commit ea3ebd09, which
removed "hw:%f" from analog-stereo and added a new stereo fallback
mapping for "hw".

Now the problem is that if a sound card doesn't have the "front" device
defined for it, and it supports both mono and stereo, only the mono
mapping is used, because the stereo mapping is only a fallback. This
patch makes the mono mapping a fallback too, so the mono mapping is used
only if there's absolutely nothing else that works.

This can cause trouble at least in theory. Maybe someone actually wants
to use mono output on a card that supports both mono and stereo. But
that seems quite unlikely.

6 years agoscache: pa_context_play_sample_with_proplist: constify proplist param
Lyndon Brown [Sun, 27 May 2018 04:15:14 +0000 (05:15 +0100)]
scache: pa_context_play_sample_with_proplist: constify proplist param

If the given proplist is NULL, the function creates a new (empty)
proplist. That caused a compiler warning after the constification, which
is why the new proplist is now created using a separate variable.

6 years agoscache: pa_context_play_sample_with_proplist: clarify proplist param
Lyndon Brown [Sun, 27 May 2018 04:14:04 +0000 (05:14 +0100)]
scache: pa_context_play_sample_with_proplist: clarify proplist param

Existing documentation was unclear about which property list would be the
one changed (merged into), making it seem (along with the non-const
proplist pointer param, which needs changing seperately), that the proplist
object for which a pointer is given will be the one merged into, instead of
the internal cached entry's proplist.

6 years agoproplist: pa_proplist_equal: constify proplist pointers
Lyndon Brown [Sun, 27 May 2018 03:42:36 +0000 (04:42 +0100)]
proplist: pa_proplist_equal: constify proplist pointers

6 years agoproplist: pa_proplist_[size|isempty]: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 03:40:07 +0000 (04:40 +0100)]
proplist: pa_proplist_[size|isempty]: constify proplist pointer

6 years agoproplist: pa_proplist_contains: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 03:35:33 +0000 (04:35 +0100)]
proplist: pa_proplist_contains: constify proplist pointer

6 years agoproplist: pa_proplist_to_string[_sep]: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 03:31:49 +0000 (04:31 +0100)]
proplist: pa_proplist_to_string[_sep]: constify proplist pointer

6 years agocontext: pa_context_proplist_update: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 02:04:43 +0000 (03:04 +0100)]
context: pa_context_proplist_update: constify proplist pointer

6 years agotagstruct: pa_tagstruct_put_format_info: constify format pointer
Lyndon Brown [Sun, 27 May 2018 02:02:30 +0000 (03:02 +0100)]
tagstruct: pa_tagstruct_put_format_info: constify format pointer

6 years agotagstruct: pa_tagstruct_put_proplist: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 02:01:14 +0000 (03:01 +0100)]
tagstruct: pa_tagstruct_put_proplist: constify proplist pointer

6 years agoproplist: pa_proplist_gets: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 03:10:53 +0000 (04:10 +0100)]
proplist: pa_proplist_gets: constify proplist pointer

6 years agoproplist: pa_proplist_get: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 01:59:12 +0000 (02:59 +0100)]
proplist: pa_proplist_get: constify proplist pointer

6 years agoproplist: pa_proplist_iterate: constify proplist pointer
Lyndon Brown [Sun, 27 May 2018 01:45:47 +0000 (02:45 +0100)]
proplist: pa_proplist_iterate: constify proplist pointer

6 years agoproplist: add and use const version of MAKE_HASHMAP macro
Lyndon Brown [Sun, 27 May 2018 01:41:54 +0000 (02:41 +0100)]
proplist: add and use const version of MAKE_HASHMAP macro

6 years agohashmap: constify pointer of pa_hashmap_get
Lyndon Brown [Sun, 27 May 2018 01:57:12 +0000 (02:57 +0100)]
hashmap: constify pointer of pa_hashmap_get

relies upon the same having just been done for the private hash_scan
function

6 years agohashmap: constify pointer of private hash_scan function
Lyndon Brown [Sun, 27 May 2018 01:56:11 +0000 (02:56 +0100)]
hashmap: constify pointer of private hash_scan function

paves the way for doing the same for pa_hashmap_get and users of it

6 years agohashmap: constify hashmap ptr for various functions
Lyndon Brown [Sun, 27 May 2018 01:27:43 +0000 (02:27 +0100)]
hashmap: constify hashmap ptr for various functions

6 years agobuild-sys: Update meson.build based on recent changes
Arun Raghavan [Sun, 20 May 2018 02:38:42 +0000 (08:08 +0530)]
build-sys: Update meson.build based on recent changes

Bump the protocol version, and drop (commented out) references to BlueZ
4.

6 years agoudev-detect, alsa-card: Adopt avoid resampling option from daemon.conf
Sangchul Lee [Thu, 24 May 2018 16:29:53 +0000 (01:29 +0900)]
udev-detect, alsa-card: Adopt avoid resampling option from daemon.conf

Previously, the "avoid-resampling" option of daemon.conf is to make the
daemon try to use the stream sample rate if possible for all sinks or
sources.

This patch applies this option to module-udev-detect and module-alsa-card
as a module argument in order to override the default value of daemon.conf.

As a result, user can use this argument for more fine-grained control.
e.g.) set it false in daemon.conf and set it true for module-udev-detect
or a particular module-alsa-card in default.pa.(or vice versa)

To set it, use "avoid_resampling=true or false" as the module argument.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoalsa-mixer: More output modes for SB Omni Surround 5.1 and cleanup
Nazar Mokrynskyi [Tue, 8 May 2018 22:51:23 +0000 (01:51 +0300)]
alsa-mixer: More output modes for SB Omni Surround 5.1 and cleanup

There are only stereo and 5.1 output modes supported natively on this
sound card, but with this config more modes like 2.1, 4.0, 4.1 and 5.0
are now exposed. Also profiles list is cleaner now with all profiles
explicitly specified.

Last thing is removed support for microphone on Linux kernels older than
4.3-rc1, which shouldn't be an issue with future version of PulseAudio
likely be installed on newer kernels anyway.

Signed-off-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
6 years agomap-file: Fix typo while adding pa_thread_make_realtime
Arun Raghavan [Thu, 10 May 2018 09:01:36 +0000 (14:31 +0530)]
map-file: Fix typo while adding pa_thread_make_realtime

6 years agonull-sink,null-source: Use realtime scheduling if possible
Arun Raghavan [Fri, 4 May 2018 13:48:15 +0000 (19:18 +0530)]
null-sink,null-source: Use realtime scheduling if possible

We do this on other sink/source modules, and in general it makes sense
to do so here as well.

6 years agocore-format: fix TrueHD and DTS-HD channel maps
Tanu Kaskinen [Sat, 5 May 2018 13:01:06 +0000 (16:01 +0300)]
core-format: fix TrueHD and DTS-HD channel maps

Since these formats use 8 channels, the channel map needs to be
configured to 8 channels as well.

6 years agocore: Expose API to elevate a thread to realtime priority
Arun Raghavan [Sat, 21 Apr 2018 04:15:26 +0000 (09:45 +0530)]
core: Expose API to elevate a thread to realtime priority

This should make it easier for clients to elevate their audio threads to
real time priority without having to dig through much through specific
system internals.

6 years agoPROTOCOL: Bump to version 33
Arun Raghavan [Fri, 4 May 2018 17:16:53 +0000 (22:46 +0530)]
PROTOCOL: Bump to version 33

Required for the addition of new pa_encoding_t values.

6 years agoformat: Add support for Dolby TrueHD and DTS-HD HBR passthrough
Pierre-Louis Bossart [Tue, 15 Aug 2017 17:24:12 +0000 (12:24 -0500)]
format: Add support for Dolby TrueHD and DTS-HD HBR passthrough

Add definitions and fixups for channel count

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
6 years agortp-send: remove dead code
Sangchul Lee [Thu, 3 May 2018 16:27:21 +0000 (01:27 +0900)]
rtp-send: remove dead code

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years ago.gitignore: add m4/extern-inline.m4 and remove-ptcdate.sed
Tanu Kaskinen [Tue, 17 Apr 2018 11:16:16 +0000 (14:16 +0300)]
.gitignore: add m4/extern-inline.m4 and remove-ptcdate.sed

6 years agoUse upstream gettext instead intltool
Javier Jardón [Mon, 2 Apr 2018 19:48:29 +0000 (20:48 +0100)]
Use upstream gettext instead intltool

6 years agoi18n: update the Ukrainian translation
Yuri Chornoivan [Sun, 18 Mar 2018 10:37:42 +0000 (12:37 +0200)]
i18n: update the Ukrainian translation

6 years agoi18n: update the Indonesian translation
Andika Triwidada [Sun, 4 Mar 2018 16:05:14 +0000 (18:05 +0200)]
i18n: update the Indonesian translation

6 years agoi18n: update the Lithuanian translation
Mr. M [Thu, 15 Feb 2018 08:29:48 +0000 (10:29 +0200)]
i18n: update the Lithuanian translation

6 years agobluetooth: policy: Remove BlueZ 4 related code
Luiz Augusto von Dentz [Mon, 26 Mar 2018 14:15:51 +0000 (17:15 +0300)]
bluetooth: policy: Remove BlueZ 4 related code

This removes hfpw option and profile which were only used by BlueZ 4.

6 years agobluetooth: Remove BlueZ 4 support
Luiz Augusto von Dentz [Mon, 26 Mar 2018 14:15:50 +0000 (17:15 +0300)]
bluetooth: Remove BlueZ 4 support

BlueZ 4 is no longer supported by BlueZ community for a long long time,
also by moving to BlueZ 5 it should make it even more clearer that
BlueZ 4 is no longer an option.

6 years agobluetooth: ofono: Use Acquire method if available
Luiz Augusto von Dentz [Thu, 22 Mar 2018 12:56:00 +0000 (14:56 +0200)]
bluetooth: ofono: Use Acquire method if available

Attempt to use Acquire method if available since it directly returns
the fd in the reply or an error if that the connection could not be
created while Connect offer neither of these and depend on
NewConnection to deliver the fd.

6 years agooptimize set_state_in_io_thread() callbacks
Raman Shyshniou [Tue, 20 Mar 2018 13:26:20 +0000 (16:26 +0300)]
optimize set_state_in_io_thread() callbacks

Source and sink are passed in arguments to set_state_in_io_thread()
callbacks. There is optimal to access them directly.

6 years agoset exit_idle_time to 0 when we detect a session
Tanu Kaskinen [Tue, 6 Mar 2018 13:09:06 +0000 (15:09 +0200)]
set exit_idle_time to 0 when we detect a session

As the comments explain, this fixes relogin problems on some systems
that remove our sockets on logout without terminating the daemon.

6 years agoalsa-mixer: add support for SteelSeries Arctis 5 and renamed Arctis 7 files appropriately
Bert Hekman [Tue, 13 Feb 2018 19:06:12 +0000 (20:06 +0100)]
alsa-mixer: add support for SteelSeries Arctis 5 and renamed Arctis 7 files appropriately

6 years agoalsa-card: improve the profile availability logic
Tanu Kaskinen [Tue, 20 Feb 2018 09:55:14 +0000 (11:55 +0200)]
alsa-card: improve the profile availability logic

When a new card shows up (during pulseaudio startup or hotplugged),
pulseaudio needs to pick the initial profile for the card. Unavailable
profiles shouldn't be picked, but module-alsa-card sometimes marked
unavailable profiles as available, causing bad initial profile choices.

This patch changes module-alsa-card so that it marks all profiles
unavailable whose all output ports or all input ports are unavailable.
Previously only those profiles were marked as unavailable whose all
ports were unavailable. For example, if a profile contains one sink and
one source, and the sink is unavailable and the source is available,
previously such profile was marked as available, but now it's marked as
unavailable.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102902
6 years agoloopback: use source sample spec and channel map by default
Raman Shyshniou [Tue, 20 Feb 2018 20:32:57 +0000 (21:32 +0100)]
loopback: use source sample spec and channel map by default

Currently the loopback module uses sample spec and channel map of the
sink by default. It leads to double resample if source and sink sample
specs are different and no rate/format specified in arguments. This
patch causes the source sample spec and channel map to be used by
default.

6 years agoloopback: add max_latency_msec argument
Raman Shyshniou [Tue, 20 Feb 2018 20:29:16 +0000 (21:29 +0100)]
loopback: add max_latency_msec argument

Currently loopback module indefinitely increases latency if underruns
occur. This patch allows to set up the upper limit of latency.

6 years agocore-util: correct error in set_nonblock()
Georg Chini [Tue, 13 Feb 2018 17:17:08 +0000 (18:17 +0100)]
core-util: correct error in set_nonblock()

set_nonblock() will always set the file descriptor to non-blocking,
regardless of the nonblock argument.

This patch fixes the issue by passing the correct argument to the
fcntl() call. The bug had no impact because there is only one caller
of pa_make_fd_block() in poll-win32.c

6 years agobuild-sys: First pass at a meson-ified build system
Arun Raghavan [Mon, 31 Jul 2017 11:37:36 +0000 (12:37 +0100)]
build-sys: First pass at a meson-ified build system

This is a working implementation of a build with meson. The server,
utils, and most modules build with this, and it is possible to run from
a build tree and play/capture audio on ALSA devices.

There are a number of FIXMEs, of course, and a number of features that
need to be enabled (modules, dependencies, installation, etc.), but this
should provide everything we need to get there relatively quickly.

To use this, install meson (distro package, or mesonbuild.com) and run:

  $ cd <pulseaudio src dir>
  $ meson <builddir>
  $ ninja -C <builddir>

6 years agoalsa-mixer: add a profile-set file to fix iec958 input and output on CMEDIA USB2...
Jean-Philippe Guillemin [Mon, 12 Feb 2018 17:14:21 +0000 (19:14 +0200)]
alsa-mixer: add a profile-set file to fix iec958 input and output on CMEDIA USB2.0 High-Speed True HD Audio

The iec958 output uses device 2 and the iec958 input uses device 0. The
USB configuration in alsa doesn't set up the device numbers correctly,
which is why we need custom configuration in PulseAudio. Ideally this
would be fixed in alsa, but trying to get help for that wasn't
successful.

6 years agoupdate NEWS v12.0
Tanu Kaskinen [Mon, 18 Jun 2018 14:10:46 +0000 (17:10 +0300)]
update NEWS

6 years agosink-input, source-output: fix uninitialized variable access
Tanu Kaskinen [Sat, 5 May 2018 13:53:04 +0000 (16:53 +0300)]
sink-input, source-output: fix uninitialized variable access

The volume_map variable was initialized only for PCM streams, but the
variable was passed to pa_cvolume_remap() also for non-PCM streams. The
volume remapping is never necessary for passthrough streams (PCM or
not), because no volume will be applied anyway, so let's skip the
pa_cvolume_remap() call for all passthrough streams.

6 years agoalsa-card: fix null dereference
Tanu Kaskinen [Thu, 24 May 2018 17:31:51 +0000 (20:31 +0300)]
alsa-card: fix null dereference

jack->melem can be null if the jack disappears between probing the card
and the init_jacks() call. I don't know if jacks actually ever disappear
like that (seems unlikely), but this check is in any case needed as long
as init_jacks() has proper handling for the jack disappearing case
(rather than just an assert).

There was a crash report[1] that indicated that card_suspend_changed()
called report_jack_state() with a null melem. I don't know if that was
because the jack actually disappeared, or is there some other bug too.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=104385

6 years agoalsa-util: Use time stamp config only for alsa versions >= 1.1.0
Georg Chini [Tue, 15 May 2018 05:52:19 +0000 (07:52 +0200)]
alsa-util: Use time stamp config only for alsa versions >= 1.1.0

The commit "alsa-util: Set ALSA report_delay flag in pa_alsa_safe_delay()"
broke the build on ALSA versions below 1.1.0 because the time stamp
configuration function was introduced in 1.1.0.

This patch makes the usage of snd_pcm_status_set_audio_htstamp_config()
dependent on ALSA version.

6 years agobuild-sys: remove module-defs.h.m4 from EXTRA_DIST v11.99.1
Tanu Kaskinen [Fri, 11 May 2018 11:13:53 +0000 (14:13 +0300)]
build-sys: remove module-defs.h.m4 from EXTRA_DIST

The file doesn't exist any more.

6 years agobuild-sys: fix distribution of GSettings files
Tanu Kaskinen [Fri, 11 May 2018 11:06:21 +0000 (14:06 +0300)]
build-sys: fix distribution of GSettings files

dist_gsettingsdataconvert_DATA was set only if GSettings was enabled. If
the developer that generates the tarball doesn't have GSettings enabled,
pulseaudio.convert wouldn't get included in the tarball.

The schema file was not being added to the tarball even if GSettings was
enabled.

6 years agobuild-sys: bump sonames
Tanu Kaskinen [Fri, 11 May 2018 10:53:31 +0000 (13:53 +0300)]
build-sys: bump sonames

A few small internal changes in libpulse. No changes in libpulse-simple
and libpulse-mainloop-glib.

6 years agoalsa-util: Set ALSA report_delay flag in pa_alsa_safe_delay()
Georg Chini [Fri, 4 May 2018 19:10:46 +0000 (21:10 +0200)]
alsa-util: Set ALSA report_delay flag in pa_alsa_safe_delay()

The current code does not call snd_pcm_status_set_audio_htstamp_config()
to configure the way timestamps are updated in ALSA. In kernel 4.14 and
above a bug in ALSA has been fixed which changes timmestamp behavior.
This leads to inconsistencies in the delay reporting because the time
stamp no longer reflects the time when the delay was updated if the
ALSA report_delay flag is not set. Therefore latencies are not calculated
correctly.

This patch uses snd_pcm_status_set_audio_htstamp_config() to set the
ALSA report_delay flag to 1 before the call to snd_pcm_status(). With
this, time stamps are updated as expected.

6 years agobluez5-device: Fix memory leak in sco_process_render()
Georg Chini [Wed, 9 May 2018 05:29:12 +0000 (07:29 +0200)]
bluez5-device: Fix memory leak in sco_process_render()

sco_process_render does not unref the memblock when it encounters an error.

This patch fixes the issue. It also changes the return value to 1 in the case
of EAGAIN. Because the data was already rendered and cannot be re-sent, we
have to discard the block.

Because the modified EAGAIN handling prevents the log message about EAGAIN
after POLLOUT from being printed, the log message was moved to
a2dp/sco_process_render().

6 years agobluez5-device: Rewrite of thread function, reduce send buffer size for a2dp sink
Georg Chini [Wed, 9 May 2018 05:27:58 +0000 (07:27 +0200)]
bluez5-device: Rewrite of thread function, reduce send buffer size for a2dp sink

The rewrite of the thread function does not change functionality much,
most of it is only cleanup, minor bug fixing  and documentation work.

This patch also changes the send buffer size for a2dp sink to avoid lags
after temporary connection drops, following the proof-of-concept patch
posted by Dmitry Kalyanov.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=58746
Additionally the patch changes the fixed latency for HSP playback from 125
to 25 ms. Tests showed that this produces better audio sync, which is
expected as HSP should have smaller latency than A2DP.

6 years agovala: Fix lengths for source/sink port arrays
David Hewitt [Sat, 5 May 2018 20:37:03 +0000 (21:37 +0100)]
vala: Fix lengths for source/sink port arrays

6 years agoallow-passthrough: fix hook return value
Tanu Kaskinen [Sat, 5 May 2018 14:22:46 +0000 (17:22 +0300)]
allow-passthrough: fix hook return value

-PA_ERR_NOENTITY is not a valid pa_hook_result_t value.

6 years agomodule-allow-passthrough: Don't crash if we can't find a sink
Arun Raghavan [Fri, 4 May 2018 16:29:23 +0000 (21:59 +0530)]
module-allow-passthrough: Don't crash if we can't find a sink

module-allow-passthrough has a (necessary) hack to replicate the default
sink selection and format negotiation from sink-input.c. One thing that
got missed in this replication is the possibility that the sink input is
not compatible with the default sink. When this happen, we now exit
gracefully.

6 years agoladspa-sink: fix incorrect error conditions
Sangchul Lee [Thu, 3 May 2018 17:00:26 +0000 (02:00 +0900)]
ladspa-sink: fix incorrect error conditions

fix codes to prevent null pointer dereference of cdata variable.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoi18n: update Polish translation
Piotr Drąg [Fri, 27 Apr 2018 15:05:52 +0000 (17:05 +0200)]
i18n: update Polish translation

https://bugs.freedesktop.org/show_bug.cgi?id=106284

6 years agoalsa-sink/source: always set reconfiguration callback
Sangchul Lee [Fri, 27 Apr 2018 16:07:26 +0000 (01:07 +0900)]
alsa-sink/source: always set reconfiguration callback

Reconfiguration callback should also be set in case of avoiding resampling
option. This patch set the callback for every case because the callback
has already conditions to leave if it is not needed.
Also unnecessary codes of setting alternate sample rate to 0 are removed.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agogsettings: run gsettings-data-convert from gsettings-helper
Tanu Kaskinen [Mon, 23 Apr 2018 13:16:11 +0000 (16:16 +0300)]
gsettings: run gsettings-data-convert from gsettings-helper

This was originally planned to be done by paprefs when it starts, but
since the schema is now fully controlled by pulseaudio, it makes sense
to run the conversion from pulseaudio instead.

6 years agovala: fix a struct field name and add missing source output volume/mute functions
wellington wallace [Thu, 26 Apr 2018 11:31:50 +0000 (14:31 +0300)]
vala: fix a struct field name and add missing source output volume/mute functions

6 years agobuild-sys: enable GSettings by default
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:42 +0000 (09:07 +0300)]
build-sys: enable GSettings by default

A new paprefs release is expected soon, and it will only support
GSettings. In order to have the default configuration work with the new
paprefs version, we need to enable GSettings by default.

If both module-gconf and module-gsettings are enabled when building
PulseAudio, both modules will be part of the default configuration. That
can cause trouble, because when the GConf database is migrated to
GSettings, the old configuration in GConf is not removed, so both
module-gconf and module-gsettings will try to load modules.

Generally it's not necessary to have both modules enabled even at build
time, so let's default to having only one of them enabled.

6 years agogsettings: free group_names after use
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:41 +0000 (09:07 +0300)]
gsettings: free group_names after use

6 years agogsettings: free the module-group GSettings objects after use
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:40 +0000 (09:07 +0300)]
gsettings: free the module-group GSettings objects after use

g_settings_get_child() returns a new GSettings object that needs to be
freed when it's not used any more. This patch collects all the childern
to a GPtrArray and frees them at the end of main(). They can't be freed
earlier, because that would prevent the "changed" signals from being
delivered.

6 years agogsettings: remove bad signal connection
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:39 +0000 (09:07 +0300)]
gsettings: remove bad signal connection

The removed g_signal_connect() call didn't make sense. The callback
expects to be called when individual module groups are changed, not when
the top level object is changed. Also, module_group_callback() expects
user_data to be non-NULL, but here it was set to NULL.

6 years agogsettings: check that children haven't been deleted before using them
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:38 +0000 (09:07 +0300)]
gsettings: check that children haven't been deleted before using them

According to the documentation of g_settings_list_children(), the listed
children may be removed at any time, so g_settings_get_child() may
return NULL. This is probably very unlikely to happen in practice, but
it's good to check anyway.

6 years agobuild-sys: remove a redundant enable_gsettings check
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:37 +0000 (09:07 +0300)]
build-sys: remove a redundant enable_gsettings check

If HAVE_GSETTINGS is 1, then enable_gsettings must be yes, so checking
enable_gsettings isn't necessary.

6 years agogsettings: rename "module" to "module-group"
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:36 +0000 (09:07 +0300)]
gsettings: rename "module" to "module-group"

It is confusing if there's a thing named "module" which defines up to 10
modules to load. Calling the thing a "module group" instead should make
it easier to understand.

6 years agogconf, gsettings: fix config.h includes
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:35 +0000 (09:07 +0300)]
gconf, gsettings: fix config.h includes

config.h should be included by all .c files and none of the .h files.

6 years agogsettings: add the modules schema to the schema description file
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:34 +0000 (09:07 +0300)]
gsettings: add the modules schema to the schema description file

Originally the idea was to provide the "modules" schema with paprefs,
but since module-gsettings refers to the "modules" schema in its code,
that would make module-gsettings depend on paprefs, which is not good.
Now all schemas are provided by module-gsettings, so the paprefs
dependency is avoided. Unfortunately this means that if paprefs is
modified to load some new modules, the schema in pulseaudio needs to be
updated as well.

6 years agodefault.pa: add module-gsettings
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:33 +0000 (09:07 +0300)]
default.pa: add module-gsettings

This also makes the module-gconf section conditional on HAVE_GCONF,
because if only gsettings support is built, the gconf section in the
configuration file would be redundant and confusing.

6 years ago.gitignore: add module-gsettings related things
Tanu Kaskinen [Tue, 17 Apr 2018 06:07:32 +0000 (09:07 +0300)]
.gitignore: add module-gsettings related things

6 years agomodule-gsettings: new module to store configuration using gsettings
Sylvain Baubeau [Mon, 25 Jul 2016 19:58:48 +0000 (21:58 +0200)]
module-gsettings: new module to store configuration using gsettings

GConf is deprecated, and distributions are removing it. paprefs depends
on GConf, so in order to avoid paprefs getting removed as well, paprefs
has to be changed to use something else than GConf. GSettings is the
easiest alternative to migrate to, although it has the same problems
that GConf had: no support for system mode or networking.

This patch takes the non-GConf specific code from module-gconf and puts
it in stdin-util.[ch], which is then reused by module-gsettings.
module-gsettings is designed to be very similar to module-gconf.

Migration is expected to happen as follows: Distributions update
PulseAudio and paprefs at the same time, or first PulseAudio and then
paprefs. paprefs depends on module-gsettings, and module-gsettings
conflicts with module-gconf. Therefore module-gconf gets automatically
removed during the paprefs update. After the update an old PulseAudio is
likely to be running with module-gconf loaded. If the user tries to use
paprefs during this period, whatever the user does in paprefs won't have
any effect until PulseAudio is restarted (probably by a reboot or
relogin). This is not ideal, but will have to do.

When module-gsettings is loaded, it runs gsettings-data-convert
(implemented in a later patch). That will copy the settings from GConf
to GSettings. If gsettings-data-convert is not available (it's part of
GConf, so it may have already been uninstalled), then any previous
paprefs settings are lost.

6 years agoqpaeq: fix Qt5 mainloop use
Felipe Sateler [Wed, 11 Apr 2018 12:26:19 +0000 (15:26 +0300)]
qpaeq: fix Qt5 mainloop use

This change was missed in the Qt4 -> Qt5 conversion.

6 years agoman: unify pactl and pacmd suspend command documentation
Tanu Kaskinen [Sun, 8 Apr 2018 10:23:11 +0000 (13:23 +0300)]
man: unify pactl and pacmd suspend command documentation

The suspend-sink and suspend-source documentation for pacmd was quite
terse, so I copied the more complete documentation from pactl. I
couldn't resist doing some other minor edits along the way too.

link: https://bugs.freedesktop.org/show_bug.cgi?id=105907
6 years agoi18n: update the Czech translation
Daniel Rusek [Mon, 2 Apr 2018 11:34:59 +0000 (14:34 +0300)]
i18n: update the Czech translation

6 years agoFix memory leaks
Jungsup Lee [Fri, 23 Mar 2018 08:26:36 +0000 (17:26 +0900)]
Fix memory leaks

The returned string of the dbus_message_iter_get_signature() must be
freed with dbus_free().

6 years agoi18n: update the Ukrainian translation
Yuri Chornoivan [Sun, 18 Mar 2018 10:37:42 +0000 (12:37 +0200)]
i18n: update the Ukrainian translation

6 years agofix a call to pa_sink_suspend() from an incorrect thread
Tanu Kaskinen [Mon, 19 Mar 2018 21:11:05 +0000 (23:11 +0200)]
fix a call to pa_sink_suspend() from an incorrect thread

The alsa sink calls pa_sink_suspend() from the set_port() callback.
pa_sink_suspend() can only be called from the main thread, but the
set_port() callback was often called from the IO thread. That caused an
assertion to be hit in pa_sink_suspend() when switching ports.

Another issue was that pa_sink_suspend() called the set_port() callback,
and if the callback calls pa_sink_suspend() again recursively, nothing
good can be expected from that, so the thread mismatch was not the only
problem.

This patch moves the mixer syncing logic out of pa_sink/source_suspend()
to be handled internally by the alsa sink/source. This removes the
recursive pa_sink_suspend() call. This also removes the need to have the
mixer_dirty flag in pa_sink/source, so the flag and the
pa_sink/source_set_mixer_dirty() functions can be removed.

This patch also changes the threading rules of set_port(). Previously it
was called sometimes from the main thread and sometimes from the IO
thread. Now it's always called from the main thread. When deferred
volumes are used, the alsa sink and source still have to update the
mixer from the IO thread when switching ports, but the thread
synchronization is now handled internally by the alsa sink and source.
The SET_PORT messages are not needed any more and can be removed.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104761
6 years agopass pa_suspend_cause_t to set_state_in_io_thread() callbacks
Tanu Kaskinen [Mon, 19 Mar 2018 21:11:04 +0000 (23:11 +0200)]
pass pa_suspend_cause_t to set_state_in_io_thread() callbacks

The suspend cause isn't yet used by any of the callbacks. The alsa sink
and source will use it to sync the mixer when the SESSION suspend cause
is removed. Currently the syncing is done in pa_sink/source_suspend(),
and I want to change that, because pa_sink/source_suspend() shouldn't
have any alsa specific code.

6 years agoreplace sink/source SET_STATE handlers with callbacks
Tanu Kaskinen [Tue, 13 Mar 2018 17:40:38 +0000 (19:40 +0200)]
replace sink/source SET_STATE handlers with callbacks

There are no behaviour changes, the code from almost all the SET_STATE
handlers is moved with minimal changes to the newly introduced
set_state_in_io_thread() callback. The only exception is module-tunnel,
which has to call pa_sink_render() after pa_sink.thread_info.state has
been updated. The set_state_in_io_thread() callback is called before
updating that variable, so moving the SET_STATE handler code to the
callback isn't possible.

The purpose of this change is to make it easier to get state change
handling right in modules. Hooking to the SET_STATE messages in modules
required care in calling pa_sink/source_process_msg() at the right time
(or not calling it at all, as was the case on resume failures), and
there were a few bugs (fixed before this patch). Now the core takes care
of ordering things correctly.

Another motivation for this change is that there was some talk about
adding a suspend_cause variable to pa_sink/source.thread_info. The
variable would be updated in the core SET_STATE handler, but that would
not work with the old design, because in case of resume failures modules
didn't call the core message handler.

6 years agooss: don't fail resume if trigger() fails
Tanu Kaskinen [Tue, 13 Mar 2018 17:40:37 +0000 (19:40 +0200)]
oss: don't fail resume if trigger() fails

The previous code made the SET_STATE message fail if trigger() failed.
However, trigger() was called after pa_sink/source_process_msg(), which
meant that the main thread that sent the SET_STATE thought that resuming
failed, but nothing was undone in the IO thread, so in the IO thread
things seemed as if the sink/source was successfully resumed. (I don't
use OSS myself, so I don't know what kind of practical problems this
could cause).

Unless some complex undo logic is implemented, I believe it's best to
ignore all failures in trigger(). Most error cases were already ignored,
and the only one that wasn't ignored doesn't seem too serious.

I also moved trigger() to happen before pa_sink/source_process_msg(),
which made it necessary to add new state parameters to trigger(). The
reason for this move is that I want to move the SET_STATE handler code
into a separate callback, and if things are done both before and after
pa_sink/source_process_msg(), that makes things more complicated.

The previous code checked the return value of
pa_sink/source_process_msg() before calling trigger(), but that was
unnecessary, since pa_sink/source_process_msg() never fails when
processing the SET_STATE messages.

6 years agosink, source: rename set_state() to set_state_in_main_thread()
Tanu Kaskinen [Tue, 13 Mar 2018 17:40:36 +0000 (19:40 +0200)]
sink, source: rename set_state() to set_state_in_main_thread()

There will be a new callback named set_state_in_io_thread(). It seems
like a good idea to have a similar name for the main thread variant.

6 years agobluetooth: fix resume error handling
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:25 +0000 (16:48 +0200)]
bluetooth: fix resume error handling

When resuming a sink or source, pa_sink/source_process_msg() should be
called only if resuming is successful. pa_sink/source_process_msg()
updates thread_info.state and notifies streams about the new state, but
if resuming fails, there's no state change.

6 years agoi18n: update the Indonesian translation
Andika Triwidada [Sun, 4 Mar 2018 16:05:14 +0000 (18:05 +0200)]
i18n: update the Indonesian translation

6 years agonull-sink, pipe-sink: some state variable cleanups
Tanu Kaskinen [Wed, 21 Feb 2018 09:54:41 +0000 (11:54 +0200)]
null-sink, pipe-sink: some state variable cleanups

pa_sink_get_state() is supposed to be used from the main thread. In this
case it doesn't really matter, because the SET_STATE handler is executed
while the main thread is waiting, but since the state is available also
in thread_info, let's use that. All other modules use thread_info.state
too, so at least this change improves consistency.

Also, we can use the PA_SINK_IS_OPENED macro to simplify the code a bit.

6 years agoalsa: add a couple of FIXME comments
Tanu Kaskinen [Mon, 19 Feb 2018 14:48:21 +0000 (16:48 +0200)]
alsa: add a couple of FIXME comments

build_pollfd() isn't likely to fail, but if it does, pa_sink/source_put()
will crash on an assertion failure. I haven't seen such crash happening,
this is just something that I noticed while studying the state change
code.