Commit graph

8640 commits

Author SHA1 Message Date
Tanu Kaskinen
61217528a1 qpaeq: change license from AGPL to LGPL v2.1
This removes one unnecessary exception in the PulseAudio licensing
terms. In December 2016 I asked permission from all qpaeq contributors
for the license change, and all gave the permission. I have archived the
emails here:
https://www.freedesktop.org/software/pulseaudio/misc/qpaeq_relicensing_emails.txt
2017-09-19 21:29:44 +03:00
Tanu Kaskinen
e116c9630e LICENSE: fix typo 2017-09-19 17:24:31 +03:00
Cheng-Chia Tseng
65c14c3e3d i18n: update the Chinese (Taiwan) translation 2017-09-19 16:46:21 +03:00
Tanu Kaskinen
2693e3fe55 update NEWS 2017-09-18 18:49:34 +03:00
Arun Raghavan
b6bba65d62 bluez: Don't crash on strange MTU sizes
We got reports of this with automatically detected MTUs that weren't
frame aligned.
2017-09-18 18:49:34 +03:00
Arun Raghavan
82e7fe413e 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
2017-09-18 18:49:34 +03:00
Tanu Kaskinen
56b6e32535 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
2017-09-18 18:49:34 +03:00
Tanu Kaskinen
bd151646dd 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".
2017-09-18 18:49:34 +03:00
Tanu Kaskinen
f63c13f62f 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.
2017-09-18 18:49:34 +03:00
Tanu Kaskinen
95d618751c 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
2017-09-18 18:49:34 +03:00
Felipe Sateler
24928d6b6f launch: avoid autostarting pulseaudio systemd units for root
The autospawn mechanism already had a root-autospawn protection mechanism. When
using systemd that was lost. Systemd 234 has a mechanism to conditionalize unit starting
on the running user, so lets do that to protect against root autospawning.
2017-09-09 16:37:39 +03:00
Russell Treleaven
675a407a0e build-sys: make bootstrap.sh fail if autopoint or intltoolize are not available 2017-09-09 16:25:26 +03:00
Arun Raghavan
703d95fd00 always-source: Fix pa_module_load() usage
The API changed slightly since the original patch was written.
2017-09-05 13:46:27 +03:00
Pierre-Louis Bossart
15d28f21b4 sink: force suspend/resume on passthrough transitions
A race condition prevents the AES non-audio bit from being set
when enabling IEC61937 passthrough on resume with no sink-input
connected (pa_sink_is_passthrough returns false). The non-audio
bit should really be set when opening the sink.

Force the sink to suspend/resume when actually entering passthrough
mode, and likewise force a suspend-resume on leaving passthrough mode.

Tested with E-AC3 streams which do need the AES bit set for my
Onkyon receiver to detect the format instead of playing it as
PCM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-05 13:46:27 +03:00
Sebastian Dröge
b4d2443249 Implement module-always-source
This is basically a copy of module-always-sink but doing the same for
sources. Whenever no source is available, a module-null-source is loaded
and whenever a new source is available again, module-null-source is
unloaded.

By this, anything using a source will automatically be switched to the
null source when the actual source disappears, and back to the actual
source if it appears again.
2017-09-05 13:46:27 +03:00
Tanu Kaskinen
c7fe78c9f7 build-sys: add the Arctis configuration 2017-09-05 13:46:27 +03:00
Tanu Kaskinen
9c7a9be7cd bluetooth: recognize another HSP HS UUID
There are actually two HSP HS UUIDs. My theory is that the second one
was added, because someone was not happy with the old UUID being used
for identifying two different things (the HSP profile as a whole, and
the HS role within the HSP profile). Some headsets only use the new
UUID, and those headsets won't work if we don't recognize the new UUID.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93898
2017-09-05 13:46:27 +03:00
Johan Heikkilä
15386a710c alsa-mixer: add support for Steelseries Arctis 7 headset 2017-09-05 13:46:27 +03:00
Ian Ray
739a4b3d23 alsa-mixer: round, not truncate, in to_alsa_dB
to_alsa_dB() returns a result rounded to two decimal places (instead of
using integer truncation) to avoid small errors when converting between
dB and volume.

