Commit graph

2400 commits

Author SHA1 Message Date
Tanu Kaskinen
f88912af9b solaris, tunnel: Remove some redundant boolean conversions 2014-05-02 16:00:56 +03:00
Tanu Kaskinen
ef4ae785aa sink-input, source-output: Remove redundant get_mute() functions
The functions just return the muted value. Callers can as well read
the struct field directly, it's simpler that way.
2014-05-02 16:00:56 +03:00
Tanu Kaskinen
e4a7625ba8 sink, source: Assign to s->muted from only one place
Forcing all mute changes to go through set_mute() makes it easier to
check where the muted field is changed, and it also allows us to have
only one place where notifications for changed mute are sent.
2014-05-02 16:00:49 +03:00
Tanu Kaskinen
c93cfc1ca6 echo-cancel: Remove redundant get_mute() callback
The callback just called pa_source_output_get_mute(), which doesn't
have any side effects, and the return value wasn't used either, so
the callback was essentially a no-op.
2014-05-02 15:50:15 +03:00
Arun Raghavan
c78860c97b gconf: Avoid calling deprecated function if possible
g_type_init() is need no longer be called explicitly from glib 2.36
onwards.
2014-04-26 11:32:45 +03:00
Arun Raghavan
a30650d2ce gconf: Remove unused variable 2014-04-26 11:32:34 +03:00
Hemanth Meenakshisundaram
4bd39f9501 combine-sink: fix zero adjust_time behaviour.
A value of 0 for adjust_time should disable rate adjustment.
Fix a bug where a 0 value causes rate adjustment to be called
continuously instead after an unsuspend event.
2014-04-26 11:22:25 +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
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
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
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
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
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
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
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
James Bunton
4a5f48e7a4 bluetooth: Don't abort on SBC decoding error
The Nokia E7 running Symbian Belle Refresh seems to generate invalid SBC
packets every few minutes. This causes pulseaudio to disconnect the
stream and log "SBC decoding error (-3)".

If a single packet is bad, pulseaudio should keep playing the stream.
2014-03-03 18:06:21 +02:00
Tanu Kaskinen
0a5adc95c4 suspend-on-idle: Fix monitor source handling
Fixes a crash that happened due to calling pa_source_check_suspend()
when d->source was NULL.
2014-03-03 16:21:21 +02:00
Tanu Kaskinen
4ebe88c2b2 rtp-send: Add "inhibit_auto_suspend" module argument
Some people want module-rtp-send to send silence when the sink that is
monitored goes idle, and some people want module-rtp-send to pause the
RTP stream to avoid unnecessary bandwidth consumption.
2014-02-28 15:54:06 +02:00
David Henningsson
b55de5179a suspend-on-idle: Ensure we still time out if a stream remains corked
If a stream is started corked and remains corked, the sink/source
remained idle without being properly suspended. This patch fixes
that issue.

BugLink: https://bugs.launchpad.net/bugs/1284415
Tested-by: Ricardo Salveti <ricardo.salveti@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-02-28 13:58:40 +01:00
Tanu Kaskinen
d94cd5f730 rtp-send: Use _cb suffix with callbacks 2014-02-23 19:45:02 +02:00
Peter Meerwald
0c4c2b3110 modules: Fix uninitialized variable in rtp-send
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-02-23 17:03:50 +01:00
Juho Hämäläinen
6021ce3196 dbus: Use correct idxset when getting sources
This fixes get_sources() which iterates wrong idxset when
getting source object paths in GetSources or GetAll.
2014-02-11 12:02:28 +02:00
Tanu Kaskinen
c95b4c22ca card-restore: Fix a memory leak
entry_read() may set entry->profile, so we need to free that string
before we can replace it with a new string.
2014-01-29 20:56:42 +02:00
Tanu Kaskinen
588af08d25 device-manager: Don't try to use unlinked devices
This fixes an assertion crash:

[pulseaudio] source.c: Assertion 'PA_SOURCE_IS_LINKED(s->state)' failed at pulsecore/source.c:734, function pa_source_update_status(). Aborting.

