Commit graph

7827 commits

Author SHA1 Message Date
Tanu Kaskinen
f48c16113a shell-completion: zsh: Fix set-default-sink/source completion
The _devices() function didn't recognize the set-default-* commands,
and as a result it didn't generate any completions.
2014-11-14 14:24:10 +02:00
David Henningsson
9ae85b1a29 bluetooth: Select headset backend through module argument
This patch adds a module argument "headset=ofono|native|auto" to
module-bluetooth-discover and module-bluez5-discover.

To make Arun's happy, the default is 'native' if compiled in, otherwise
'ofono'. 'Auto' will try to autoswitch depending on whether ofono is
running or not.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
David Henningsson
d63305f103 bluez 5: remove null headset backend
There is no need to have a "null" backend anymore.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
David Henningsson
5f6cb5872b bluez 5: Fix a debug message
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
David Henningsson
aea3518569 bluez 5: Load the native headset backend if the oFono one is unavailable
This implements some autodetect if both headset backends are compiled in:
First we try to contact the oFono service, if that's not working,
then we start the native backend instead.

Likewise if the oFono service is going offline/online, we load/unload
the native backend accordingly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
David Henningsson
1ffede3c85 bluez 5: Build both headset backends, if available
Enable both ofono and native backends to be built into the same
libbluez5-util. Never build the null backend.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-14 11:44:33 +01:00
Andrey Semashev
807c98a37d resampler: Fix sample_format_more_precise() for the case of comparing against PA_SAMPLE_S32BE
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-12 23:17:08 +01:00
Tanu Kaskinen
8a7d78b4ae .gitignore: Add pulseaudio.service 2014-11-12 14:55:45 +02:00
Tanu Kaskinen
4f4ed3d11a build-sys: Fix a variable value check 2014-11-12 14:48:58 +02:00
Mauro Guerrera
5445d17c36 build-sys: Fix daemon linking when building with systemd-daemon support
Seems that after commit 467b4b9be systemd usage has been added into
src/daemon/main.c but there is no link for the corresponding
library in the final pulseaudio binary.

This might be missed in some build systemd due to overlinking,
but it's correct to add this in here explicitly

Signed-off-by: Colin Guthrie <colin@mageia.org>
2014-11-10 18:19:30 +00:00
David Henningsson
b3fa929a87 rtpoll: Fixup pa_rtpoll_run
Commit fa092af59c removed an argument to pa_rtpoll_run, but
forgot to remove that argument for all callers to pa_rtpoll_run.

This commit removes the remaining ones.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-10 14:15:39 +01:00
Peter Meerwald
fa092af59c rtpoll: Drop extra wait_op argument to pa_rtpoll_run()
is always true, not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:53:06 +01:00
Peter Meerwald
2638591497 rtpoll: Fix condition for DEBUG_TIMING output
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:53:02 +01:00
Peter Meerwald
b5b4a1078c mix: Length over all chunk has already been computed by the caller
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:39:24 +01:00
Peter Meerwald
3963fc5e5b mix: pa_mix() is always called with more than one steam
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:39:03 +01:00
Peter Meerwald
ea5cbec0b7 iochannel: Remove unnecessary zero-initialization
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:38:29 +01:00
Peter Meerwald
8bbdae0ae8 alsa: Precompute maximum frames per block
frames_per_block is the mempool's maximum block size in frames

v2 (thanks David Henningson)
* rename max_frames to frames_per_block

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:36:39 +01:00
Peter Meerwald
101092465d core: Replace assert()s with pa_assert()s
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:14:33 +01:00
Peter Meerwald
59334021d3 log: Cleanup
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:14:02 +01:00
Peter Meerwald
b9aafdd736 mix: Make use of pa_cvolume_is_norm/muted() macros
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:13:34 +01:00
David Henningsson
aec811798c alsa-mixer: Add support for "Headphone+LO" and "Speaker+LO"
These two control names are currently being added to the HDA driver,
so let's support them in PulseAudio as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-11-06 16:29:48 +01:00
Peter Meerwald
8ce2bfa4d0 pstream: Duplicate assignment, write.data is always NULL
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-06 10:20:05 +01:00
Peter Meerwald
7bb708d953 asyncmsgq: Drop weird assert
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-06 10:15:13 +01:00
Peter Meerwald
70973d58e6 resampler: Drop pointless remix variable
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-06 10:12:39 +01:00
Peter Meerwald
6d1fd4d1aa pactl: Remove deprecated 'stat' behaviour
the stat command should only output statistics, not info

behaviour was deprecated anno 2011 in 8ace9185 "pactl: Make stat backwards
compatible" -- fix this now

v2: (thanks Tanu Kaskinen):
* adjust shell completion

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-04 22:22:19 +01:00
Peter Meerwald
31d5acdc78 rtpoll: typo
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-04 21:57:48 +01:00
Colin Guthrie
bdbc561619 build-sys: Minor cosmetic tidyup of configure summary 2014-11-03 12:32:23 +00:00
Colin Guthrie
7276faca72 launch: Disable autospawn by default when systemd daemon support is enabled.
When enabled, this method is prefered over pulseaudio's built in
systems so we should try our best to ensure that it cannot be spawned
outside of the mechanisms desired.

Packagers should call 'systemctl --global enable pulseaudio.socket' to
enable the socket for all users, or alternatively ship an enabling
symlink in /usr/lib/systemd/user/sockets.target.wants/ folder. It may
also make sense for distributions to add in a ConditionNNN= line to the
socket unit if they have a downstream mechanism for enabling or
disabling pulseaudio.

