platform/upstream/pulseaudio.git
6 years agoModify pulseaudio-system.conf for dbus configuration 09/170009/1
Sangchul Lee [Tue, 13 Feb 2018 00:06:54 +0000 (09:06 +0900)]
Modify pulseaudio-system.conf for dbus configuration

add to allow send destination
add to set privilege for setting volume level

original patches
 : 8e2f4f855517f8538086bc81f7a645d61ef427ae - seungbae.shin@samsung.com - 2016-03-02 - Add privilege check on dbus policy configuration (with some cleanups)
 : 1f23375b1c28b376586018447a95dc58af67d9f8 - sc11.lee@samsung.com - 2015-07-08 - Modify pulseaudio-system.conf file for updating dbus access right, policy/sound-player: change dbus path

[Version] 11.1-18
[Issue Type] Tizen modification

Change-Id: I44528433b8acc87e52f322f7ce78552cd9d88442
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agofixup! Add .gbs.conf for upstream branch build 47/169947/1
Seungbae Shin [Mon, 12 Feb 2018 08:25:05 +0000 (17:25 +0900)]
fixup! Add .gbs.conf for upstream branch build

Change-Id: I18bd1e46141186cee09a0060d09058c262c67525

6 years agoAdd .gbs.conf for upstream branch build 33/169933/1
Seungbae Shin [Mon, 12 Feb 2018 07:18:55 +0000 (16:18 +0900)]
Add .gbs.conf for upstream branch build

https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs

[Version] 11.1-17
[Issue Type] Tizen modification

Change-Id: Id911eaf7617c1f7d515d09b576c55ec0ea0715da

6 years agoCreate sink-input/source-ouput with previous sink/source set 32/169932/3
Seungbae Shin [Mon, 12 Feb 2018 07:11:26 +0000 (16:11 +0900)]
Create sink-input/source-ouput with previous sink/source set

original patch
 : d8d1be18efdc04b010cbb4b5f97ca53128b0674e - 2015-07-15 - jho.mok@samsung.com - Fix crash, and some debugging code

[Version] 11.1-16
[Issue Type] Tizen modification

Change-Id: I9ed6ff50e7486d4e6bb3d63a48432fee393320b4

6 years agoAdd ommited build flags for tizen to AM_CFLAGS 11/169911/2
Sangchul Lee [Mon, 12 Feb 2018 05:30:06 +0000 (14:30 +0900)]
Add ommited build flags for tizen to AM_CFLAGS

Since AM_CFLAGS are commonly used for compiling modules,
it is used for tizen build flags which will be applied to modules.

[Version] 11.1-15
[Issue Type] Enhancement

Change-Id: Iac3a90ce518722edd0bdeb02ad6906ff5022a45d
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd empty pop protection feature 25/169425/5
Seungbae Shin [Tue, 6 Feb 2018 12:12:01 +0000 (21:12 +0900)]
Add empty pop protection feature

original patches
 : fc24ad2b36d735bc48229519a2638e91c36913c5 - 2017-01-23 - seungbae.shin@samsung.com - Reset zero-pop timestamp when sink-input state is not running
 : 3b758c752d11b25557057c89202e9004f88dc2c0 - 2016-07-13 - seungbae.shin@samsung.com - Revise zero pop log messages
 : 4ede897013c362375df581b72db56afe4ac4ce94 - 2016-06-30 - seungbae.shin@samsung.com - Notify pop-timeout event to client when there is no data for long time

[Version] 11.1-14
[Issue Type] Feature

Change-Id: I6681d2aacc52ea188575b024dbc7815778624766

6 years agoAdd pa-simple extension feature 05/169405/3
Seungbae Shin [Tue, 6 Feb 2018 09:25:10 +0000 (18:25 +0900)]
Add pa-simple extension feature

original patches
 : d4ca31c91835a15f9be027977cf381dd5c50d997 - 2016-04-25 - seungbae.shin@samsung.com - Remove unused function added by Tizen
 : 323a454fc9a06d8627800cca7c7e9183c9f70497 - 2014-05-28 - vivian.zhang@intel.com - changes to pa simple api - samsung

[Version] 11.1-13
[Issue Type] Feature

Change-Id: Ib980addf75630079713edc734ecae228d09a97df

6 years agoAdd prelink / lwipc feature, disable pcm-dump feature for TV product 47/169347/4
Seungbae Shin [Tue, 6 Feb 2018 06:22:24 +0000 (15:22 +0900)]
Add prelink / lwipc feature, disable pcm-dump feature for TV product

original patches
 : ae799fd05f37f4e3bbd0e2f4435b2bbd01eab540 - 2016-08-18 - jungsup4.lee@samsung.com - Applying light weight ipc
 : 44216168d3e8ba13c86d8eb78ff5f9cb5cec3020 - 2016-05-20 - seonmi.jin@samsung.com - [TV] Add configuration --enable-prelink
 : 8528b1b7b6fa6d703efdff92576b233ccf3a6201 - 2017-12-20 - seungbae.shin@samsung.com - Disable pcm-dump feature by default on TV

[Version] 11.1-12
[Issue Type] TV PROD Feature

Change-Id: Ic921dfabd5163dac61fb90fe072c327193761f06

6 years agoAdd pa-ready feature 35/169335/5
Seungbae Shin [Tue, 6 Feb 2018 05:17:55 +0000 (14:17 +0900)]
Add pa-ready feature

original patches
 :44106a0434254ce6798fcd6cb8a06642fb6a2d7c - jho.mok@samsung.com - 2016-09-08- make pa-ready as feature
 :4c30a4731d5ab495a3e5105396f09a31f931b739 - jaska.uimonen@intel.com - 2013-08-08 - create pa_ready file - samsung

[Version] 11.1-11
[Issue Type] feature

Change-Id: Ief098e2aaed7e94d8f8d9ef03e98ce7b8284c700

6 years agoalsa-card, udev-detect: Add support for using udev only for USB devices 13/169313/7
Sangchul Lee [Tue, 6 Feb 2018 02:35:39 +0000 (11:35 +0900)]
alsa-card, udev-detect: Add support for using udev only for USB devices

original patch
 : 9ae05a9c6216ba7918c25b4f5442a45f9ee7f2cc - jaska.uimonen@intel.com - 2014-05-28 - use udev only for usb devices - samsung

[Version] 11.1-10
[Issue Type] feature

Change-Id: I42f3711519ebc8ee1268dc3ac6a65f90bb5f0626
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd support for privilege checks 62/169262/6
Sangchul Lee [Mon, 5 Feb 2018 08:21:25 +0000 (17:21 +0900)]
Add support for privilege checks

privileges
 : http://tizen.org/privilege/volume.set
 : http://tizen.org/privilege/recorder

original patches are as below
 : 0cf5d5a0f41fba3a28ee6015100a6e7b6381c703 - jho.mok@samsung.com - 2016-05-24 - New context API for privilege check
 : dc5392a2efea4ea0e2ab3b710feb23d2aad01ee6 - seungbae.shin@samsung.com - 2015-12-11 - [Security] return security error properly & revise cynara code
 : 77911b41919979db908735f6e17dafcf8002435e - o.switalski@samsung.com - 2015-11-19 - Apply cynara privilege checks

