Commit graph

2356 commits

Author SHA1 Message Date
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
Peter Meerwald
d3cddfed5c modules: Fix uninit value in rtp-send
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8803&defectInstanceId=3705&mergedDefectId=591292&eventIds=3705-36&eventId=3705-36

see http://silviocesare.wordpress.com/2007/10/22/setting-sin_zero-to-0-in-struct-sockaddr_in/

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00
Peter Meerwald
7fca92627b modules: Fix resource leak in card-restore
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8728&defectInstanceId=3737&mergedDefectId=591274

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:17 +01:00
Peter Meerwald
9d3d732a63 modules: Fix resource leak in raop_client
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8899&defectInstanceId=3735&mergedDefectId=591272

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:55:05 +01:00
Peter Meerwald
7978baaf81 modules: Fix resource leak in tunnel-sink-new
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8770&defectInstanceId=3733&mergedDefectId=591270

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:19 +01:00
Peter Meerwald
c2e9f1fdec modules: Fix resource leak in oss
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8824&defectInstanceId=3731&mergedDefectId=591267

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:18 +01:00
Peter Meerwald
9a341c6b36 modules: Fix resource leak in alsa-ucm
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8833&defectInstanceId=3732&mergedDefectId=591268

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:18 +01:00
Peter Meerwald
a4b8a9d5a2 modules: Fix resource leak in device-restore
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8724&defectInstanceId=3728&mergedDefectId=591265

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:18 +01:00
Peter Meerwald
cfce437e47 modules: Fix resource leak in alsa-card
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8851&defectInstanceId=3725&mergedDefectId=591261

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:18 +01:00
Peter Meerwald
bbed792cdf modules: Fix resource leak in stream-restore
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8726&defectInstanceId=3724&mergedDefectId=591260

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-20 12:54:18 +01:00
Tanu Kaskinen
2747c96101 Add pa_channels_valid()
I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
channel count values.
2013-12-15 11:44:35 +01:00
Tanu Kaskinen
a67318f8af Add pa_sample_rate_valid()
I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
sample rate values.
2013-12-15 11:21:56 +01:00
Tanu Kaskinen
1cda717252 Add pa_sample_format_valid()
I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
the sample format value.
2013-12-15 11:07:17 +01:00
Tanu Kaskinen
643eb5bae2 bluetooth: Fix profile priority comparison
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72414
2013-12-14 09:34:21 +02:00
Arun Raghavan
9833bb460c alsa: Log some output if we disable tsched for BATCH devices 2013-12-06 06:00:15 -08:00
Lars-Peter Clausen
826c8f69d3 alsa: Disable timer-scheduling for PCMs with the BATCH flag
PCM Devices which have the BATCH flag set update the PCM pointer only with
period size granularity. Using timer based scheduling does not have any
advantage in this mode. For one devices which have that flag set usually update
the position pointer in software after getting the period interrupt. So
disabling the period interrupt is not possible for this kind of devices.
Furthermore writing to or reading from the buffer slice for the current period
is not possible since the position inside the buffer is not known. On the other
hand the tsched algorithm seems to get easily confused for this kind of
hardware, which results in garbled audio output. This typically means that timer
based scheduling needs to be manually disabled on systems with such devices.
Auto disabling tsched in this case allows these systems to run with the default
configuration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-06 12:58:03 +02:00
Kenneth Perry
2ff195aaa4 bonjour-publish: Return ports in network byteorder
For DNS-SD (Bonjour) discovery, all ports should be set in network
byteorder instead of host byteorder. Without this, all ports on
little-endian systems (intel) are incorrect.

Documentation:
https://developer.apple.com/library/mac/documentation/networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html#//apple_ref/c/func/DNSServiceRegister
2013-12-05 11:21:51 +02:00
Peter Meerwald
3d425a3315 module-remap-source: Add resample_method argument
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-12-05 11:05:24 +02:00
Peter Meerwald
5f7dfd9b91 module-remap-sink: Add resample_method argument
the main intent is to make testing different sample rate resampling
implementations easier; so far there is only global control via
resample-method (command line argument and /etc/pulse/daemon.conf)

