Commit graph

8120 commits

Author SHA1 Message Date
Andrey Zholos
492fa1ff32 detect: Fix OSS device detection with long names
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89921
2015-04-13 08:32:16 +05:30
David Henningsson
6db74fc3c7 alsa-mixer: Add paths/ports for multichannel profile
This makes the GUIs (e g gnome/unity-control-center) look more consistent
with other inputs/outputs that also have ports.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 16:08:24 +02:00
David Henningsson
02dc6d84ed alsa-mixer: Use separate profiles for Multichannel Input/Output
This works around bug 80850: a mapping can only have one channel map,
and in case of a 6-out 10-in device, the mapping will be adjusted to
have both 10 and 6 channels, which does not work.

Reported-by: Benjamin Tegge <benjaminosm@googlemail.com>
Suggested-by: Raymond Yau <superquad.vortex2@gmail.com>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=80850
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 16:08:24 +02:00
Takashi Sakamoto
3ac73598c6 udev: use ID_MODEL/ID_VENDOR to give friendly name for FireWire devices
For recently supported FireWire sound devices, udev's database assign
the name of IEEE 1394 Phy/Link chipset to ID_XXX_FROM_DATABASE. This is
not friently names to users.

This commit applies a workaround to skip ID_XXX_FROM_DATABASE for any
FireWire devices.

[Fixed up by David Henningsson <david.henningsson@canonical.com>]

Reported-by: Andras Muranyi <muranyia@gmail.com>
Reference: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1381475
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 16:08:24 +02:00
Tanu Kaskinen
ef864eeab0 core-util: Filter out not-a-numbers in pa_atod()
We don't and probably never will have any pa_atod() callers that would
require "NaN" to be accepted, so let's filter those out in pa_atod(),
instead of requiring the callers to handle not-a-numbers appropriately
(which they generally forget to do).
2015-04-10 12:58:10 +03:00
Tanu Kaskinen
9860bc30ac pactl: Fix relative volume parsing
The recent change to reject leading '+' in pa_atod() broke the
relative volume parsing in pactl. This fixes that.
2015-04-10 11:19:18 +03:00
David Henningsson
37a7834737 module-switch-*: use pa_module_hook_connect
Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:26:49 +02:00
David Henningsson
10d9d8af5f module-filter-*: use pa_module_hook_connect
Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:26:47 +02:00
David Henningsson
6eae0d4bf4 module-alsa-card: use pa_module_hook_connect
Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:26:45 +02:00
David Henningsson
a5ea142487 module-suspend-on-idle: use pa_module_hook_connect
Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:26:43 +02:00
David Henningsson
619def0c73 module-*-restore: use pa_module_hook_connect
Refactoring, no functional change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:26:40 +02:00
David Henningsson
127e8a1519 module: Add hook dynarray
This small helper will simplify code in many modules.
The hooks added through pa_module_hook_connect will be freed just
before pa__done is called (so trying to add hooks during pa__done
will result in assertion failure).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-10 09:25:55 +02:00
Arun Raghavan
f0c9321b53 sink-input: Clarify the meaning of rewrite and flush a bit in rewinds 2015-04-06 18:16:55 +05:30
Juho Hämäläinen
42eac216cf dbus: Use hooks for default sink and source changes
[Fixes by David Henningsson <david.henningsson@canonical.com>]
2015-04-02 16:19:20 +02:00
Juho Hämäläinen
3bb69ebfc2 dbus: Use hooks for put and unlink
Use hooks for all events that have core hooks defined. Some events
handled in iface-core don't have hooks so leave those for later.
2015-04-02 16:12:15 +02:00
Juho Hämäläinen
297fdb5c25 namereg: Fire hooks for default sink and source changes 2015-04-02 16:09:47 +02:00
Juho Hämäläinen
88d6724493 core: Add hooks for default sink and source changes 2015-04-02 16:09:34 +02:00
Juho Hämäläinen
86fcc3f445 dbus: Use state changed hook for sink-input and source-output rate changes 2015-04-02 16:09:16 +02:00
Juho Hämäläinen
7f83817edd dbus: Use hooks for sink-input and source-output events 2015-04-02 16:08:51 +02:00
Juho Hämäläinen
5087af78d5 dbus: Use hooks for sink and source events 2015-04-02 16:08:26 +02:00
Juho Hämäläinen
36c3f01cb2 dbus: Use hooks for client proplist changes 2015-04-02 16:08:00 +02:00
Juho Hämäläinen
c324255e3e dbus: Use hooks for card profile events 2015-04-02 16:06:50 +02:00
Milo Casagrande
db05985ea6 Update Italian translation. 2015-04-01 20:04:10 +03:00
René J. V. Bertin
5f24529316 coreaudio: Change error type to OSStatus
CoreAudio routines that return an error status do so with the
OSStatus type, which is not a UInt32: typical OS X errors are
negative numbers.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-01 09:43:05 +02:00
Tanu Kaskinen
1f659cc836 sink, source: Fix a volume change leak
When a sink or source is freed, there may be pending volume changes that
didn't get applied before the IO thread got torn down. Those pending
changes need to be freed.