[Version] 11.1-9
[Issue Type] feature

Change-Id: I47c121d09d4ca6b5258b077a30ad2ca4f10809a9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoidxset: Add pa_idxset_filtered_copy function to copy existing idxset with a condition 00/169100/6
Sangchul Lee [Thu, 23 Feb 2017 02:01:08 +0000 (11:01 +0900)]
idxset: Add pa_idxset_filtered_copy function to copy existing idxset with a condition

same as patch below
 : 6bf96c1b89d149e62a02bb2c2cc233c18e82889d - sc11.lee@samsung.com - 2017-02-23

[Version] 11.1-8
[Issue Type] feature

Change-Id: I31adcc84aaaca5ea29f35e3c7f194dd6399746f7
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agosink, source: Add variables for managing devices 56/169056/6
Sangchul Lee [Fri, 2 Feb 2018 05:10:53 +0000 (14:10 +0900)]
sink, source: Add variables for managing devices

original patches are as below
 : a0318cb9f5eec9b5e0962e1fd8c4579041525a94 - sc11.lee@samsung.com - 2015-10-06 - Add variable for checking if it uses internal codec in sink/source
 : f072f302c387bd4f2a25950734681c7eb8145b01 - jho.mok@samsung.com - 2015-06-24 - Add device manager, on disabled status Gather module-policy related files into tizen directory

[Version] 11.1-7
[Issue Type] feature

Change-Id: Icc89db2ad6f05bad422b010830240845761a8f87
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd support for pcm dump 37/169037/5
Sangchul Lee [Fri, 2 Feb 2018 03:56:27 +0000 (12:56 +0900)]
Add support for pcm dump

original patches
 : 9cc8f487ce077b3edfd3ae169df9c8b793d4dc9c - jungsup4.lee@samsung.com - 2017-05-11 - sink-input: Enhance PCM dump
 : d2f6895a10071acd1929d6fa7a6c4bfbefb2d39b - hs7388.lee@samsung.com - 2017-03-28 - Enhance log format for dlog & enhance pcm dump, remove unused code

[Version] 11.1-6
[Issue Type] feature

Change-Id: I71c60a7be35da26ddf80779d986cd744aca91b4f
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoproplist, protocol-native: Apply buffer attributes 39/168939/9
Sangchul Lee [Thu, 1 Feb 2018 08:16:45 +0000 (17:16 +0900)]
proplist, protocol-native: Apply buffer attributes

it is related to below patches
 : 10324be41198d40cb8629474ac34e4735fc39613 - sc11.lee@samsung.com -2016-06-24 -protocol-native: Update buffer attributes only when values are -1 or not set by client
 : bcc11fa2914306ec92713f0fcf6d32741e855c66 - sc11.lee@samsung.com -2016-06-14 -Rename function for updating buffer attributes
 : 2357db40776ef6c4346f5e5c386105f6e4bdb62e - sc11.lee@samsung.com -2016-04-29 -Add null checking for getting buffer attribute and add error checking for hook fire of sink-input/source-output new

[Version] 11.1-5
[Issue Type] feature

Change-Id: If199ba3d9b77c8647a8250ed34bda73d91b150df
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoproplist: Add support for stream-manager of module-tizenaudio-policy 29/168929/5
Sangchul Lee [Thu, 1 Feb 2018 07:21:23 +0000 (16:21 +0900)]
proplist: Add support for stream-manager of module-tizenaudio-policy

it is also related to original patch below
 : 97a359b2c325e035c315e46107f9e244567d6946 - sc11.lee@samsung.com - 2017-03-14 - proplist: Add PA_PROP_MEDIA_FOCUS_ID definition

[Version] 11.1-4
[Issue Type] feature

Change-Id: I626e7efa1777bd05da5aa34c2946252dfb544ccb
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd pulsecore pkg-config file 04/168904/6
Sangchul Lee [Thu, 1 Feb 2018 04:04:03 +0000 (13:04 +0900)]
Add pulsecore pkg-config file

origin patch
 : bd75f47eaacbad720ddede3123e7cc87d450d806 - seonmi.jin@samsung.com - 2015-09-17 - build install pulsecore headers

[Version] 11.1-3
[Issue Type] pkg config file

Change-Id: I124ddd41b2aa19359e8185e17d6217c34209fb74
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd systemd service file for tizen platform based on 4.0 version 08/168708/7
Sangchul Lee [Tue, 30 Jan 2018 07:56:49 +0000 (16:56 +0900)]
Add systemd service file for tizen platform based on 4.0 version

a commit of tizen_4.0 branch is applied.
 : 7f7ce82aa5631db285d1f771993fb350f5546db1 - seungbae.shin@samsung.com - Add explict dependancy on systemd-tmpfiles-setup service

below are diff. comparing to tizen_4.0 branch
 : unused pulseaudio.socket file is removed in /usr/lib/systemd/system/ directory
 : do not copy service file to /usr/lib/systemd/user/ directory

[Version] 11.1-2
[Issue Type] Service file

Change-Id: Ie45de0bea0e9616f9d12b052ad329dfa63a0bb3b
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd support for dlog 84/168484/7
Sangchul Lee [Mon, 29 Jan 2018 02:43:52 +0000 (11:43 +0900)]
Add support for dlog

original patches are as below
 : d2f6895a10071acd1929d6fa7a6c4bfbefb2d39b - hs7388.lee@samsung.com - 2017-03-28 - Enhance log format for dlog & enhance pcm dump, remove unused code
 : 2411e1330151cd11ee45aafb12de35a48c7fd5b0 - vivian.zhang@intel.com - 2014-05-28 - add support for dlog - samsung

[Version] 11.1-1
[Issue Type] Feature

Change-Id: I7780ce3731afdc670fe8a684c91b9d6329e1ed32
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoAdd initial spec file for tizen public 53/168353/3
Sangchul Lee [Fri, 26 Jan 2018 04:34:01 +0000 (13:34 +0900)]
Add initial spec file for tizen public

 Feature enable status
     Enable memfd shared memory:    no
     Enable X11:                    no
     Enable OSS Output:             no
     Enable OSS Wrapper:            no
     Enable EsounD:                 no
     Enable Alsa:                   yes
     Enable CoreAudio:              no
     Enable Solaris:                no
     Enable WaveOut:                no
     Enable GLib 2.0:               yes
     Enable Gtk+ 3.0:               no
     Enable GConf:                  no
     Enable Avahi:                  no
     Enable Jack:                   no
     Enable Async DNS:              no
     Enable LIRC:                   no
     Enable D-Bus:                  yes
     Enable BlueZ 4:                no
     Enable BlueZ 5:                yes
         Enable ofono headsets:     yes
         Enable native headsets:    no
     Enable udev:                   yes
       Enable HAL->udev compat:     no
     Enable systemd
       Daemon (Socket Activation):  yes
       Login (Session Tracking):    no
       Journal (Logging):           yes
     Enable TCP Wrappers:           no
     Enable libsamplerate:          no
     Enable IPv6:                   no
     Enable OpenSSL (for Airtunes): yes
     Enable fftw:                   no
     Enable orc:                    no
     Enable Adrian echo canceller:  yes
     Enable speex (resampler, AEC): yes
     Enable soxr (resampler):       no
     Enable WebRTC echo canceller:  no
     Enable gcov coverage:          no
     Enable unit tests:             no
     Database
       tdb:                         no
       gdbm:                        no
       simple database:             yes

     System User:                   pulse
     System Group:                  pulse
     Access Group:                  pulse-access
     Enable per-user EsounD socket: no
     Force preopen:                 no
     Preopened modules:             all

     Legacy Database Entry Support: yes