module-remap-*'s only purpose is resampling (comprising format conversion,
channel remapping, sample rate adjustment), it can easily be introduced
into any audio pipeline

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-12-05 11:04:19 +02:00
Peter Meerwald
f8e0b86592 module-sine: Add rate argument
useful for testing resampling

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-12-05 11:03:10 +02:00
Peter Meerwald
e74d4244a2 modules: Make use of new function pa_modargs_get_sample_rate()
by using pa_modargs_get_sample_rate() we avoid inconsistant validity
checking of the sample rate in various places

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-12-05 10:54:12 +02:00
Tanu Kaskinen
ce304d6208 Pass the profile object instead of the profile name to pa_card_set_profile()
When setting attribute foo, or in this case the card profile, in my
opinion the thing passed to the set_foo() function should be of the
type of foo, not a string identifier that can be used to search for
the actual foo in set_foo().

This is mostly a question of taste, but there's at least some small
benefit from passing the actual object: often the profile object is
already available when calling pa_card_set_profile(), so passing the
card name would cause unnecessary searching when pa_card_set_profile()
needs to look up the profile from the hashmap.
2013-11-29 07:25:13 +02:00
Tanu Kaskinen
bee86af3cc ucm: Add a FIXME comment about bad error handling 2013-11-29 07:21:37 +02:00
Tanu Kaskinen
d1fd31d50f idxset: Allow deep copying with pa_idxset_copy() 2013-11-29 07:14:39 +02:00
João Paulo Rechi Vita
b705e38a79 bluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()
We need to check if the device information is valid first, so we don't
pass invalid strings to pa_streq().
2013-11-22 18:40:07 +02:00
João Paulo Rechi Vita
d8fb09b567 bluetooth: Check adapter address to set device_info_valid
If the adapter object has no address information the device information
should be marked as invalid.
2013-11-22 18:39:36 +02:00
Tanu Kaskinen
e9d760b555 bluetooth: Set device_info_valid to -1 when the device's adapter disappears
When parsing device properties, missing adapter will result in
device_info_valid being set to -1. It is then logical that if the
adapter goes missing at a later point, device_info_valid gets set to
-1 also in that situation.
2013-11-20 15:49:10 +02:00
Tanu Kaskinen
e2dea40f4a bluetooth: Remove device_remove_all()
The function did two things: set device_info_valid to -1 and called
device_free() for each device in the hashmap. Setting
device_info_valid to -1 was unnecessary. The main purpose of that was
to fire DEVICE_CONNECTION_CHANGED as a side effect, but that hook is
fired anyway in device_free(), as a side effect of removing all
transports. Calling device_free() can be delegated to pa_hashmap, when
freeing or emptying it.
2013-11-20 15:49:06 +02:00
Tanu Kaskinen
454ca62b23 bluetooth: Fire DEVICE_CONNECTION_CHANGED in set_device_info_valid()
Normally DEVICE_CONNECTION_CHANGED is fired when the first transport
becomes connected, but it may happen that the first transport becomes
connected already before the device properties have been received. In
that case the hook should be fired at the time the device properties
are received. This patch makes the hook to be fired at the right time.
2013-11-20 15:49:01 +02:00
Tanu Kaskinen
6633c1f9ff bluetooth: Don't mark device valid before it has an adapter
At this point this doesn't make any other practical difference than
making the code more logical, but in the next patch I'll fire the
DEVICE_CONNECTION_CHANGED hook in set_device_info_valid(), and at that
point it's important that the device isn't marked valid too early,
because otherwise external code would see "valid" devices that however
don't have the adapter set.
2013-11-20 15:48:56 +02:00
Tanu Kaskinen
f4f4c42fc6 bluetooth: Use a helper function for setting device_info_valid
The helper function doesn't yet bring much benefits in this form, but
I'll add more functionality later.
2013-11-20 15:48:53 +02:00
Tanu Kaskinen
12b7a600d8 bluetooth: Remove a redundant variable 2013-11-15 14:50:46 +02:00
Alexander Couzens
abfca5cb58 tunnel-new: add cookie module argument
When connecting to a remote server your local generated authentication
cookie is used. If remote server's cookie is different from your local
one you aren't allowed to connect. You can use the cookie argument
or define a wider acl in remote server configuration for
module-native-protocol.
2013-11-15 10:16:29 +02:00
David Henningsson
6dddee4214 alsa-mixer: Add internal surround speaker elements
These kcontrol names have started to show up lately, in
combination with surround internal speakers.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-11-01 21:27:29 +01:00
João Paulo Rechi Vita
078dc15944 console-kit: Remove logging of every message on the bus 2013-11-01 16:28:45 +02:00
Tanu Kaskinen
38b8c42b35 bluetooth: Fix variable constness
The string points to memory inside a DBusMessage, so we don't own the string.
2013-10-29 20:46:47 +02:00
Tanu Kaskinen
c922dce784 bluetooth: Remove adapter_remove_all()
The function was redundant, because all it did was call adapter_free()
for each adapter in the hashmap, and that can be delegated to
pa_hashmap when freeing or emptying it.
2013-10-29 20:44:14 +02:00
João Paulo Rechi Vita
9490a067bb bluetooth: Track discovery modules by index
Previously module-bluez5-discover and module-bluez4-discover were being
tracked using their pa_module pointer. But during daemon shutdown these
modules are unloaded before module-bluetooth-discover, leaving stale
pointers in module-bluetooth-discover's userdata. To avoid this problem
this commit makes module-bluetooth-discover keep track of
module-bluez5-discover and module-bluez4-discovery by their indexes.
2013-10-15 10:42:25 +03:00
Jan Alexander Steffens (heftig)
f81e3e1d78 alsa: Fix crash when loading bare ALSA sink/source
module-alsa-{sink,source}.c call pa_alsa_{sink,source}_new with
mapping set to NULL. Guard against this, like the rest of the
function does.