Consider playback at -22 dB (which is supported by ALSA) but results in
the higher level of -21 dB plus software attenuation.

    pa_sw_volume_from_dB(-22) = 28172
    pa_sw_volume_to_dB(28172) = -21.9997351
    to_alsa_dB(-21.9997351)   = -2199

    ALSA value 106 = -2200
    ALSA value 107 = -2100
    ...

    rounding = +1  /* "accurate or first above" */
    snd_mixer_selem_ask_playback_dB_vol(me, -2199, rounding, &alsa_val)
    alsa_val = -2100

Signed-off-by: Ian Ray <ian.ray@ge.com>
2017-09-05 13:46:27 +03:00
Colin Leroy
f0dfddead3 cli-command: don't exit on "module already loaded" errors
Some modules may only be loaded once, and trying to load them
twice from default.pa makes PulseAudio startup fail. While that could
be considered a user error, it's nicer to not be so strict. It's not
necessarily easy to figure what went wrong, if for example the user
plays with RAOP and adds module-raop-discover to default.pa, which first
works fine, but suddenly stops working when the user at some point
enables RAOP support in paprefs. Enabling RAOP in paprefs makes
module-gconf load the module too, so the module gets loaded twice.

This patch adds a way to differentiate module load errors, and
make cli-command ignore the error when the module is already
loaded.
2017-09-05 13:46:27 +03:00
Tanu Kaskinen
1a66715320 main: set umask to 077 instead of 022
It was reported that PulseAudio weakens the umask to 022 if it's
initially set to 077. That's not as big problem as it might seem,
but it's still a problem. The umask affects the permissions of the state
files, and those aren't readable by other users anyway in the per-user
mode, because PulseAudio puts them in directories that aren't
accessible to other users. In the system mode the state files will be
readable by everyone, though, even by those users that don't otherwise
have access to PulseAudio. The state files are slightly
privacy-sensitive, because they contain e.g. history of applications
that have used PulseAudio.

I can't think of any use cases where access to the state files by other
users would be necessary, either in the per-user mode or in the system
mode, so let's use umask 077. This doesn't prevent access to any
sockets in the system mode, because all directories that PulseAudio
creates in the system mode will have permissions 755 regardless of the
umask, and the sockets themselves always have permissions 777.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102060
2017-09-05 13:46:27 +03:00
Tanu Kaskinen
95404ce3f3 cli-command: unload modules synchronously
Users may want to change the parameters of some load-once modules in
~/.config/pulse/default.pa. That should be possible by including
/etc/pulse/default.pa from the per-user configuration file, and then
unloading a module and reloading it with different parameters. However,
that doesn't work, because the unload-module command will not unload the
module immediately, so the subsequent load-module command will fail when
the module can be loaded only once.

This patch makes the module unloading synchronous. "pacmd unload-module
module-cli-protocol-unix" is something that might not like this change,
since the command will unload the code that is processing the command,
but I tested it and it works fine. When pa_module_unload() is called,
that won't yet remove the module code from memory, the lt_dlclose() call
is postponed until it's safe to remove the code from memory.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102205
2017-09-05 13:46:27 +03:00
Tanu Kaskinen
5f27c2ec2f device-port, switch-on-port-available: fix automatic profile changing when current profile is off
module-switch-on-port-available didn't do anything when a port changes
its status if the card didn't have any sinks or sources. This was to
avoid bad things during card initialization, but the if condition also
prevented any profile switches away from the "off" profile, because the
card has no sinks or sources when the "off" profile is active.

pa_card nowadays has the "linked" flag that
module-switch-on-port-available could have checked instead, but since it
doesn't make sense to emit port status change events before the card has
been initialized, I added the check in pa_device_port_set_available()
instead.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=101794
2017-09-05 13:46:26 +03:00
Tanu Kaskinen
4e6d9e3214 build-sys: add iec958-stereo-input.conf to dist_alsapaths_DATA 2017-09-05 13:46:26 +03:00
Tanu Kaskinen
ec325304cd alsa-mixer: set PCM Capture Source for iec958 input
It was reported that on a certain USB card, identified as
"0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device",
the "PCM Capture Source" element had to be set to "IEC958 In" before
the iec958 input would work.