[Version] 11.1-0
[Issue Type] Spec

Change-Id: I5bf12c4173ad0df2fd48319cd70dee9739fd0483
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoMerge branch 'upstream/11.1' into tizen 37/168337/1
Sangchul Lee [Fri, 26 Jan 2018 01:18:23 +0000 (10:18 +0900)]
Merge branch 'upstream/11.1' into tizen

Change-Id: I9cda970c0b2b8cd40a4883559d9707718bf3ecd9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoInitialize codes based on 11.1 36/168336/1
Sangchul Lee [Fri, 26 Jan 2018 01:17:02 +0000 (10:17 +0900)]
Initialize codes based on 11.1

Change-Id: I0826e35f3806e89de2b6cc7a1d3060101e1fd8d8
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoInitialize git 10/168210/1
Sangchul Lee [Thu, 25 Jan 2018 03:54:20 +0000 (12:54 +0900)]
Initialize git

The previous tizen branch is based on PulseAudio 5.0 + a lot of patches from Intel.
Since we do use features from Intel and it also brings complicated situation to merge
upstream codes, we decide to initialize this git from the beginning.
Next patches which are upstream codes and tizen patches will be coming soon.

Change-Id: I5b80f66bd1cb1525133321733f05cf790d975a3f
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
6 years agoDisable pcm-dump feature by default on TV 64/164664/1
Seungbae Shin [Tue, 19 Dec 2017 08:36:07 +0000 (17:36 +0900)]
Disable pcm-dump feature by default on TV

[Version] 5.0-124
[Issue Type] Security

Change-Id: Id2fa8bbe74635d09a8fd394cbccf013b26de1597
(cherry picked from commit 0982ee20c86b54b0d4ac29e5d3ba2097af7649e2)

6 years agobluetooth-policy: Revise role according to Tizen policy 94/163894/1 accepted/tizen/unified/20171214.154143 submit/tizen/20171214.052708 submit/tizen/20171214.053311
Sangchul Lee [Wed, 13 Dec 2017 01:36:29 +0000 (10:36 +0900)]
bluetooth-policy: Revise role according to Tizen policy

Change-Id: I32626ffc2a030ac243493a270f83617fcf9c2668
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
(cherry picked from commit 6bf9ae23e52622c5aa0fe0881785a5d1392f9b80)

7 years agoRemove not supported update script 27/151327/1 accepted/tizen/unified/20170922.065214 submit/tizen/20170921.061238
Sunmin Lee [Fri, 8 Sep 2017 01:47:41 +0000 (10:47 +0900)]
Remove not supported update script

RW update script for Tizen 2.4 (to 3.0) is not necessary in Tizen 4.0.
(Tizen 4.0 does not support upgrade from Tizen 2.4)
Remove this file in terms of clearing the redundancy.

Change-Id: I85813870ddeeea0b4fbe0266e481fb7b3621648d
(cherry picked from commit db45997b7745c7c75401db34a186204f4b961ce5)

7 years agoupdate NEWS upstream/11.1 v11.1
Tanu Kaskinen [Mon, 18 Sep 2017 14:40:00 +0000 (17:40 +0300)]
update NEWS

7 years agoNEWS: add GNU Hurd support
Tanu Kaskinen [Tue, 5 Sep 2017 10:23:58 +0000 (13:23 +0300)]
NEWS: add GNU Hurd support

For some reason this was left out when copying the feature list from the
release notes.

7 years agobluez: Don't crash on strange MTU sizes
Arun Raghavan [Wed, 13 Sep 2017 07:19:28 +0000 (12:49 +0530)]
bluez: Don't crash on strange MTU sizes

We got reports of this with automatically detected MTUs that weren't
frame aligned.

7 years agobluez: Don't autodetect MTU by default
Arun Raghavan [Wed, 13 Sep 2017 03:52:27 +0000 (09:22 +0530)]
bluez: Don't autodetect MTU by default

This breaks a lot of headsets, so disabling by default. Can be
re-enabled in configuration for specific hardware where it is deemed
necessary.

Also added some debug logging to be able to examine what MTU size is
reported by the device.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102660
7 years agoalsa-mixer: add mixer handling to the fallback stereo case
Tanu Kaskinen [Fri, 8 Sep 2017 12:10:41 +0000 (15:10 +0300)]
alsa-mixer: add mixer handling to the fallback stereo case

Some sound cards don't have any alsa-lib configuration, but they used to
work well enough up to PulseAudio 10. PulseAudio 11 stopped using "hw:0"
for the analog-stereo mapping, and instead defined it as a fallback
mapping without any mixer handling. As a result, switching between
headphones and speakers stopped working without changing the mixer
settings manually at least on Toshiba Chromebook 2. This patch adds the
mixer handling back to the fallback mapping.

I also renamed "unknown-stereo" to "stereo-fallback", because I like
that name more.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102560
7 years agosink: remove priority bonus for the "internal" form factor
Tanu Kaskinen [Wed, 6 Sep 2017 13:08:29 +0000 (16:08 +0300)]
sink: remove priority bonus for the "internal" form factor

We're supposed to prioritize USB sound cards over PCI sound cards, but
the priority bonus for the "internal" form factor prevents this from
happening. Not all (if any) USB sound cards have the form factor
property set, whereas at least on my laptop the on-board sound card has
the form factor set to "internal".

7 years agosink, source: fix out of date comments
Tanu Kaskinen [Sun, 10 Sep 2017 19:32:57 +0000 (22:32 +0300)]
sink, source: fix out of date comments

update_shared_real_volume() doesn't exist. I checked that
update_real_volume() does what the comments claim
update_shared_real_volume() to do.

7 years agosink, source: don't try to update volumes of not-yet-linked devices
Tanu Kaskinen [Sun, 10 Sep 2017 19:32:56 +0000 (22:32 +0300)]
sink, source: don't try to update volumes of not-yet-linked devices