The memory leak was reported here:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23162/focus=23169

Reported-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-03-31 20:36:20 +03:00
Tanu Kaskinen
30b6c111a6 .gitignore: Add lfe-filter-test 2015-03-31 12:42:37 +03:00
David Henningsson
2cfc5df87f resampler: Rename "lfe_filter_required" to "lfe_remixed"
Just refactoring to make the variable name better.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 15:12:53 +02:00
David Henningsson
c65a606ae7 resampler: Allow disabling the LFE filter by setting crossover to 0
When crossover_freq is set to 0, this restores the old behaviour
of letting the LFE channel be the average of the source channels,
without additional processing. This can be useful e g in case the
user already has a hardware crossover.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 11:10:56 +02:00
Hui Wang
a9059be749 daemon-conf: enable the lfe remixing by default
Since we have a workable lfe filter, it is time to enable the lfe
remixing by default.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-03-30 10:52:30 +02:00
Hui Wang
98e01c8a9c tests: adding lfe-filter-test
so far, this test only includes rewind test, it works as below:
let lfe-filter process 2 blocks mono lfe channel audio samples, the
sample format is PA_SAMPLE_S16LE, save the processed data to the temp
buffer, then rewind the lfe-filter back 1 block and 1.5 blocks
respectively, reprocess the audio samples from the rewind position,
then comparing the output data with previously saved data.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-03-30 10:52:30 +02:00
David Henningsson
7fb531d936 resampler: Make some basic functions for rewinding
The resampler framework just forwards the request to the lfe filter.
There are no resampler impl that can rewind yet, so just reset the
resampler impl instead of properly rewinding yet.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:30 +02:00
David Henningsson
defc2b702b lfe-filter: Add rewind support
Store current filter state at every normal block process.
When a rewind happens, rewind back to the nearest saved state,
then calculate forward to the actual sample position.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:30 +02:00
David Henningsson
d0e8b0fe07 memblock: Change pa_memblock_new_malloced to an inline function
To avoid the macro trap: I call pa_memblock_new_malloced with
"pa_xmemdup" as data parameter, and that would expand to *two*
calls to pa_xmemdup in case that remains a macro, which is clearly
not intended.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:30 +02:00
Hui Wang
c36e191ce5 lfe-filter: change the crossover frequency as a parameter
Add a user defined parameter lfe-crossover-freq for the lfe-filter,
to pass this parameter to the lfe-filter, we need to change the
pa_resampler_new() API as well.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2015-03-30 10:52:30 +02:00
David Henningsson
3538e6636e lfe-filter: Cleanup and refactor
- Remove imported dead code
 - Fix compiler warnings
 - Fix non-GCC compiler compilation (use more portable macros)
 - Change lr4 struct to include a biquad struct

Thanks to Alexander Patrakov for suggesting many of these changes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:30 +02:00
David Henningsson
979f19a434 lfe-filter: Enable LFE filter in the resampler
When enable-lfe-remixing is set, an LFE channel is present in the
resampler's destination channel map but not in the source channel map,
we insert a low-pass filter instead of just averaging the channels.
Other channels will get a high-pass filter.

In this patch, the crossover frequency is hardcoded to 120Hz (to be fixed
in later patches).

Note that in current state the LFE filter is
 - not very optimised
 - not rewind friendly (rewinding can cause audible artifacts)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:29 +02:00