module-alsa-card does not use NULL, so this went unnoticed so far.
2013-10-10 00:03:56 +05:30
Alexander Couzens
3fd2004603 tunnel-sink-new: Fix a possible crash
When the creation of u->thread fails, then pa_thread_mq_done() in
pa__done() will crash, because pa_thread_mq_init() was never called.
Allocating the thread_mq object separately, instead of embedding it
in the userdata struct, allows pa__done() to call pa_thread_mq_done()
only when necessary.
2013-10-04 14:30:26 +03:00
Alexander Couzens
0c3f3934f5 tunnel-sink-new: remove switch-default from state change callbacks
Using default sections for switch(state) in state change callbacks will prevent
useful compiler warnings for non-handled cases
2013-10-04 13:53:08 +03:00
David Henningsson
798525bf16 alsa-mixer: Drop all unused paths, not only unsupported paths
This is a cleaner solution, because it also removes paths that are
being removed because they are subsets of other paths.

Otherwise, the lingering paths could cause jack detection related
assertion failures.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69676
Reported-and-tested-by: Kalev Lember <kalevlember@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-10-03 16:19:52 +02:00
Arun Raghavan
5a2fd6624d alsa-ucm: Fix bad rate check
Need to check the rate value for being > 0 not the return value of
pa_atou().
2013-09-30 15:16:56 +05:30
Arun Raghavan
24d2fa5415 alsa-ucm: Don't allow Playback/CaptureRate to be 0
This was a review comment on the original patch that I missed fixing.
2013-09-30 08:32:59 +05:30
Tanu Kaskinen
189708a597 bluetooth: Add a comment about messing with the IDLE suspend cause 2013-09-29 19:47:16 +03:00