The order of the pa_sink_input_put() and pa_sink_put() calls in filter
modules was swapped in commit edc465da77 ("virtual sources and sinks:
Don't double attach a sink input or source output on filter load").
If flat volumes and volume sharing is enabled, the pa_sink_input_put()
call will update volumes of the whole tree of virtual sinks that are
connected to the root sink. The recursive updating procedure tried to
also update the volume of the new sink for which pa_sink_put() had not
yet been called, causing an assertion failure.

This patch tries to make sure that the volume of not-yet-linked sinks
is never changed. pa_sink_put() will set the sink volume correctly, so
it's fine to skip the not-yet-linked sinks during pa_sink_input_put().

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102549
7 years agobluetooth: Fix build warnings 76/149176/1 accepted/tizen/unified/20170914.230148 submit/tizen/20170912.051952 submit/tizen/20170914.073859
DoHyun Pyun [Tue, 12 Sep 2017 00:58:55 +0000 (09:58 +0900)]
bluetooth: Fix build warnings

Change-Id: I0411938d904f64b6e7bd7a13a044b1d553ad9251
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
7 years agoupdate NEWS v11.0
Tanu Kaskinen [Tue, 5 Sep 2017 09:10:29 +0000 (12:10 +0300)]
update NEWS

7 years agobluez5-device: lower sink/source priority for Audio gateway or a2dp source
Georg Chini [Sat, 2 Sep 2017 19:46:04 +0000 (21:46 +0200)]
bluez5-device: lower sink/source priority for Audio gateway or a2dp source

When a phone is connected via bluetooth and switches to HFP, the sinks
and sources will have higher priority than the built-in devices.
Therefore they are chosen as default and module-bluetooth-policy will
incorrectly insert loopback modules that loop the phone back to itself.

This patch fixes the problem by lowering the priority of sink and source
if PulseAudio is in the headset role. The priority is also lowered if the
device is an a2dp source. In both cases it does not make sense to make the
source or sink default unless there is no other sound device available.

7 years agocore: ignore devices that are not linked when choosing the default sink or source
Tanu Kaskinen [Wed, 30 Aug 2017 18:51:15 +0000 (21:51 +0300)]
core: ignore devices that are not linked when choosing the default sink or source

Sources should probably be added to pa_core.sources in pa_source_put(),
but currently they're added in pa_source_new(). A lot of stuff can
happen between the pa_source_new() and pa_source_put() calls, and
it has happened that the default source was updated during this time.
Therefore, pa_core_update_default_source() needs to take it into account
that not every source is necessarily linked.

7 years agoi18n: add a Norwegian Nynorsk translation
Karl Ove Hufthammer [Thu, 17 Aug 2017 11:15:09 +0000 (14:15 +0300)]
i18n: add a Norwegian Nynorsk translation

7 years agotunnel-{sink, source}-new: Fix assertion when used with loopback or combine-sink
Georg Chini [Sat, 12 Aug 2017 20:29:26 +0000 (22:29 +0200)]
tunnel-{sink, source}-new: Fix assertion when used with loopback or combine-sink

Currently pulseaudio crashes with an assertion in pa_rtpoll_item_new_asyncmsgq_read()
or pa_rtpoll_item_new_asyncmsgq_write() if a loopback is applied to a tunnel-new
sink or source, because tunnel-{sink,source}-new do not set thread_info.rtpoll.
The same applies to module-combine-sink and module-rtp-recv.

This patch is not a complete fix for the problem but provides a temporary band-aid
by initializing thread_info.rtpoll properly. The rtpoll created is never run, but
loopback and combine-sink nevertheless work, see comments in the code.

This patch does not work for module-rtp-recv, but using rtp-recv with a remote
sink does not seem to make a lot of sense anyway.

link: https://bugs.freedesktop.org/show_bug.cgi?id=73429
7 years agoi18n: update the Lithuanian translation
Moo [Tue, 15 Aug 2017 05:41:59 +0000 (08:41 +0300)]
i18n: update the Lithuanian translation

7 years agoUpdate rw upgrade script 95/143595/1
Seungbae Shin [Thu, 10 Aug 2017 11:41:14 +0000 (20:41 +0900)]
Update rw upgrade script

[Version] 5.0-124
[Issue Type] RW Upgrade

Change-Id: Id6eb863a90e39f4777cf499baf27aec58247bdc6

7 years agofixup! Apply ASLR 97/143297/1 accepted/tizen/4.0/unified/20170828.221808 accepted/tizen/unified/20170809.135531 submit/tizen/20170809.082250 submit/tizen_4.0/20170828.100007
Seungbae Shin [Wed, 9 Aug 2017 08:17:33 +0000 (17:17 +0900)]
fixup! Apply ASLR

[Version] 5.0-123
[Issue Type] Cleanup

Change-Id: I8ba3dffc37314c5a2015422476a91c5223baa608

7 years agoconf-parser: provide a replacement for scandir on Win32
Vadim Troshchinskiy [Fri, 4 Aug 2017 13:05:31 +0000 (15:05 +0200)]
conf-parser: provide a replacement for scandir on Win32

PA builds fine on MinGW except for the use of the scandir function in
pulsecore/conf-parser.c, so I provided a Win32 implementation. With this
patch the latest code builds on Win32 without problems.

7 years agoecho-cancel: don't set latency range if the device doesn't support dynamic latency
Tanu Kaskinen [Thu, 3 Aug 2017 07:38:01 +0000 (10:38 +0300)]
echo-cancel: don't set latency range if the device doesn't support dynamic latency

pa_sink/source_set_latency_range() has an assertion that is triggered
when setting the latency range on a fixed latency device.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102020
7 years agoInstall LGPL licenes instead of GPL for util package 33/142233/1
Seungbae Shin [Thu, 3 Aug 2017 06:33:05 +0000 (15:33 +0900)]
Install LGPL licenes instead of GPL for util package

(only python script(qpaeq) is GPL licensed but not installed)

[Version] 5.0-122
[Issue Type] Cleanup

Change-Id: I12b0f752fe2be2bb115991ee2ee99deee8a3b427

7 years agoFix 'set but not used' build warning 27/141327/2 accepted/tizen/4.0/unified/20170816.010257 accepted/tizen/unified/20170801.054919 submit/tizen/20170731.062712 submit/tizen_4.0/20170811.094300
Seungbae Shin [Mon, 31 Jul 2017 03:56:48 +0000 (12:56 +0900)]
Fix 'set but not used' build warning

[Version] 5.0.121
[Issue Type] Cleanup

Change-Id: Ia9ddcc066f55c9015f5955e4002da2a1bb779968

7 years agosconv: Cleanup ARM NEON code 08/141308/1
Peter Meerwald [Wed, 16 Apr 2014 16:20:16 +0000 (18:20 +0200)]
sconv: Cleanup ARM NEON code

Fix compiler warning, code formatting

Change-Id: I480591aedc6ae265ac0f1a8a8b8c58483da976f3
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
7 years agomodules: Fix compiler warning comparing 0 with bool 07/141307/1
Peter Meerwald [Wed, 13 Jan 2016 22:52:11 +0000 (23:52 +0100)]
modules: Fix compiler warning comparing 0 with bool

modules/module-stream-restore.c: In function 'clean_up_db':
modules/module-stream-restore.c:2344:74: warning: comparison of constant '0' with boolean expression is always true [-Wbool-compare]
         pa_assert_se(entry_write(u, item->entry_name, item->entry, true) >= 0);

reported by Ubuntu gcc-6

Change-Id: Iac596a9bbf341040adc9b8012f6ea916f4787461
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
7 years agocore: Work around -Wlogical-not-parentheses warnings 05/141305/1
Peter Meerwald [Tue, 26 May 2015 21:35:10 +0000 (23:35 +0200)]
core: Work around -Wlogical-not-parentheses warnings

pulsecore/sink.c: In function 'pa_sink_put':
pulsecore/sink.c:648:53: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     pa_assert(!(s->flags & PA_SINK_DYNAMIC_LATENCY) == (s->thread_info.fixed_latency != 0));
                                                     ^

pulsecore/source.c: In function 'pa_source_put':
pulsecore/source.c:599:55: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     pa_assert(!(s->flags & PA_SOURCE_DYNAMIC_LATENCY) == (s->thread_info.fixed_latency != 0));
                                                       ^
rewrite expression to suppress warning:
!(x & MASK) == (y != 0)
<->
!(x & MASK) == !(y == 0)

Change-Id: Iba926986cc16d17f0d74e7ca58d987592dfa7ed7
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
7 years agopacat: fix a memory issue
Denis Shulyaka [Sun, 30 Jul 2017 20:40:19 +0000 (23:40 +0300)]
pacat: fix a memory issue

If only part of the buffer is written into stdout by stdout_callback,
the buffer_index variable is increased by the number of written bytes,
buffer_length variable is decreased while the allocated buffer size
remains the same. That suggests that the current allocated size is
calculated as (buffer_index + buffer_length). However the current
stream_read_callback implementation writes new data to the start of the
buffer and allocates too little space, so that (buffer + buffer_index +
buffer_length - 1) could actully point outside of the allocated buffer.

7 years agoi18n: update Polish translation
Piotr DrÄ…g [Tue, 25 Jul 2017 15:26:06 +0000 (17:26 +0200)]
i18n: update Polish translation

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

7 years agobuild-sys: add coverity/model.c to the tarball v10.99.1
Tanu Kaskinen [Mon, 24 Jul 2017 23:27:31 +0000 (02:27 +0300)]
build-sys: add coverity/model.c to the tarball

7 years agobuild-sys: bump sonames
Tanu Kaskinen [Mon, 24 Jul 2017 22:47:58 +0000 (01:47 +0300)]
build-sys: bump sonames

7 years agosimple: fix negative latency handling
Tanu Kaskinen [Tue, 11 Jul 2017 18:21:43 +0000 (21:21 +0300)]
simple: fix negative latency handling

pa_usec_t is an unsigned type, but there were calculations that used it
as if it were a signed type.

If the latency is negative, pa_simple_get_latency() now reports 0.

Added some comments too.

7 years agosimple: Change latency estimation to account for already-read data in pa_simple_get_l...
Ted Ying [Thu, 1 Jun 2017 22:00:20 +0000 (18:00 -0400)]
simple: Change latency estimation to account for already-read data in pa_simple_get_latency().

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81075
7 years agolog: Do not print thread name in case of dlog 76/139776/1 accepted/tizen/unified/20170724.020311 submit/tizen/20170721.075214
Sangchul Lee [Thu, 20 Jul 2017 08:57:47 +0000 (17:57 +0900)]
log: Do not print thread name in case of dlog

[Version] 5.0.120
[Issue Type] Logs

Change-Id: Iab60d9dbc98a82cd2163689745ee4b48e0212f42
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
7 years agoprotocol-native: fix bytes-to-usec conversion of "on-the-fly" data
Tanu Kaskinen [Tue, 11 Jul 2017 18:16:17 +0000 (21:16 +0300)]
protocol-native: fix bytes-to-usec conversion of "on-the-fly" data

The on_the_fly_snapshot variable contains the amount of bytes that has
been sent from the source IO thread to the main thread, but not yet
pushed to the stream memblockq. The data is in the stream format, but
the bytes-to-usec conversion used the source format, which caused random
latency reporting errors.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81075
7 years agocore: change configured_default_sink/source type to string
Tanu Kaskinen [Thu, 29 Jun 2017 21:09:34 +0000 (00:09 +0300)]
core: change configured_default_sink/source type to string

This allows us to restore the default device properly when a
hotpluggable device (e.g. a USB sound card) is set as the default, but
unplugged temporarily. Previously we would forget that the unplugged
device was ever set as the default, because we had to set
configured_default_sink to NULL to avoid having a stale pa_sink pointer,
and also because module-default-device-restore couldn't resolve the name
of a currently-unplugged device to a pa_sink pointer.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89934
7 years agofix dbus message leaks
Tanu Kaskinen [Mon, 3 Jul 2017 14:35:08 +0000 (17:35 +0300)]
fix dbus message leaks

I reviewed all places that call
dbus_connection_send_with_reply_and_block(), and found several places
where dbus messages aren't properly unreffed.

7 years agosolaris: Support building on GNU Hurd
David Michael [Sun, 4 Jun 2017 03:53:48 +0000 (20:53 -0700)]
solaris: Support building on GNU Hurd

7 years agoman: fix typo: "the" -> "they"
Tanu Kaskinen [Wed, 12 Jul 2017 16:56:09 +0000 (19:56 +0300)]
man: fix typo: "the" -> "they"

7 years agoman: fix typos: "my" -> "may"
Tanu Kaskinen [Wed, 12 Jul 2017 16:44:38 +0000 (19:44 +0300)]
man: fix typos: "my" -> "may"

7 years agoman: fix a copy-paste error
Tanu Kaskinen [Wed, 12 Jul 2017 15:35:24 +0000 (18:35 +0300)]
man: fix a copy-paste error

7 years agobluez5-device: Log subband count instead of subband flag
Grzegorz Kolodziejczyk [Mon, 12 Jun 2017 15:42:26 +0000 (17:42 +0200)]
bluez5-device: Log subband count instead of subband flag

As log information says, SBC log info have to have one of two subband count
values: 4 or 8, instead of subband flag.

7 years agofilter-apply: Add "autoclean_interval" module argument 45/137245/2 accepted/tizen/unified/20170717.021035 submit/tizen/20170713.021221
Sangchul Lee [Wed, 5 Jul 2017 05:04:09 +0000 (14:04 +0900)]
filter-apply: Add "autoclean_interval" module argument

Now it is possible to set interval time of "autoclean" behavior.
Deafult time is 10 seconds which is the same as before.

[Version] 5.0.119
[Issue Type] New feature

Change-Id: I30d11b4e7a735ba37a7c1983c6ab7944721641aa
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
7 years agoSwitch -ldl to support ASan build 53/88253/4 accepted/tizen/unified/20170706.193611 submit/tizen/20170705.123628
Slava Barinov [Thu, 15 Sep 2016 12:58:18 +0000 (15:58 +0300)]
Switch -ldl to support ASan build

Change-Id: I046e37e2cbdb349cd8cef6df5191c7d5193cfe06
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoi18n: update the Ukrainian translation
Yuri Chornoivan [Sun, 25 Jun 2017 19:30:55 +0000 (22:30 +0300)]
i18n: update the Ukrainian translation

7 years agoRevert "bluetooth: Auto recover if profile is 'off'"
Tanu Kaskinen [Tue, 13 Jun 2017 16:02:37 +0000 (19:02 +0300)]
Revert "bluetooth: Auto recover if profile is 'off'"

This reverts commit 69c212f8c13794f70899d1fe6baec1b6e3c92032.

Reasons:

The original reason for the patch was to work around some issue
regarding the profile not connecting immediately (sorry, I don't really
know the details), but that issue was fixed later by commit 998dfdf4cc,
so the original reason doesn't apply any more.

Automatically changing the profile when the transport state changes to
PLAYING has traditionally been handled by module-bluetooth-policy, and
as far as I can tell, there's no reason to change that.

The assertion is unsafe. It's not guaranteed that the profile change
will always succeed (at least pa_thread_mq_init() can fail due to
reaching the maximum file descriptor limit).

7 years agoloopback: apply official patchset 60/133660/1 accepted/tizen/unified/20170627.071444 submit/tizen/20170626.070954
KimJeongYeon [Tue, 13 Jun 2017 04:27:05 +0000 (13:27 +0900)]
loopback: apply official patchset

PulseAudio 10.0
Georg Chini (8):
      loopback: Save time stamps during latency snapshots
      loopback: Improve latency estimation in snapshots
      loopback: Improve latency estimation
      loopback: Change memblockq length
      loopback: Move timer restart and snapshots to timer callback
      loopback: Restart timer after 1/3 second
      loopback: Adjust rate based on latency difference
      loopback: Stop tracking max_request and min_memblockq_length

PulseAudio 9.0
Tanu Kaskinen (24):
      loopback: refactor proplist updating

PulseAudio 8.0
Georg Chini (2):
      loopback: Validate the rate parameter

PulseAudio 7.0
Alexander E. Patrakov (4):
      module-loopback: don't use 0 for custom source output message id
      loopback: Fix the obviously-wrong "buffer+=buffer" logic

PulseAudio 6.0
Georg Chini (1):
      loopback: Don't push zero-sized block to memblockq

Note for tizen:
1) These patchset improve latency and fix many other bugs of module-loopback.
2) Applied up to PulseAudio 10.0 release except 'loopback: refactor proplist updating'.
   (commit: 95dd90ce06046fb574e4a2174545bdebeb7c460d)
   Because, pa_{sink_input|source_output}_set_property() aren't exist in this code base.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: Ia4044d4fc74d72e37f181331eeb6be05355e0048