The iec958-stereo-input.conf file didn't exist before, although the path
was referenced in the default.conf profile configuration file.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=101973
2017-09-05 13:46:26 +03:00
Tanu Kaskinen
295d4db8cf raop: silence a Coverity complaint
CID: 1398155
2017-09-05 13:46:26 +03:00
Georg Chini
e03e01b089 bluez5-device: Set transport state correctly for AG role
When connecting a headset via the native backend, the transport state was
not updated correctly.

This patch sets the state to PLAYING in transport_acquire() if necessary.
2017-09-05 13:46:26 +03:00
Tanu Kaskinen
9e725ac3db equalizer-sink: update sink description when moving
If the description is not updated when moving, the old automatically
generated description will refer to the old master sink after the move,
which is not nice.
2017-09-05 13:46:26 +03:00
Georg Chini
1d29247ac7 loopback: Use new allow_negative flag of pa_{source, sink}_get_latency_within_thread()
Setting the allow_negative flag of pa_{source,sink}_get_latency_within_thread() to true
leads to improved end to end latency estimation and to correct handling of negative port
latency offsets.
2017-09-05 13:46:26 +03:00
Hui Wang
60c0edd528 alsa-mixer: Add support for usb audio in the Dell dock TB16
There are one headset jack on the front panel of TB16, through this
jack, we have one stereo headphone output (hw:%f,0,0) and one mono
headset-mic input (hw:%f,0,0); and there is one speaker output jack
(hw:%f,1,0) on the rear panel of TB16.

The detail information of the Dell dock TB16:
http://www.dell.com/support/article/sg/en/sgbsdt1/SLN301105

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2017-09-05 13:46:26 +03:00
Khem Raj
66885ad633 padsp: Make it compile on musl
break assumptions on glibc and there is no stat64 on non
glibc C libraries

See pulseaudio bug

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2017-09-05 13:46:26 +03:00
KimJeongYeon
46fb1b8c5d 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.
2017-09-05 13:46:26 +03:00
Tanu Kaskinen
f4e0a5685f NEWS: add GNU Hurd support
For some reason this was left out when copying the feature list from the
release notes.
2017-09-05 13:23:58 +03:00
Tanu Kaskinen
8db681606c update NEWS 2017-09-05 12:10:29 +03:00
Georg Chini
44d03c0a46 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.
2017-09-03 12:43:03 +03:00
Tanu Kaskinen
970b475a25 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.
2017-09-02 14:14:49 +03:00
Karl Ove Hufthammer
6921e08f60 i18n: add a Norwegian Nynorsk translation 2017-08-17 14:16:21 +03:00
Georg Chini
49ab711c28 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.

Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=73429
2017-08-17 11:40:17 +03:00
Moo
23f46f1d1c i18n: update the Lithuanian translation 2017-08-15 08:42:53 +03:00
Vadim Troshchinskiy
464b949059 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.
2017-08-05 06:49:25 +03:00
Tanu Kaskinen
3979fba0ac 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
2017-08-04 09:02:56 +03:00
Denis Shulyaka
7ebe7b8a35 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.
2017-07-31 04:41:10 +03:00
Piotr Drąg
c2dd53f79c i18n: update Polish translation
https://bugs.freedesktop.org/show_bug.cgi?id=101918
2017-07-26 00:50:01 +03:00
Tanu Kaskinen
d16600145f build-sys: add coverity/model.c to the tarball 2017-07-25 02:27:31 +03:00
Tanu Kaskinen
fff0b34347 build-sys: bump sonames 2017-07-25 01:47:58 +03:00
Tanu Kaskinen
5de4b652cb 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.
2017-07-20 16:56:41 +03:00
Ted Ying
b0cd94233a 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
2017-07-20 16:50:08 +03:00
Tanu Kaskinen
e7d7b29c17 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
2017-07-17 19:44:51 +03:00
Tanu Kaskinen
a448cc587c 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
2017-07-17 19:41:03 +03:00
Tanu Kaskinen
abdd14d5e0 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.
2017-07-17 19:29:21 +03:00