Commit graph

7584 commits

Author SHA1 Message Date
David Henningsson
48420b660a fdsem: Use atomic.h
The fdsem header uses pa_atomic_t, which is declared in atomic.h

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-22 16:31:57 +02:00
David Henningsson
6c42cfe324 fdsem: remove superfluous parameter in call to pa_fdsem_new_shm
This parameter was never assigned, so just remove it.

Note that the only current user of this function is shmasyncq.c,
which is unused - we don't even build it. But I fixed it up anyway.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-22 16:31:44 +02:00
Alexander Kurtz
43b6a67fa8 vala: Add bindings for libpulse-simple 2014-04-17 15:28:24 +03:00
Juho Hämäläinen
a306d66525 dbus: Use correct initialization for source ports hashmap.
Source ports hashmap is created without value freeing function, which
results in (hashmap values) device ports not being freed when source
ports are removed or module is unloaded. This results in memory leak
during normal operation and during daemon shutdown dbus_protocol shared
object isn't unreferenced correctly, leaving dbus_protocol object in
core->shared, which causes assert when shared hashmap is checked for
isempty() before freeing.
2014-04-17 11:13:01 +03:00
Tanu Kaskinen
7fac107301 doxygen: Enable GENERATE_DEPRECATEDLIST
This generates a list of deprecated things, which is accessible from
the table of contents frame. The list, however, isn't the important
thing here. The important thing is that this also prevents doxygen
from stripping all documentation for the deprecated things.

Previous discussion:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/18794
2014-04-17 10:53:49 +03:00
Niels Ole Salscheider
3064511df6 virtual-surround-sink: Move normalization heuristic to its own function
This patch also adds a description how the heuristic works and mentions that
there is a scaling factor that can be adjusted if there is audible clipping.
2014-04-17 10:46:26 +03:00
Tanu Kaskinen
eca082a93f Use pa_hashmap_remove_and_free() where appropriate 2014-04-17 10:06:23 +03:00
Tanu Kaskinen
14e2553185 hashmap: Add pa_hashmap_remove_and_free() 2014-04-17 10:02:42 +03:00
Peter Meerwald
36f775482f pactl: Clean up checking for VOL_RELATIVE flag
VOL_RELATIVE if a bit flag (1 << 4), hence we can simply do
    if (vol_flags & VOL_RELATIVE) ...