7 years agoi18n: update the Italian translation
Milo Casagrande [Thu, 8 Jun 2017 11:30:59 +0000 (13:30 +0200)]
i18n: update the Italian translation

Signed-off-by: Milo Casagrande <milo@milo.name>
7 years agopadsp: Write only frame-aligned chunks to the stream
Arun Raghavan [Thu, 1 Jun 2017 07:01:47 +0000 (16:01 +0900)]
padsp: Write only frame-aligned chunks to the stream

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

7 years agoalsa: make priority of the port headset-mic higher than headphone-mic
Hui Wang [Thu, 25 May 2017 03:10:33 +0000 (11:10 +0800)]
alsa: make priority of the port headset-mic higher than headphone-mic

There are two reasons for this change:

1. If it is a Dell desktop machine with the realtek codec, and there
is no internal microphone on it, there is one physical audio jack
which can support headphone, headset and microphone, but this audio
jack does not have hardware capability to distinguish what is plugged
in, after users plug in a headphone and select headphone from UI
program, the headphone can't output any sound. There are many reasons
for this issue, one of them is the active_port of pa_source is set
to headphone-mic, that means the kernel audio driver will configure
this audio jack to be a microphone jack instead of headphone jack.
If we make the priority of headset-mic a bit higher than headphone-mic,
the headset-mic will be the active_port of pa_source unless users
select the headphone-mic on purpose, then this issue will be fixed.

