Commit graph

6418 commits

Author SHA1 Message Date
Frédéric Danis
017e1c4dda bluetooth: Fix bluetooth.nrec property not updated
PropertyChanged signal of org.BlueZ.MediaTransport is processed in
pa_bluetooth_transport_parse_property() which updates t->nrec.
This is called by :
- First by filter_cb() of bluetooth-util.c
- Then by filter_cb() of module-bluetooth-device.c which retrieve value
  of t->nrec before calling parse function, then it checks if t->nrec
  has changed before updating bluetooth.nrec property.
  As t->nrec has alreday been changed during first process, property
  update is never performed.

This patch creates a new hook in pa_bluetooth_transport called
PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED.
The hook is fired by bluetooth-util.c when the transport's NREC
property changes.
module-bluetooth-device.c won't listen the PropertyChanged signal of
MediaTransport anymore. Instead, it will use the hook in
pa_bluetooth_transport to get a notification when the NREC property
changes, and update the sink or source proplist accordingly.

const qualifier for returned pointer of
pa_bluetooth_discovery_get_transport() is removed.
2012-06-15 21:06:01 +03:00
Arun Raghavan
a91359956f auth: Create cookie directory if it doesn't exist
Makes sure the cookie directory exists before trying to create the
cookie. This might be the case on freshly installed headless systems.
2012-06-13 16:37:21 +05:30
Arun Raghavan
59968f8e2c core-util: Make pa_make_secure_dir() act like mkdir -p
This makes pa_make_secure_dir() create any missing parent directories in
the given path as well. This is useful, for example, on a pristine
system with a clean $HOME that needs ~/.config/pulse/ to be created when
~/.config does not exist.
2012-06-13 16:37:20 +05:30
Arun Raghavan
b942af65fe core-util: Add a pa_split_in_place() string utility function
For specialised uses of pa_split() such as finding substrings for
comparison, this avoids the need to repeatedly allocate and deallocate
memory.
2012-06-13 16:37:20 +05:30
Arun Raghavan
51c8d5a477 role-cork: Fix a minor leak 2012-06-13 16:37:20 +05:30
Tanu Kaskinen
9b4332eca4 native: Don't save device, volume or mute of new streams.
Specifying the volume when creating a new stream is not an
equivalent act as setting the volume with a volume control
application. When creating a new stream, stream-restore
shouldn't save the volume, but when changing the volume,
then saving it is ok. For example, when I say
"paplay --volume=10000 somefile.wav", I mean that I want the
new stream to have volume 10000. I don't mean that also
future paplay invocations (without the --volume option)
should have that same volume.

This patch effectively reverts
546bcf3f2f.
2012-06-11 12:32:44 +03:00
Arti Trivedi Bora
8fb63dd6e4 daemon: use pa_streq instead of strcmp 2012-06-09 16:23:18 +03:00
Arti Trivedi Bora
41ee562140 tests: use pa_streq instead of strcmp 2012-06-09 16:22:39 +03:00
Arti Trivedi Bora
96a52257a9 pulsecore: Use pa_streq instead of strcmp. 2012-06-09 16:22:13 +03:00
Arti Trivedi Bora
e5954aca8e modules: Use pa_streq instead of strcmp. 2012-06-09 16:21:41 +03:00
Tanu Kaskinen
e0c16af551 device-port: Remove an out-of-date comment. 2012-06-08 19:00:14 +03:00
poljar
e7b077681b bluetooth: Add ports to the bluetooth sink/source
The bluetooth device should have ports so we can attach a latency to
the ports.

Every profile (a2dp, hsp...) has his own set of ports depending on the
number of sinks and sources it provides.
2012-06-08 16:30:01 +03:00
Tanu Kaskinen
de95e1c0c8 device-port: Create the profiles hashmap at initialization.
I doesn't make sense to require all callers of
pa_device_port_new() to create the hashmap themselves. There
are and there will be no cases where a port without any
profiles would be desired.
2012-06-08 16:28:22 +03:00
Deng Zhengrong
866b2c9a57 x11: fix the wrong parameter sequence in pax11publish 2012-06-08 16:44:22 +05:30
poljar
23432d39ee pacmd: Add unloading modules by name.
pacmd should allow unloading modules by name.
The command_unload() function was expanded to handle names while
unloading modules.

If there are multiple modules with the same name all
of them will be unloaded.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48289
2012-06-04 19:02:53 +03:00
poljar
48f4c8ab8f pactl: Add unloading modules by name.
pactl should allow unloading modules by name.

If there are multiple modules with the same name all
of them will be unloaded.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48289
2012-06-04 18:31:42 +03:00
Eero Nurkkala
fdfea553fd alsa-source: add missing header 'signal.h'
Compilation with -DDEBUG_TIMING fails due to a missing header:

modules/alsa/alsa-source.c: In function 'check_left_to_record':
modules/alsa/alsa-source.c:426:9: warning: implicit declaration of function 'raise' [-Wimplicit-function-declaration]
modules/alsa/alsa-source.c:426:9: error: 'SIGTRAP' undeclared (first use in this function)

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2012-05-31 14:25:27 +02:00
Eero Nurkkala
79c0d52a39 alsa-sink: add missing header 'signal.h'
Compilation with -DDEBUG_TIMING fails due to a missing header:

modules/alsa/alsa-sink.c: In function 'check_left_to_play':
modules/alsa/alsa-sink.c:453:9: warning: implicit declaration of function 'raise' [-Wimplicit-function-declaration]
modules/alsa/alsa-sink.c:453:9: error: 'SIGTRAP' undeclared (first use in this function)

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2012-05-31 14:25:23 +02:00
Harsh Prateek Bora
13c7a55599 pulsecore: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
2012-05-31 14:12:36 +02:00
Harsh Prateek Bora
f38c1e9bf9 modules: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
2012-05-31 14:12:33 +02:00
Jarkko Suontausta
0236977408 bluetooth: Release transport when the pa_rtpoll_run loop finishes.
Based on a patch by Marko Ollonen.
2012-05-29 09:24:27 +05:30
Marc-Antoine Perennou
54718450df udev: Don't use deprecated udev_get_*_path() functions
[These symbols were removed in libudev.so.1.0.0. Replace them with
hardcoded strings. -- heftig]

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2012-05-29 09:17:18 +05:30
Peter Meerwald
77e73be925 pipe: check return value of mkfifo() 2012-05-29 09:03:15 +05:30
Peter Meerwald
c87fd823ea pipe: whitespace and log output cleanup 2012-05-29 09:03:11 +05:30
Deng Zhengrong
9be176f403 daemon: use pa_streq instead of plain strcmp
Just noticed that in daemon-conf.c, it uses plain strcmp(),
while in PulseAudio, it should be better to use pa_streq().
2012-05-29 08:47:40 +05:30
Deng Zhengrong
9d40957c79 cli: Add set-log-target command for pacmd 2012-05-29 08:35:58 +05:30
David Henningsson
1ba655560d once: Fix race causing pa_once to sometimes run twice
There was a race in the existing code that could cause the pa_once code
to be run twice, see:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013354.html

Therefore the existing implementation was rewritten to instead look like
the reference implementation here:
http://www.hpl.hp.com/research/linux/atomic_ops/example.php4

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-05-25 10:50:37 +02:00
poljar
4c65e58325 native: Use foreach to iterate trough modules.
The PA_IDXSET_FOREACH is easier to read than the standard for loop.
Also pa_streq() should be used for checking string equality.
2012-05-23 06:34:25 +03:00
Frédéric Danis
21b1d92b79 bluetooth: Fix crash on disconnection
When a Bluetooth headset is connected only to HFP profile (not connected
to A2DP) and host streams to it, a crash occurs if host disconnects.

When HFP disconnects, audio thread will fail on POLLHUP then generate
a message to set PA profile to Off before ending.
If this message is managed before PA unload bluetooth device module,
all works fine.
But, if this message is managed during module unload, this finish by
re-entrance in release code (stop_thread) and a crash.

This fix prevents to process profile change when module is unloading.
2012-05-16 06:26:00 +03:00
Lennart Poettering
1a6c9dc0a4 gnome: start PA early in the gnome session 2012-05-16 01:06:17 +02:00
Lennart Poettering
87ae830705 auth: move cookie file to ~/.config/pulse/cookie
In order to follow XDG basedir, read the cookie file from
~/.config/pulse/cookie if possible, but fall back to the old file.
if it doesn't exist.
2012-05-15 23:59:33 +02:00
Lennart Poettering
9ab510a692 core-util: when searching for configuration files, honour XDG basedir spec 2012-05-15 23:25:00 +02:00
Lennart Poettering
4bc865ad6e man: update man pages to only refer to the new place for the configuration files 2012-05-15 23:24:28 +02:00
Lennart Poettering
4c195bcc9d core-util: move configuration home directory from ~/,pulse to ~/.config/pulse to follow XDG basedir spec
If ~/.pulse/ already exists we stick to it in order not to lose
configuration and so that pulse configuration may still be shared across
the network with different PA versions.
2012-05-15 23:13:28 +02:00
Lennart Poettering
7fad67c461 util: hook up pa_get_runtime_dir() with XDG_RUNTIME_DIR 2012-05-15 19:06:53 +02:00
Lennart Poettering
3e9cd3cfcf context: get rid of really old runtime dir logic, i.e. break compat with >4y-old PA 2012-05-15 16:24:22 +02:00
Lennart Poettering
c50cffc016 rtkit: update drop-in files 2012-05-15 16:08:40 +02:00
Lennart Poettering
77c5901df2 build-sys: remove HAL support, it's obsolete since years 2012-05-15 16:06:42 +02:00
Lennart Poettering
08d4f8e2c3 build-sys: readd stub makefiles to subdirectories to make building with emacs easier 2012-05-15 14:17:58 +02:00
Lennart Poettering
bea524cb7a util: use the return value of gethosid() as fallback, not the address of the function
Yikes!
2012-05-15 14:13:19 +02:00
Lennart Poettering
10f146ddc8 util: /etc/machine-id should be tried first, the D-Bus only as fallback for legacy systems 2012-05-15 14:13:19 +02:00
Lennart Poettering
3173358f76 proplist: document new meaning of the session ID 2012-05-15 14:06:46 +02:00
Lennart Poettering
8a55219599 util: XDG_SESSION_COOKIE is unsuitable as session ID
XDG_SESSION_COOKIE was supposed to be used for access control to the
session and should not be exposed to other users.