The crash happened when a Bluetooth headset profile was changed from
a2dp to hsp. During the profile change three devices are created:
a sink, a monitor source for the sink, and a regular source. First
pa_sink/source_new() are called for each device, and that puts the
devices to u->core->sinks/sources. Then, pa_sink_put() is called for
the sink, and that in turn calls pa_source_put() for the source. At
that point module-device-manager decides to reroute all source
outputs. The non-monitor source that the Bluetooth card created hasn't
been linked yet at this stage, because it will only be linked after
the sink and the monitor source have been linked. So,
module-device-manager should take into account during the rerouting
that not all sinks and sources are necessarily linked. This patch does
that.

Reported-By: Iskren Hadzhinedev <i.hadzhinedev@gmail.com>
2014-01-26 21:20:31 +02:00
Daniel Albers
6b82c6122b combine-sink: fix segfault 2014-01-17 12:21:39 +02:00
Tanu Kaskinen
7fd14b6f58 Revert "ladspa-sink: Handle empty chunks in sink_input_pop_cb"
This reverts commit dbe66b0b5e.

I accidentally pushed this patch that was superseded by
e96785c1c3.
2014-01-15 14:24:25 +02:00
Ben Brewer
e96785c1c3 ladspa-sink: Set a silence memchunk for the memblockq
A crash was observed that was caused by pa_memblockq_peek() returning
a NULL memblock in sink_input_pop_cb(). The scenario where this was
happening was

1. Delete 2 rtp-recv's connected to a ladspa-sink
2. Delete ladspa-sink
3. Delete alsa-sink
4. Create alsa-sink
5. Create ladspa-sink
6. Create 2 rtp-recv's connected to the ladspa-sink

The crash was probably caused by a rewind that made the read index go
negative while the write index was at least zero, causing there to be
a gap in the memblockq. The problematic rewind might have been caused
by adding the rtp-recv stream to the ladspa-sink. That has not been
proven, but this looks very similar to the bug that was fixed in
module-virtual-sink in commit 6bd34156b1.
2014-01-15 13:50:11 +02:00
Ben Brewer
dbe66b0b5e ladspa-sink: Handle empty chunks in sink_input_pop_cb 2014-01-15 12:34:13 +02:00
Héctor Martín
4e5051db72 zeroconf-discover: Specify the interface when connecting to a link-local IPv6 address
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=40785
2014-01-15 12:20:27 +02:00
Tanu Kaskinen
a0f73b74eb alsa: Mute "Bass Speaker" when using headphones or lineout
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=73604
2014-01-15 11:37:26 +02:00
Ben Brewer
298ffffd1a rtp-send: Remove "don't inhibit auto-suspend" flag
A source is no longer considered idle in pa_source_check_suspend when
module-rtp-send is consuming data from it.
2014-01-14 14:57:10 +02:00
Laurentiu Nicola
88abd6c49e rtp-recv: Only try adding the group membership for multicast addresses 2014-01-10 13:02:50 +02:00
Peter Meerwald
56e578c310 alsa-card: Don't free the modargs in pa__init
The modargs are in both cases (a succesfull as well as a failed module
initialization) freed already in pa__done().

To avoid leaking modargs memory before they are assigned to u->modargs, the
code is reorganized to first allocate userdata, and then allocate the modargs.
Local variable ma is not needed anymore.

discussion here
http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-December/019661.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: poljar (Damir Jelić) <poljarinho@gmail.com>
2014-01-10 12:32:36 +02:00
Laurentiu Nicola
bef191be82 module-rtp-recv: Add an argument for latency 2014-01-03 13:39:27 +02:00
poljar (Damir Jelić)
c307093cf0 alsa-mixer: Free the description key in alsa_path_free(). 2014-01-03 13:17:08 +02:00
poljar (Damir Jelić)
f7afaa2644 bluez5-util: Free the adapter_path in device_free(). 2014-01-03 13:16:07 +02:00
Peter Meerwald
a8fea5c468 modules: Add assertion in equalizer-sink
discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00
Peter Meerwald
67dc1a5a0b modules: Remove dead code in position-event-sounds
ma is always NULL in fail path, discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00
Peter Meerwald
5196453117 modules: Remove redundant code in virtual-surround-sink
https://scan7.coverity.com:8443/reports.htm#v10206/p10016/fileInstanceId=8788&defectInstanceId=3710&mergedDefectId=591297

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00