2. Nowadays, the headset is more popular than traditional microphone,
It is highly possible that users plug in a headset instead of
microphone, it makes sense to make the headset-mic's priority higher
than headphone-mic's.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
7 years agostream-restore: Ignore sink-inputs/source-outputs that connect a filter to the master
Georg Chini [Wed, 31 May 2017 18:54:43 +0000 (20:54 +0200)]
stream-restore: Ignore sink-inputs/source-outputs that connect a filter to the master

module-stream-restore primarily uses the role of a stream for restoring. The sink-inputs
and source-outputs of filters all have role "filter", therefore currently all filters are
treated equally and are restored to the same device and volume.

This patch lets module-stream-restore ignore the streams that connect the filter to the
master.

link: https://bugs.freedesktop.org/show_bug.cgi?id=100065
7 years agoFix build warnings 51/131151/6 accepted/tizen/unified/20170531.082625 submit/tizen/20170526.083733
Seungbae Shin [Thu, 25 May 2017 12:51:00 +0000 (21:51 +0900)]
Fix build warnings

Additionally, replaced some remaing words "zero pop" with "empty pop" for clear meanings

[Version] 5.0.118
[Profile] Common
[Issue Type] Clean up

Change-Id: I15f714d5a4c8fe731a428441987b7d2dcd46d2fd

7 years agoladspa-sink: dbus implementation for tizen 18/71818/17
KimJeongYeon [Fri, 27 May 2016 07:45:19 +0000 (16:45 +0900)]
ladspa-sink: dbus implementation for tizen

Use system bus instead of protocol-dbus.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: I26e89b160cf90cf52c96af42d61964aa2d5b5f82

7 years agomodule-filter-apply: Fix a memory leak 98/128498/3
KimJeongYeon [Wed, 10 May 2017 08:04:43 +0000 (17:04 +0900)]
module-filter-apply: Fix a memory leak

Dynamic memory allocated to 'module_name' and 'fltr' was being leaked.
Its now freed properly before return.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=95293
Signed-off-by: Sachin Kumar Chauhan <sachin.kc@samsung.com>
Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=a19e1e5382ca9c193d9fa33356465b040f55a672

filter-apply: fix typo "what" -> "want"

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=71b128aaeabfdb0b5845ef062d8ddfd56baa77a8

Note for tizen:
The purpose of these patches is that sync code with upstream.

Change-Id: I0a8e2de2312752520e868c0dc0e84fa31bd12a00

7 years agofilter-apply: Do not re-route stream to master sink/source when manually moved to... 41/125541/14
KimJeongYeon [Wed, 10 May 2017 07:32:41 +0000 (16:32 +0900)]
filter-apply: Do not re-route stream to master sink/source when manually moved to filter

Currently, if a stream is manually moved to a filter sink or source managed by
module-filter-apply, the stream will be silently re-routed to the master sink
or source, because the filter.apply property is not set on that stream. We can
assume, that the users intention however was to have the stream filtered.

Therefore this patch changes the logic, so that the stream will not be moved
to the master but remains on the filter sink or source. To handle the change
of a property correctly, the filter.apply property must be set temporarily.
An additional property filter.apply.set_by_mfa was introduced to mark those
streams, so that filter.apply can be removed again when the stream moves away
from the filter.

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?h=next&id=b8858ff24d03dcd0828db529d455e3b2d2493b98

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: Id9072d92038f3806ff39f9d539c3229cb358afbf

