Commit graph

8757 commits

Author SHA1 Message Date
Colin Leroy
937b3769b3 raop: Init dummy port and card for latency change
This adds a port, card and profile to RAOP sinks to make it
possible to change the latency at runtime (and have it persist)
using pavucontrol or pactl set-port-latency-offset.

Also move the IP:port part of the sink name to the port name.
2017-10-11 18:34:30 +03:00
Colin Leroy
77c1226181 raop: Show device codename in sink properties
This will make it easier for testers to report latency offset for their
specific hardware.
2017-10-11 18:15:05 +03:00
Peter Meerwald-Stadler
cbc4424821 core: Fix gcc-7 -Wimplicit-fallthrough= warnings by rearranging comment
'Fall through.' must appear separately

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:40:03 +02:00
Peter Meerwald-Stadler
78f964d605 core: Fix typo and gcc-7 -Wimplicit-fallthrough= warnings
Correct spelling of 'through' in a comment helps to fix a warning :)
also drop some unrelated comments

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:40:00 +02:00
Peter Meerwald-Stadler
6f065f9589 core: Fix gcc-7 -Wimplicit-fallthrough= warnings
the comment /* Fall through. */ fixes the warning, but gcc-7 seems to be more
picky about the position in the code

pulsecore/sink-input.c: In function ‘pa_sink_input_update_proplist’:
pulsecore/sink-input.c:1531:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             for (state = NULL; (key = pa_proplist_iterate(i->proplist, &state));) {
             ^~~
pulsecore/sink-input.c:1539:9: note: here
         case PA_UPDATE_REPLACE: {
         ^~~~

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:39:57 +02:00
Peter Meerwald-Stadler
0f94657cd0 raop: Fix typo
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:39:54 +02:00
Peter Meerwald-Stadler
a39098fe4d raop: Fix gcc-7 warnings, EWOULDBLOCK
EAGAIN is used allover the code rather than EWOULDBLOCK
POSIX allows EAGAIN and EWOULDBLOCK to have the same value (and in fact it is)
don't check for EWOULDBLOCK

modules/raop/raop-client.c: In function ‘send_udp_audio_packet’:
modules/raop/raop-client.c:473:41: warning: logical ‘or’ of equal expressions [-Wlogical-op]
     if (written < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
                                         ^~
modules/raop/raop-client.c: In function ‘resend_udp_audio_packets’:
modules/raop/raop-client.c:528:45: warning: logical ‘or’ of equal expressions [-Wlogical-op]
         if (written < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
                                             ^~

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:39:52 +02:00
Peter Meerwald-Stadler
d911dd48ce bluetooth: bluez5: Fix Coverity warning
Use pa_assert_se() to check return value (pro forma) like everywhere else

Coverity ID: #154313

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:39:49 +02:00
Peter Meerwald-Stadler
bba8c350a5 json-test: Fix Coverity warning
Cosmetic resource leak in test code

Coverity ID: #1454314

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
2017-10-09 10:39:45 +02:00
Colin Leroy
ff49f0a5c1 raop: add latency value for Shairport RAOP server
After testing, Shairport server's latency is the same as Pioneer N30.
2017-10-08 21:14:26 +03:00
Salvador Fandino
07e283d744 build-sys: simulate ln -s correctly on Windows
make install was failing on Windows because there cp is
used to replace ln -s commands but cp doesn't resolve its
first argument as relative to the second one.

This patch changes the install-bashcompletion-aliases rules
to chdir to the target dir so that cp works correctly. This
is the solution recomended in the automake documentation.
2017-10-07 22:16:07 +03:00
Salvador Fandino
8c22cd54de ladspa-sink: fix Windows compilation
The macro LADSPA_PATH was defined as a list of directories quoted but
without taking into account that the directory names, specially on
Windows, can contain backslashes that need escaping.

This patch removes the quoted from the macro and uses the C preprocessor
to quote it properly using a helper macro.
2017-10-07 22:14:34 +03:00
Salvador Fandino
79ee19bb51 proplist-util: fix compilation on Windows without NLS
Under MinGW, LC_MESSAGES is defined in libint.h which is not
included when pulseaudio is configured with nls disabled.

LC_MESSAGES is referenced when setting PA_PROP_APPLICATION_LANGUAGE.

This patch just disables setting that property when ENABLE_NLS
is not defined.
2017-10-07 21:59:17 +03:00
David Henningsson
5c7b543cb7 switch-on-port-available: Add some basic properties
Apparently I forgot about this for like, five years, but better
late than never!

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-10-03 17:50:27 +03:00
Tanu Kaskinen
d1fa269216 thread-mq: create event on the right mainloop
It seems that the intention was to create create write_thread_event on
thread_mainloop instead of main_mainloop (the first parameter of
io_new() is thread_mainloop, io_free() is called on thread_mainloop
etc.).

As long as both mainloops are implemented with pa_mainloop, this bug has
no effect on behaviour, because the io_new() implementation is the same.
And indeed, with the current code base both mainloops are always
pa_mainloops. However, when the tunnel-new modules switches to pa_rtpoll
as the pa_mainloop_api provider, this bug would cause problems.
2017-10-03 17:20:32 +03:00
Kristian Klausen
184c28795b alsa-mixer: Prioritize hdmi-* mappings over iec958-* mappings
Pulseaudio tries to pick the best profile (on startup or
hotplugged), the best profile is the profile with the highest
priority which isn't unavailable.
Due to the facts that iec958 ports available status always (?)
is unknown, and that it is generally more likely that a user use
hdmi than iec958, lets prioritze hdmi over iec958.

This patch shift the analog-* mappings +5 and hdmi-* mappings +5.
2017-10-01 21:03:39 +03:00
Colin Leroy
d8a2cef360 RAOP: Announce real latency
Use predefined values depending on the server, and make it configurable.
AirPlay is supposed to have 2s of latency. With my hardware, this is
more 2.352 seconds after numerous tests.
Switch from pausing/resuming the smoother to resetting it because the
smoother got stuck returning the same value after an idle/running cycle,
making latency calculation wrong.
2017-09-21 16:47:43 +03:00
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