David Henningsson
f3ebf6b667 lfe-filter: Import code from the Chrome OS audio server
The chrome OS audio server has some already existing code, which
has been made available under a BSD-style license, which should be
safe to import by us.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-30 10:52:29 +02:00
Sagar Nageshmurthy
ff329cdabb Fix: Prevent calling pa_rtpoll_free() for a NULL rtpoll
Flushing the asyncmsgq can cause arbitrarily callbacks to run, potentially
causing recursion into pa_thread_mq_done again. Because of this; rtpoll which
is cleared in the second iteration is tried to free once again by the first
iteration leading to PA crash.
2015-03-27 14:34:15 +01:00
David Henningsson
498689926f thread-mq: Make pa_thread_mq_done more robust
While investigating bug 89672 it was found that pa_thread_mq_done
was called recursively. Regardless of whether the recursion should
be stopped by other means, it seems to make sense to make
pa_thread_mq_done more robust so that it can be called twice
(and even recursively) without harm.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89672
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-27 14:34:12 +01:00
Tanu Kaskinen
85f5d93306 ucm: Add support for "JackControl"
JackControl is used to indicate the kcontrol name for jack detection.
2015-03-23 19:26:03 +02:00
Sukesh Adiga
80791ceb5a cpu-arm: Fix memory leak in pa_cpu_get_arm_flags() 2015-03-19 15:36:01 +01:00
Tanu Kaskinen
c0ab9e6ce0 core-util: Make number parsing stricter
pa_atou(), pa_atol() and pa_atod() are stricter than the libc
counterparts (the PA functions reject strings that have trailing extra
stuff in them). I have been under the impression that the PA functions
only accept "obviously valid numbers", that is, I have assumed that
these would be rejected: " 42" (leading whitespace), "" (empty
string) and "-18446744073709551615" in case of pa_atou().

I noticed that empty strings are accepted, however, and on closer
inspection I found that leading whitespace is accepted too, and even
that pa_atou() thinks that "-18446744073709551615" is the same thing
as "1"! This patch makes the parsing functions more strict, so that
they indeed only accept "obviously valid numbers". I decided to also
disallow leading plus signs, just because I don't like them.
2015-03-16 18:52:41 +02:00
David Herrmann
b8bcfeb78d core-util: Fix set_nice() to use private bus connections
In src/pulsecore/core-util.c:set_nice() we currently use a temporary
dbus-connection to set the nice-level via rtkit. However, we never
close that connection. This is fine, as the connection is shared and
dbus-core will manage it. But no other part of pulseaudio (except
set_scheduler()) uses the libdbus1 managed connections. Therefore,
we effectively end up with an unused dbus-connection that is not
integrated into any main-loop. dbus-daemon will send bus-notifications
to the connection (as libdbus1 installs matches for those by default
(it has to!)) until the outgoing queue is full. Thus, we waste several
KBs (or MBs? I didn't look it up) of memory for a message queue that
is never dispatched.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-12 13:42:46 +01:00
David Henningsson
a13b6f001d pstream: Remove unnecessary if condition
Without split packets, the if condition can now be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-11 12:57:31 +01:00
David Henningsson
6a71b5f967 protocol-native: Re-enable srbchannel
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-11 12:52:42 +01:00
David Henningsson
7b8e8cd388 pstream: Don't split (non-SHM) memblocks
In case SHM is full or disabled, audio data is sent through the
io/srbchannel. When this channel in turn gets full, memblocks
could previously be split up. This could lead to crashes in case
the split was on non-frame boundaries (in combination with full
memblock queues).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88452
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-03-11 12:43:02 +01:00
Peter Meerwald
ebee1a6306 pacat: Fix comment wording
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:30:25 +01:00
Peter Meerwald
6a55df78aa packet: Use flist to save calls to malloc()/free()
a separate free-list is used to recycle memory of fixed-sized packets
with up to MAX_APPENDED_SIZE of data

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:23:17 +01:00
Peter Meerwald
f92300cc92 packet: Introduce pa_packet_new_data() to copy data into a newly created packet
v2: (thanks Alexander Patrakov)
* turn check in pa_packet_new() into assert()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:23:17 +01:00
Peter Meerwald
c1a7f0e326 packet: Make pa_packet_new() create fixed-size packets
if length exceeds maximum appended size, create a packet of
type dynamic instead of type appended

this is a preparation to use a separate free-list for packets

document semantics of pa_packet_new_*() functions

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:23:17 +01:00