7 years agofilter-apply: Add ability to pass parameters to a filter module 03/125103/2
KimJeongYeon [Thu, 13 Apr 2017 23:06:36 +0000 (08:06 +0900)]
filter-apply: Add ability to pass parameters to a filter module

Currently passing parameters to a filter loaded by module-filter-apply is
not possible.

To enable passing parameters to a filter this patch uses an additional property
filter.apply.{MODULE_NAME}.parameters. This way, filters like virtual-surround-sink
and ladspa-sink are fully supported. For example:
paplay file.wav --property=filter.apply=ladspa-sink \
                --property=filter.apply.ladspa-sink.parameters="plugin=ladspa \
                  label=ladspa_stereo control=0"

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=caabff2728d9d588664f8a0ea2f8441804c8b91a

Note for tizen:
Proplist 'filter.apply.extra.parameters' and 'filter.apply.extra.group' are removed.
Also, their names are modified as below.
1) 'filter.apply.extra.group' to 'filter.apply.{MODULE_NAME}.group'
2) 'filter.apply.extra.parameters' to 'filter.apply.{MODULE_NAME}.parameters'
For example:
paplay file1.wav --property=filter.apply=ladspa-sink \
                 --property=filter.apply.ladspa-sink.group=group1 \
                 --property=filter.apply.ladspa-sink.parameters="plugin=ladspa1 \
                   label=ladspa_stereo control=0"
paplay file2.wav --property=filter.apply=ladspa-sink \
                 --property=filter.apply.ladspa-sink.group=group2 \
                 --property=filter.apply.ladspa-sink.parameters="plugin=ladspa2 \
                   label=ladspa_stereo control=0"

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: Ia1c85aca2be1f7f4328674146e5caa5e78f5e536

7 years agoMerge "ladspa-sink: Add sink_master argument to enable filter-apply to load the modul...
youngseok lee [Fri, 26 May 2017 05:33:29 +0000 (05:33 +0000)]
Merge "ladspa-sink: Add sink_master argument to enable filter-apply to load the module" into tizen

7 years agoMerge "virtual-surround-sink: Add sink_master argument to enable filter-apply to...
youngseok lee [Fri, 26 May 2017 05:32:06 +0000 (05:32 +0000)]
Merge "virtual-surround-sink: Add sink_master argument to enable filter-apply to load the module" into tizen

7 years agoMerge "filter-apply: Fix memory leak in process()" into tizen
youngseok lee [Fri, 26 May 2017 05:30:24 +0000 (05:30 +0000)]
Merge "filter-apply: Fix memory leak in process()" into tizen

7 years agoi18n: update the French translation
Tanu Kaskinen [Mon, 22 May 2017 07:06:29 +0000 (10:06 +0300)]
i18n: update the French translation

These changes are from fedora.zanata.org. The authors are
Sam Friedmann <sfriedma@redhat.com>
Wim Taymans <wim.taymans@gmail.com>
Edouard Duliege <edouard.duliege@gmail.com>

7 years agoi18n: Updated Turkish translation
Muhammet Kara [Sat, 20 May 2017 08:20:00 +0000 (11:20 +0300)]
i18n: Updated Turkish translation

7 years agosink-input, source-output: don't allow moving streams that are connected to moving...
Tanu Kaskinen [Mon, 8 May 2017 09:58:49 +0000 (12:58 +0300)]
sink-input, source-output: don't allow moving streams that are connected to moving filter devices

When a filter sink is moving, it's not connected to any master sink, and
therefore it's not connected to any IO thread either. In this situation
trying to move a stream that is connected to the filter sink is likely
to result in crashing, because starting the move involves sending a
message to the IO thread. Sometimes this works by accident (the
asyncmsgq of the filter sink still points to the old master sink's
asyncmsgq), but we really should never attempt it. This patch blocks all
moves where the moving stream is connected to a filter sink that itself
is in the middle of a move.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100277
7 years agosink/source: Don't update default sink/source before calling PA_CORE_HOOK_{SINK,SOURC...
Georg Chini [Thu, 18 May 2017 05:47:27 +0000 (07:47 +0200)]
sink/source: Don't update default sink/source before calling PA_CORE_HOOK_{SINK,SOURCE}_PUT

In sink_put() and source_put(), pa_core_update_default_{sink,source}() was called
before the PA_CORE_HOOK_{SINK,SOURCE}_PUT hook. Therefore module-switch-on-connect
could not correctly determine the old default sink/source if no user default was
set and a sink/source with higher priority than any other sink/source turned up.

This patch corrects the problem by swapping the order of the hook call and the
pa_core_update_default_sink() call.

Additionally it corrects a problem in module-switch-on-connect. If, after the
change above, the new sink/source was the first sink/source to appear, pulseaudio
would crash because module-switch-on-connect assumed that the default sink/source
was not NULL. The patch checks if the default sink/source is NULL and only sets
the new default sink/source in that case.

7 years agovirtual sources and sinks: Don't double attach a sink input or source output on filte...
Georg Chini [Thu, 18 May 2017 05:46:46 +0000 (07:46 +0200)]
virtual sources and sinks: Don't double attach a sink input or source output on filter load

When a filter is loaded and module-switch-on-connect is present, switch-on-connect
will make the filter the default sink or source and move streams from the old
default to the filter. This is done from the sink/source put hook, therefore streams
are moved to the filter before the module init function of the filter calls
sink_input_put() or source_output_put(). The move succeeds because the asyncmsq
already points to the queue of the master sink or source. When the master sink or
source is attached to the sink input or source output, the attach callback will call
pa_{sink,source}_attach_within_thread(). These functions assume that all streams
are detached. Because streams were already moved to the filter by switch-on-connect,
this assumption leads to an assertion in pa_{sink_input,source_output}_attach().

This patch fixes the problem by reverting the order of the pa_{sink,source}_put()
calls and the pa_{sink_input,source_output}_put calls and creating the sink input
or source output corked. The initial rewind that is done for the master sink is
moved to the sink message handler. The order of the unlink calls is swapped as well
to prevent that the filter appears to be moving during module unload.

The patch also seems to improve user experience, the move of a stream to the filter
sink is now done without any audible interruption on my system.

The patch is only tested for module-echo-cancel.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=100065
7 years agovirtual sinks and sources: Revert commits
Georg Chini [Thu, 18 May 2017 05:46:08 +0000 (07:46 +0200)]
virtual sinks and sources: Revert commits

This patch reverts commit db4fbb0121a2577d786cda023a6a439a9734f152 and
3bb94c4e836ca765a36255e416fd8e6cf272ab44. They were the wrong approach
to fix the bug (and did not fix it anyway).

7 years agosink, source: update the default sink/source on port switches
Tanu Kaskinen [Sun, 7 May 2017 09:12:39 +0000 (12:12 +0300)]
sink, source: update the default sink/source on port switches

