Commit graph

2631 commits

Author SHA1 Message Date
Arun Raghavan
5071960bf3 alsa-mixer: Drop redundant conditional frees
The dynarrays are allocated unconditionally, so the free need not be
conditional.
2015-08-25 19:27:58 +05:30
Tanu Kaskinen
38e81f4c3d ucm: Add support for "JackHWMute"
JackHWMute is used to list devices that get forcibly muted by
a particular jack. We mark ports unavailable based on that
information.
2015-08-21 14:33:11 +03:00
Tanu Kaskinen
d2bed5332a ucm: Create only one jack object per kcontrol
Previously the UCM code created one jack object per device name (which
is not the same thing as creating one jack object per device, because
the UCM device namespace is scoped on per-verb basis, so devices in
different verbs may have the same name). I think it's conceptually
cleaner to create one jack object per alsa kcontrol. I plan to do
similar refactoring on the traditional mixer code later.
2015-08-21 14:33:11 +03:00
Tanu Kaskinen
c9557e6969 alsa: Move UCM port availability updating to the mixer code
Previously module-alsa-card assigned to pa_alsa_jack.plugged_in
directly, and then did the port availability updating manually. The
idea of pa_alsa_jack_set_plugged_in() is to move the availability
updating to the mixer infrastructure, where it really belongs.

Similarly, pa_alsa_jack.has_control was previously modified directly
from several places. The has_control field affects the port
availability, and pa_alsa_jack_set_has_control() takes care of
updating the availability.

For now, pa_alsa_jack_set_plugged_in() and
pa_alsa_jack_set_has_control() only update the port availability
when using UCM. My plan is to adapt the traditional mixer code later.
2015-08-21 14:33:11 +03:00
Tanu Kaskinen
40714b6bcc alsa: Add associations between jacks, UCM devices and UCM ports
These associations will be used by subsequent UCM jack detection
refactoring work.
2015-08-21 14:33:10 +03:00
Tanu Kaskinen
d7ce78b234 ucm: Don't create separate input and output jacks
The UCM spec doesn't support separate input and output jacks, so it's
redundant to have separate input and output jacks in
pa_alsa_ucm_device.
2015-08-21 14:33:10 +03:00
Tanu Kaskinen
f5fecff0b4 alsa: Add pa_alsa_jack_new() and pa_alsa_jack_free()
This reduces code duplication in alsa-mixer.c and alsa-ucm.c. No
functional changes.
2015-08-21 14:33:10 +03:00
David Henningsson
c50766b52a alsa-mixer: Add "Front Line Out" and "Rear Line Out"
"Front Line Out" was found in the wild on one of the machines we enable.
I figured I could just as well add "Rear Line Out" too, because that's
just as likely to show up.

As a reminder, "Front Line Out" means "a line out jack physically located
on the front side", where as "Line Out Front" means "a line out jack
playing back front left and front right channels in a channel map".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-08-21 13:28:32 +02:00
Tanu Kaskinen
74b0fb45e5 alsa-mixer: Add descriptions for analog-stereo-input and analog-stereo-output mappings
These mapping names are used in sb-omni-surround-5.1.conf, which needs
to use separate mappings for input and output, since they are
associated with different alsa devices.
2015-08-21 11:25:26 +03:00
Deepak Srivastava
a3bf429efd Removed exclamation marks from user-visible messages.
<EP-E358F00C1D9A449EAE69225B9D2530F8>
According to rationale-"http://techbase.kde.org/Projects/Usability/HIG/Exclamation_points" as suggested in reported bug.
Component: misc

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=78563

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-08-14 12:17:02 +03:00
Shawn Walker
954503d074 modules: Fix struct namespace collision on Solaris 2015-07-29 08:09:41 +05:30
Tanu Kaskinen
4604af7198 combine-sink: Fix unsafe message handling
This fixes a crash. sink_input_pop_cb() drains the message queue that receives
memchunks from the combine sink thread to avoid requesting more audio too soon.
The same message queue received also SET_REQUESTED_LATENCY messages, which
generate rewind requests. Rewind requests shouldn't be issued in the pop()
callback, doing so results in an assertion error. Therefore, it was not safe to
drain the message queue in the pop() callback, but usually the queue is empty,
so this bug was not immediately detected.