instead of
    if ((vol_flags & VOL_RELATIVE) == VOL_RELATIVE) ...

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:02:14 +02:00
Peter Meerwald
edaa028290 pactl: Document ability to specify channel volumes individually
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:02:02 +02:00
Peter Meerwald
930159d4c5 pactl: Check consistency of volumes specified
Must use one way to specify volumes consistently, e.g.
+3dB +3dB, mixing different ways is not allowed, such as
40% 1000

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:01:47 +02:00
Parin Porecha
fc9fdfaf7b pactl: Allow to set volume of each channel independently (Bug #39190)
Example: pactl set-sink-volume "sink_name" 32000 40000
If the number of volumes provided is different than the number of channels
(excluding the case where a single volume is provided), an error message
is displayed explaining why the volumes could not be set.

patch proposed by Parin Porecha
code refactoring and commit message slightly edited by Peter Meerwald
2014-04-16 00:01:37 +02:00
Peter Meerwald
997e369691 pactl: Stop parsing option when the first non-option is encountered
fix bug
https://bugs.freedesktop.org/show_bug.cgi?id=77108

see getopt(3):
""By default, getopt() permutes the contents of argv as it scans, so that
  eventually all the nonoptions are at the end.  Two other modes are also
  implemented.   If  the first character of optstring is '+' or the envi‐
  ronment variable POSIXLY_CORRECT is set, then option  processing  stops
  as soon as a nonoption argument is encountered.  If the first character
  of optstring is '-', then each nonoption argv-element is handled as  if
  it were the argument of an option with character code 1.  (This is used
  by programs that were written to expect options and other argv-elements
  in any order and that care about the ordering of the two.)  The special
  argument "--" forces an end of option-scanning regardless of the  scan‐
  ning mode.""

prepend optstring with '+' to use POSIXLY_CORRECT mode

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-15 23:53:13 +02:00
Peter Meerwald
3ad4857070 man: Fix typos in pulse-daemon.conf.5.xml.in
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-15 23:53:07 +02:00
David Henningsson
d3f2bfa21b pstream: Use pa_xnew0 in initialization
...for simplicity.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-15 11:52:22 +02:00
Alexander E. Patrakov
a5ba31bf96 Name HDMI outputs uniquely
On Haswell hardware, there are multiple HDMI outputs capable of
digital sound output. As they were identically named, KDE's control
center was unable to distinguish them, restored the wrong profile and
thus routed sound to the wrong HDMI monitor.

Also, having identically-named menu items in other mixer applications
looks like a bug.
2014-04-15 09:03:55 +02:00
David Henningsson
319a665ce8 module-switch-on-port-available: Use new find best port function
Now that we have a generic function in device-port.h, we can use
it instead of the custom one.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-04 07:28:34 +02:00
David Henningsson
06ad1b7a06 module-switch-on-port-available: Use port->card pointer
We now have a port->card pointer, we can use it instead of iterating
over cards to find the correct one.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-04 07:24:10 +02:00
David Henningsson
ef4a41e8b0 module-switch-on-port-available: Don't switch profiles on uninitialized cards
This could cause the HDMI port to become the default on some systems
where analog output was available.

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1256511
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=73375
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-04-04 07:24:09 +02:00
Tanu Kaskinen
b75a20db10 zeroconf-publish: Don't assume any particular defer event ordering
Also, initialize userdata with zeros to avoid invalid pointers in
client_free().

This fixes a crash when client_free() is called before
create_client(). The whole issue could be avoided by using some other
mechanism than defer events for running the two functions, but I'll
do that change later (I have also other cleanups planned for
zeroconf-publish).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76184
2014-03-28 15:08:24 +02:00
Tanu Kaskinen
1116daa5eb client-conf: Don't create multiple cookie files
The old code loaded cookies at the time of loading the client
configuration, which could lead to creation of multiple cookie files.
For example, when pa_client_conf_load() was called, the default cookie
file was created, and then if PULSE_COOKIE was set,
pa_client_conf_env() would create another cookie file.

This patch moves the loading of the cookie to a separate function,
which pa_context calls just before needing the cookie, so the cookie
won't be loaded from the default file if PULSE_COOKIE is set. This
patch also splits the single cookie and cookie_file fields in
pa_client_conf into multiple fields, one for each possible cookie
source. That change allows falling back to another cookie source if
the primary source doesn't work.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=75006
2014-03-28 14:59:10 +02:00
Tanu Kaskinen
0a583fe0c3 client-conf: Remove redundant function parameters 2014-03-28 14:58:14 +02:00
Tanu Kaskinen
aca30527e2 util: Check that the home dir is an absolute path
Avoid unpredictable behaviour in case e.g. the HOME environment
variable is incorrectly set up for whatever reason.

I haven't seen non-absolute HOME anywhere, but this feels like a good
sanity check anyway.
2014-03-28 14:54:58 +02:00
Tanu Kaskinen
e1440395d1 pactl: Fix crash with older servers
Servers older than 0.9.15 don't know anything about cards, and card
operations will return a NULL pa_operation object when connected to
that old server. We must check the pa_operation pointer before passing
it to pa_operation_unref(), otherwise a NULL operation will result in
a crash.
2014-03-28 14:49:07 +02:00
David Henningsson
e0e6bf6875 sink/source: Initialize port before fixate hook (fixes volume/mute not saved)
In case a port has not yet been saved, which is e g often the case
if a sink/source has only one port, reading volume/mute will be done
without port, whereas writing volume/mute will be done with port.

Work around this by setting a default port before the fixate hook,
so module-device-restore can read volume/mute for the correct port.

BugLink: https://bugs.launchpad.net/bugs/1289515
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-03-28 10:59:03 +01:00
Tanu Kaskinen
633bc529e2 introspect: Use pa_direction_valid() to validate port direction
There's no behavioral change, just nicer code.
2014-03-27 10:02:57 +02:00
Tanu Kaskinen
b9147fad0f direction: Add a couple of direction helper functions 2014-03-27 10:02:57 +02:00
Wim Taymans
5621b7898b device-restore: log restored mute state
Log the mute state as it was restored
2014-03-26 17:15:26 +02:00
Peter Ujfalusi
3c73e2130f alsa-util: Reset hwparams_copy before the second try of buffer setup
hwparams_copy needs to be reset (as it is also reset for the third and
fourth try) before the second try.

If the reset is not done and the first try fails:
D: [lt-pulseaudio] alsa-util.c: Maximum hw buffer size is 743 ms
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_period_size_near() failed: Invalid argument
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
D: [lt-pulseaudio] alsa-util.c: Set only period size (to 1102 samples).

We have three failures and finally the fourth (only period size) succeed.

With this patch:
D: [lt-pulseaudio] alsa-util.c: Maximum hw buffer size is 743 ms
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
D: [lt-pulseaudio] alsa-util.c: Set period size first (to 1102 samples), buffer size second (to 4408 samples).

We only fail with the first try, the second (period followed by buffer) is
fine.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2014-03-24 10:24:00 +02:00
Tanu Kaskinen
e7a77384fb doxygen: Update the configuration file
I reviewed the changes, and I didn't find anything that would actually
have effects on the generated output.
2014-03-24 09:40:09 +02:00
Tanu Kaskinen
37e73e10be zeroconf-publish: Don't react to messages while shutting down
This fixes a case where pa__done() is called while
AVAHI_MESSAGE_PUBLISH_ALL is waiting for processing. The
pa_asyncmsgq_wait_for(AVAHI_MESSAGE_SHUTDOWN_COMPLETE) call will
process all pending messages, and processing AVAHI_MESSAGE_PUBLISH_ALL
causes publish_all_services(), and that in turn accesses u->services,
which has been already freed at this point. If we are shutting down,
we shouldn't react to any of the messages that the Avahi thread is
sending to the main thread.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76184
2014-03-24 09:28:43 +02:00
Tanu Kaskinen
d03ffdccdb zeroconf-publish: Add locking around pa_mainloop_api_once()
Commit e1e154c737 added locking around
pa_mainloop_api_once() everywhere except pa__done(). This fixes that
omission.
2014-03-24 09:28:34 +02:00
Tanu Kaskinen
568702f44e pacat: Fix partially translated message
The word "not" was not translated.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76529
2014-03-24 09:22:20 +02:00
Tanu Kaskinen
cd13fb368d core-util: Make pa_yes_no() translatable
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76529
2014-03-24 09:18:41 +02:00
Peter Meerwald
a9351f1a71 doc: Fix some typos/wording in man/pulse-daemon.conf.5
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-18 08:57:39 +01:00
Tanu Kaskinen
ee9037829a mainloop-api: Improve pa_mainloop_api_once() documentation 2014-03-15 13:01:03 +02:00
Tanu Kaskinen
868a9d03ad volume: Increase PA_SW_VOLUME_SNPRINT_DB_MAX
10 bytes isn't enough for "-123.45 dB", including the terminating null
byte.
2014-03-14 16:32:26 +02:00
Pete Beardmore
fe6e41d7d2 alsa: Use card description in default sink/source prefix when available
When given an explicit device.description in card_properties, prefer
this information over other default prefixes (e.g. 'Built-in Audio')
when constructing sink/source descriptions.

For example, if I manually configure the card description to be
"FooBar", I then expect that the sinks and created by the card also
have "FooBar" in their description instead of generic "Built-in
Audio".
2014-03-14 16:16:46 +02:00
Tanu Kaskinen
efec98280f tunnel: Fix inverted if condition 2014-03-13 13:04:55 +02:00
David Henningsson
00922f7dc0 alsa-mixer: Fix Analog Input showing up on USB Headset
In some cases, "Analog Input" could show up as well as
"Headset Mic" (or "Headphone Mic"), because I forgot to add the
relevant "required-absent" lines when I added the headset mic path.

As a result, both "Analog Input" and "Headset Mic" showed up on the
Logitech USB 530 Headset.

Reported-by: Steve Magoun <steve.magoun@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-03-11 05:50:10 +01:00
Tanu Kaskinen
85891571f4 pactl: Fix a copy-paster error 2014-03-10 12:50:19 +02:00
Peter Meerwald
515e9d43c4 doc: Use \since doxygen command correctly in mainloop-api.h
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-08 16:38:39 +01:00
Peter Meerwald
5bbd139797 core: add missing SET_PORT_LATENCY_OFFSET to dispatcher opcode string table
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-08 16:37:36 +01:00
Peter Meerwald
26ab04a290 doc: Use correct parameter name wait_for_accept in documentation of pa_threaded_mainloop_signal()
also sneaks in a full stop in documentation elsewhere

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-08 16:37:26 +01:00
Alexander E. Patrakov
305409cfcf Fix a few "it's -> its" typos 2014-03-07 18:04:02 +02:00
Peter Meerwald
89749a5379 tunnel-source-new: Fix shadow compiler warning
CC     modules/module_tunnel_sink_la-module-tunnel.lo
modules/module-tunnel-source-new.c: In function 'read_new_samples':
modules/module-tunnel-source-new.c:145:16: warning: declaration of 'read' shadows a global declaration [-Wshadow]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-06 15:48:36 +01:00
Peter Meerwald
73a6a169b2 doc: Fix pa_stream_set_latency_update_callback() documentation
the latency_update callback is supported on playback AND record
streams

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-06 15:47:33 +01:00
Peter Meerwald
679eed5340 doc: Fix a couple of 'to to' typos
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-03-06 15:47:33 +01:00
Tanu Kaskinen
9271c11e68 alsa: Remove a redundant check
If mixer_handle is not NULL, then hctl_handle won't be NULL either.
The redundant check was confusing, because it looked like we would
leak the mixer_handle if mixer_handle is non-NULL and hctl_handle is
NULL.
2014-03-03 18:06:21 +02:00
James Bunton
3f21c21628 bluetooth: Fix timing to count based on decoded data
Currently the latency information is being updated based on the encoded
SBC data instead of the decoded PCM data. Fixing this required moving
the timing update to be after the packet has been decoded.
2014-03-03 18:06:21 +02:00