When sinks are compared during the default sink selection, the active
port's availability is inspected. Therefore, the default sink should be
updated when the active port changes, because the new port may have
different availability status than the old port.

For example, let's say that a laptop has an analog sink with a speaker
and a headphone port, and headphones are initially plugged in, so both
ports can be used[1]. The headphone port is initially the active port.
There's also a null sink in the system. When the headphones are
unplugged, the headphone port becomes unavailable, and the null sink
becomes the new default sink. Then module-switch-on-port-available
changes the analog sink port to speakers. Now the default sink should
change back to the analog sink, but that doesn't happen without this
patch.

[1] Actually we currently mark speakers as unavailable when headphones
are plugged in, but that's not strictly necessary. My example relies on
both ports being available initially, so the bug can't be reproduced
with the current mixer configuration.

7 years agoi18n: update the Croatian translation
muzena [Thu, 27 Apr 2017 13:06:46 +0000 (15:06 +0200)]
i18n: update the Croatian translation

7 years agosink-input: Enhance PCM dump 19/125419/3
Jungsup Lee [Mon, 17 Apr 2017 07:08:04 +0000 (16:08 +0900)]
sink-input: Enhance PCM dump

PCM dump is not correct if one or more sink-input hasn't pcm data enough when sink request pcm data
In this case, PCM dump file should be rewound when pa_sink_input_drop is called

[Version] 5.0.117
[Profile] Common
[Issue Type] Enhancement

Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
Change-Id: I42cb75c6e058a186d0b761583b87bcd46361bdfb

7 years agoladspa-sink: Add sink_master argument to enable filter-apply to load the module 04/123404/4
KimJeongYeon [Thu, 13 Apr 2017 22:45:00 +0000 (07:45 +0900)]
ladspa-sink: Add sink_master argument to enable filter-apply to load the module

Currently, module-filter-apply cannot load module-ladspa-sink because filter-apply
provides the argument "sink_master" but ladspa-sink expects "master" instead.

Therefore this patch adds the sink_master argument to module-ladspa-sink.

Additionally, the autoloaded argument was also added.

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=145da09aca8b54d611999ebf661b05ceb9e1c62f

ladspa-sink, virtual-surround-sink: fix master sink argument handling

The old code worked incorrectly in several situations. For example,
trying to use the "master" argument wouldn't work, because if
"sink_master" wasn't specified, pa_namereg_get() would pick the default
sink as the master sink.

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=65f7ca44148e8c79fa965a6ecbc889e3f9668178

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: I15382f0f2551bcd2d3bcb9bf117914ed2cc3e5ff

7 years agovirtual-surround-sink: Add sink_master argument to enable filter-apply to load the... 00/123400/4
KimJeongYeon [Thu, 13 Apr 2017 22:41:22 +0000 (07:41 +0900)]
virtual-surround-sink: Add sink_master argument to enable filter-apply to load the module

Currently, module-filter-apply cannot load module-virtual-surround-sink because filter-apply
provides the argument "sink_master" but virtual-surround-sink expects "master" instead.

Therefore this patch adds the sink_master argument to module-virtual-surround-sink.

Additionally, the autoloaded argument was also added.

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=ba4de85b530d91f5f7d81f3bf29a0ae8bc60b04e

ladspa-sink, virtual-surround-sink: fix master sink argument handling

The old code worked incorrectly in several situations. For example,
trying to use the "master" argument wouldn't work, because if
"sink_master" wasn't specified, pa_namereg_get() would pick the default
sink as the master sink.

This patch based on:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=65f7ca44148e8c79fa965a6ecbc889e3f9668178

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: I25b328ffd308e09c6082ed39ec4aa299a56422bf

7 years agobluez5-device: Correctly handle suspend/resume cyle for audio gateway role of ofono...
Georg Chini [Thu, 4 May 2017 11:14:51 +0000 (13:14 +0200)]
bluez5-device: Correctly handle suspend/resume cyle for audio gateway role of ofono backend

When the ofono backend released a tranport during suspend of sink or source, the
transport state was not changed to IDLE. Therefore pa_bluetooth_transport_set_state()
would return immediately when trying to resume. Even though the transport was acquired
correctly, setup_stream() would never be called and the resume failed.

This patch sets the transport state to IDLE when the transport is released. On resume,
the first call to transport_acquire() will be done from the message handler of the
*_SET_STATE message when source or sink are set to RUNNING. This call will only request
the setup of the connection, so setup_stream() cannot be called.
When the transport changes the state to PLAYING in hf_audio_agent_new_connection(),
handle_transport_state_change() is called. Because the sink or source state is already
RUNNING, the pa_{source,sink}_suspend() call will not lead to a state change message
and the I/O thread must be signaled explicitely to setup the stream.

The first setup of the device would also fail, which was only visible when the profile
was restored after connecting the headset. When trying to restore the headset_head_unit
profile, the profile was shortly set to off, so the headset always returned to a2dp.

This patch allows a delayed setup for the headset_head_unit profile, so that the profile
can successfully be restored.

7 years agobluetooth: ofono: Fix failing to parse valid NewConnection
Luiz Augusto von Dentz [Thu, 4 May 2017 11:12:59 +0000 (13:12 +0200)]
bluetooth: ofono: Fix failing to parse valid NewConnection

When suspending due to idle timeout the transport will not change its
state, also in case the fd is closed due to POLLERR/POLLHUP events
the release shall check if the fd is still set otherwise it will fail
to be acquired again.

7 years agobluetooth: ofono: Close fd if cannot be accepted
Luiz Augusto von Dentz [Thu, 4 May 2017 11:11:27 +0000 (13:11 +0200)]
bluetooth: ofono: Close fd if cannot be accepted

Always close fd that cannot be accepted otherwise it will be left open
without being attached to any transport.

7 years agobluetooth: Auto recover if profile is 'off'
Luiz Augusto von Dentz [Thu, 4 May 2017 10:58:54 +0000 (12:58 +0200)]
bluetooth: Auto recover if profile is 'off'

This means something went wrong, which in case of ofono backend it is
probably due to the profile not connecting immediately, but it can be
safely restored in that case the transport is playing which means the
profile has recovered connectivity.

7 years agobluetooth: Don't default to native backend
Luiz Augusto von Dentz [Thu, 4 May 2017 10:53:32 +0000 (12:53 +0200)]
bluetooth: Don't default to native backend

The native backend is limited to HSP only which may not work with devices
that can only do HFP so if oFono is enabled it shall be used as default.

7 years agobluetooth: ofono: Detect if Connect has been called
Luiz Augusto von Dentz [Thu, 4 May 2017 10:52:18 +0000 (12:52 +0200)]
bluetooth: ofono: Detect if Connect has been called

This detects if profile has already been called and we are waiting
the response.

7 years agobluetooth: ofono: Fix asserting when connecting as AG
Luiz Augusto von Dentz [Thu, 4 May 2017 10:51:00 +0000 (12:51 +0200)]
bluetooth: ofono: Fix asserting when connecting as AG

Check the card Type property instead of assuming ofono would only be used
for HF role.