Replace usage of XDG_SESSION_COOKIE by XDG_SESSION_ID which is the right
choice here since it is actually a proper session ID that may be
published.
2012-05-15 14:04:31 +02:00
Arun Raghavan
8f540c6e76 sink-input,source-output: Avoid unneccessary rate updates
This makes sure we only call sink/source update_rate() if the stream
being woken up has a sample spec that doesn't match the corresponding
device'.

https://bugs.freedesktop.org/show_bug.cgi?id=49875
2012-05-14 12:29:13 +05:30
poljar
d85360e65c pacmd: Added --help and --version descriptions to the man page.
The pacmd man page should show the available options. A simple
description for the --version and --help option was added.
2012-05-13 19:39:23 +03:00
Arun Raghavan
ed85ad64cf build-sys: Bump soname
Double-bump since v1.99.2 got a bump but the commit never landed.
2012-05-11 18:51:37 +05:30
Paul Menzel
e54b0fa6c9 Correct spelling of PulseAudio
• s,Pulseaudio,PulseAudio,
• One last occurence of this “error” is in the French translation.
2012-05-11 18:25:36 +05:30
Arun Raghavan
ec316b04ac bluetooth: Fix crash due to usage of pa_bool_t instead of dbus_bool_t
pa_bool_t and dbus_bool_t cannot be used interchangably since their size
might (and do) vary. This caused a crash on some systems which was
reported and root caused by: Aidan Thornton <makosoft@googlemail.com>.

Ref: https://bugs.gentoo.org/show_bug.cgi?id=398097
2012-05-11 17:32:20 +05:30
Tanu Kaskinen
7bb8442c11 alsa: Add support for sound cards with 4-channel input.
Changes in v2:
 - Call the mapping a generic 4-channel input mapping
   instead of a 4-channel mic array mapping. The mapping
   will be used also by sound cards that have two stereo
   input jacks, so in those cases talking about mic arrays
   is wrong.
 - Added a comment about using the "hw" device name.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45813
2012-05-11 16:55:29 +05:30
Tanu Kaskinen
1eb7c4a465 resampler: Add support for resamplers that consume less data than asked.
libsamplerate_resample() assumed that src_process() would
always consume the whole input buffer. That was an invalid
assumption leading to crashes.

This patch adds a leftover memchunk for storing any
non-consumed input. When pa_resampler_run() is called next
time, the leftover is prepended to the new input.

Changes in v3:
 - Make the calculations in pa_resampler_result() and
   pa_resampler_max_block_size() more readable and more
   correct.
 - Rework the leftover storing: instead of using a dedicated
   buffer for it, store it in the beginning of remap_buf.
   This can avoid some memory copying. (The idea was
   suggested by Wang Xingchao.)
 - Use a generic save_leftover() function instead of doing
   the leftover copying in the resampler implementation.
 - Use the leftover logic also with the speex and ffmpeg
   resamplers.
   [ed: dropped the speex bit since the API guarantees that
    it will consume everything -- Arun]

Changes in v2:
 - If add_leftover() is called with zero-length input while
   the leftover length is non-zero, we don't try to acquire
   the input memblock.
 - Instead of taking a reference to the original input in
   libsamplerate_resample(), we copy the leftover data to a
   new memblock. This is done, because otherwise, if the
   input is one of the internal buffers, the data can get
   overwritten before reading it in add_leftover().
 - Store add_leftover_buf size in bytes instead of samples
   (more convenient, but less consistent with other code).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=47156
2012-05-11 16:29:20 +05:30