This patch splits the message queue into two queues: audio_inq and control_inq.
audio_inq receives only messages containing memchunks, and control_inq receives
only the SET_REQUESTED_LATENCY messages. The pop() callback only drains the
audio queue, which avoids the rewind requests in the pop() callback.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90489
2015-07-21 20:05:13 +03:00
Manish Sogi
dd084acb28 xen: Resource leak in local function alloc_gref() - alloc_fd and dev_fd
The file descriptors need to be closed in failure cases otherwise resource
leak is there.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=91174#c0

Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
2015-07-21 16:40:03 +02:00
Arun Raghavan
aafb56d902 equalizer: Handle underlying sink going away better when autoloaded
Detailed description in fix for module-echo-cancel.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90416
2015-06-12 12:43:18 +05:30
Arun Raghavan
bf7bc1a55f echo-cancel: Handle underlying sink going away better when autoloaded
When we the underlying sink/source goes away, there is an intermediate
state where the asyncmsgqs that we were using for the sink-input and
source-output go away. This is usually okay if the sink-input and
source-output are moved to another device, but can be problematic if we
don't support moving (which is the case when the filter is autoloaded).

This becomes a problem because of the following chain of events:

  * The underlying sink goes away

  * Moving the filter sink-input fails (because it is autloaded)
    * At this point the sink-input has no underlying sink, and thus
      no underlying asyncmsgq
    * This also applies to all sink-inputs connected to the echo-cancel
      module

  * The sink-input is killed, triggering a module unload

  * On unlink, module-rescue-streams tries to move sink-inputs to
    another sink, starting with a START_MOVE message

  * There is no asyncmsgq for the message, so we crash
    * We can't just perform a NULL check for the asyncmsgq, since there
      are state changes we need to effect during the move

To fix this, we pretend to allow the move to the new sink, and then
unlink ourselves *after* the move is complete. This ensures that we
never find ourselves in a position where we need the underlying
sink/asyncmsgq to be present when it is not.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90416
2015-06-12 12:43:18 +05:30
Arun Raghavan
ceae6b1e61 always-sink: Ignore filter sinks
We don't want to count filter sinks towards the list of actual sinks,
since those also need a real underlying sink to exist.
2015-06-12 12:43:18 +05:30
Arun Raghavan
81f7589a3f sink,source: Add a helper function to check whether this is a filter 2015-06-12 12:43:18 +05:30
David Henningsson
cbc0d5ffcb echo-cancel: Add config.h in adrian-aec.c
This fixes a compiler warning on some platform.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90881
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-06-12 12:42:59 +05:30
Arun Raghavan
1beec62c2d rescue-streams: Fix a couple of typos 2015-06-10 16:53:07 +05:30
Arun Raghavan
21b912dd2b rescue-streams: Document a cryptic looking condition 2015-06-10 16:53:07 +05:30
Juho Hämäläinen
2a33abb156 Revert "Warn on loading module-dbus-protocol"
This reverts commit e2a433b222.

Events are now handled using hooks instead of asynchronous subscription
system.
2015-05-21 10:25:29 +02:00
Juho Hämäläinen
43f5a00fcb dbus: Use hooks for module proplist changes 2015-05-21 10:24:52 +02:00
Juho Hämäläinen
ae415b07a0 dbus: Use hooks for module new and removed events 2015-05-21 10:24:16 +02:00
Juho Hämäläinen
7e0d0b8b00 dbus: Use hook for sample cache proplist changes 2015-05-21 10:20:35 +02:00
Juho Hämäläinen
4e8a62c3c2 dbus: Use hooks for sample cache new and removed events 2015-05-21 10:17:26 +02:00
David Henningsson
5598923b8e alsa-mixer: Make line out path unavailable when "Front Headphone" is plugged in
This case was apparently overlooked.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-05-05 16:48:11 +02:00
Tanu Kaskinen
2737985f27 oss: Use the correct fd when interacting with the mixer
Adapted from a FreeBSD patch:
http://svnweb.freebsd.org/ports/head/audio/pulseaudio/files/patch-src_modules_oss_module-oss.c?revision=372768&view=markup
2015-04-30 13:21:02 +03:00
Arun Raghavan
3f0ab4522a udev: Deal with unavailable bus property
Fixes a compiler warning:

../../src/modules/udev-util.c: In function 'pa_udev_get_info':
../../src/modules/udev-util.c:228:443: warning: 'bus' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
2015-04-13 08:35:53 +05:30
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
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
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
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
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
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
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
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
Peter Meerwald
037fdf485f tagstruct: Distinguish pa_tagstruct_new() use cases
pa_tagstruct_new() is called either with no data, i.e. (NULL, 0)
to create a dynamic tagstruct or with a pointer to fixed data

introduce a new function pa_tagstruct_new_fixed() for the latter case

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:23:17 +01:00
Alexander E. Patrakov
7c223a6565 echo-cancel: fix the obviously-wrong "buffer+=buffer" logic
Same bug as in module-loopback, pointed out by Georg Chini in a private
email.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-02-26 10:00:17 +05:30