If individual users wish to opt out of this vendor (or administrator)
decision, they can call 'systemctl --user mask pulseaudio.socket'
2014-11-03 12:32:23 +00:00
Colin Guthrie
e542e81004 launch: Add systemd units for launching pulseaudio user instances 2014-11-03 12:32:23 +00:00
Colin Guthrie
42156d2b5a launch: Avoid specifically starting PA and rely on autospawn/socket activation
This --start is patched out in several downstreams to allow users to easily
disable PA by simply disabling autospawn.

If autospawn is enabled, then the first pactl command will start it and if not
it will fail and the script will exit.

When switching to systemd socket activation, we very much do not want to
start PA manually here. We could replace it with a
  systemctl --user start pulseaudio
but really it just makes sense to rely on the socket activation as this
should apply equally to non-systemd setups which use PA's own autospawn.
2014-11-03 12:32:23 +00:00
Colin Guthrie
467b4b9bee socket-server: Add support for systemd socket activation.
This adds support to module-native-protocol-unix to take over already
listening sockets passed in via socket activation (e.g. from systemd)

Most of the code is isolated to socket-server but some cleanup code also
had to be tweaked to ensure we do not overzealously close open fds.
2014-11-03 12:32:23 +00:00
Colin Guthrie
fb1ca6f0c1 build-sys: Add support for newer systemd without compatibility libs
In newer versions of systemd some libraries were combined for the sake of
general simplicity.

This change checks against the newer name first and avoids separate pkgconfig
checks if it's found. We probably want to keep support for the older library
names for some time. systemd does allow for the shipping of compatibility
pkgconfig files to not break downstream code like ourselves which is why this
likely hasn't been "fixed" until now.

With this change we no longer rely on systemd having been built with those
compatibility pkgconfig files.
2014-11-03 12:32:23 +00:00
Colin Guthrie
f7da58b73f build-sys: Clarify some systemd sub-component variable/define names.
We currently use the term SYSTEMD when referring to libsystemd-login
and JOURNAL when referring to libsystemd-journal.

I will be shortly adding support for libsystemd-daemon and in
preparation I figured it would be a good idea to clarify the names
used currently before adding another!
2014-11-03 12:32:23 +00:00
Colin Guthrie
e775529167 man: Fix XDG_RUNTIME_DIR variable reference. 2014-11-03 12:32:23 +00:00
Tanu Kaskinen
9b87baf58a socket-server: Improve readability 2014-11-03 11:23:25 +02:00
Sjoerd Simons
66f97c35bd alsa-mixer: Disable line-out if headphone jack is plugged
Line-out gets muted when headphones are plugged in on HDA cards, encode
this in the line-out path so pulse can match that state.
2014-11-03 08:52:09 +01:00
Tanu Kaskinen
717834086c alsa-mixer: Ignore some elements in the analog-output path
The analog-output path should be suppressed when there are more
specific paths available. Currently that usually doesn't happen. The
suppression can be done with the path subset detection, and this patch
makes that work (another approach would be to mark the elements as
required-absent, like analog-input does, but I like the subset
suppression more, because it requires less stuff in the configuration
files). The problem with listing the now-removed elements in
analog-output.conf was that if the sound card had e.g. a Speaker
element, then the switch behaviour was different between analog-output
and analog-output-speakers, so analog-output was not considered a
subset of analog-output-speakers.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=74609
2014-10-31 14:30:22 +02:00
Arun Raghavan
5dfa83385c bluetooth: Fix some native backend command sending
We weren't writing out one character from the "OK" response, and the
"AT" part of the "+VGS" and "+VGM" commands was missing. Also, the spec
says that the command is terminated by only a CR and not an LF (probably
doesn't hurt, but let's adhere to the spec for now).
2014-10-31 10:47:56 +05:30
Wim Taymans
34a5c754a9 backend-native: implement volume control
Parse the gain changed AT commands from the headset and fire 2 new
hooks as a result. The device will connect to those hooks and change the
source/sink volumes.

When the source/sink volume changes, set the gain on the microphone or
speaker respectively. Make sure we do nothing if the transport can not
handle the gain changes.
2014-10-31 10:46:10 +05:30
Wim Taymans
7d4a497b3d backend-native: add a new native headset backend
Add a simple native headset backend that implements support for the
blutooth HSP profile.
This allows pulseaudio to output audio to a Headset using the HSP profile.

Make the native backend the default.
2014-10-31 10:46:10 +05:30
Wim Taymans
d7199bafea bluez5-util: add destroy function
Add a destroy function to the transport that is called before freeing
the transport. Useful for cleaning up extra userdata.
2014-10-31 10:46:10 +05:30
Wim Taymans
2251085dda bluez5-device: use get_profile_direction
Use the get_profile_direction() helper function to decide when to add a
source and a sink instead of enumerating profiles.
2014-10-31 10:46:10 +05:30
Arun Raghavan
8718496d14 creds: Rename pa_ancil to pa_cmsg_ancil_data
Makes the purpose of the structure clearear.
2014-10-31 10:46:10 +05:30
Peter Meerwald
72e5671ece tests: Be careful with data types to avoid cast
use unsigned and size_t for counters and packet length, resp.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
974fd3bcfd tests: Make global variables static in srbchannel-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
b7e763bab4 alsa-sink: Check for after-avail is redundant
after-avail is always false at this point

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
e798969fd5 modules: Fix )== typos
add a space between ) and ==

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
ab37729147 mainloop: Fix typo
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
f390e6e974 Cleanup !! for bool
!!x makes no sense if x is bool (this is a leftover from the
convertion pa_bool_t -> bool, d806b197)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:22 +01:00
Peter Meerwald
3fb349296f Remove link to CIA from README
cia.navi.cx/stats/project/polypaudio does not exist anymore,
see http://cia.vc/

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-10-28 17:36:21 +01:00