Commit graph

1703 commits

Author SHA1 Message Date
David Henningsson
c505053452 Fix deferred volume not being applied if sink is closed
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-10-17 09:51:45 +05:30
Arun Raghavan
93f55a42f9 filter-apply: Move sink/source unlink callbacks before m-s-r
module-stream-restore and modile-filter-apply can get into an infinite
loop if m-s-r is called before m-f-a (m-s-r rescues a stream and
attaches it to a sink/source, which then triggers m-f-a to move it back
to the filter sink/source, and so on). The purpose of the m-f-a hooks is
to beat m-s-r, so moving them to be run first.
2011-10-17 09:46:40 +05:30
Arun Raghavan
7b13a79959 echo-cancel: Close debug files on module unload 2011-10-11 20:19:10 +05:30
Arun Raghavan
8a5e6e8356 echo-cancel: Don't crash if adjust_time = 0 2011-10-10 13:35:57 +05:30
David Henningsson
17875ecd5c module-jackdbus-detect: Avoid double-free of modargs
If module-jackdbus-detect failed in the later part of initialization,
the ma variable was freed twice.

BugLink: http://bugs.launchpad.net/bugs/867444
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-10-08 15:17:42 +05:30
Arun Raghavan
2c30c0751f alsa: Make mixer error handling more robust still
Instead of relying on the snd_mixer_* functions failing, we check for
POLLERR and POLLNVAL first. After this, any errors in handling the mixer
events are deemed fatal (that is we cause the ALSA source/sink thread to
terminate).

The case where POLLERR is set but POLLNVAL is not does not actually
occur, but we're making this a soft failure (stop polling the mixer, but
don't kill the I/O thread). If other conditions where POLLERR occurs
turn up, we need to handle them explicitly.

Thanks to Linus Torvalds for helping get this right.
2011-10-08 15:17:35 +05:30
Arun Raghavan
c055c55fbc echo-cancel: Fail if loaded between a sink and its monitor
Loading between a sink and its monitor causes a deadlock (while sending
messages for latency snapshots). It isn't a case that has any real
conceivable use, so let's just disallow it.
2011-10-08 15:17:15 +05:30
Arun Raghavan
867170afa7 alsa: Better error handling in mixer rtpoll callback
This improves the error handling in the mixer rtpoll callback. It avoids
a crash if an error occurs (the rtpoll_item is freed but still
referenced), and specifically makes sure we don't continue trying to
poll the device if the card is disconnected.
2011-10-08 15:16:59 +05:30
Arun Raghavan
4e5943b6ba alsa: Give compressed formats preference over PCM
This makes set_formats() put PCM formats lower down the list than
compressed formats since we negotiate by picking the first format in
this list that is also in the client-provided list of possible formats
during sink input creation.

This will be incorrect if we ever decide to do encoding in PA (for
things like AC3/DTS encoding for multichannel output over S/PDIF).
2011-10-08 15:16:51 +05:30
Sudarshan Bisht
87f70c6a1d null-sink: Set latency range at the time of initialization of module.
At the time of module initialization latency range is being set so that the null-sink
would be aware of its limitations with latencies.
2011-10-08 15:16:18 +05:30
David Henningsson
165bd13d9e dbus: Don't crash if the module does not load
If module-dbus-protocol fails to start, pa__done is still called,
which falsified the assumption that u->connections was always set.

BugLink: http://bugs.launchpad.net/bugs/855729
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-22 23:15:18 +05:30
David Henningsson
f8624a7876 sink,source: Avoid crash by not updating volume on shutdown
Sometimes the ALSA mixer can be modified during a point at shutdown
which causes a race condition trying to update the volume of an
unlinked sink.

Includes typo fix by our Chief Typo Spotter, Colin, and a clarifying
comment by me.

BugLink: http://bugs.launchpad.net/bugs/841968
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-14 15:47:17 +05:30
Arun Raghavan
38be4a2d44 echo-cancel: Use volume sharing by default
Uses the shared volume infrastructure by default with an option to
fallback on the old pretend-volume-sharing-that-kind-of-works if someone
wants it that way.

Users who keep left != right (or any sort of unbalanced channel volumes)
will likely want to disable shared volumes since it will cause their
master sink/source volume to be balanced.

This really isn't a very pleasant scenario since users would need to
manually set up echo cancellation in their config for this (until we
have a way to store module configuration). That said, the majority case
benefits from the volume sharing, so let's not wait for the
configuration infrastructure to be ready to use this.
2011-09-14 14:15:01 +05:30
Arun Raghavan
ec099f9306 equalizer: Use volume sharing by default
Uses the shared volume infrastructure by default with an option to
fallback on the old pretend-volume-sharing-that-kind-of-works if someone
wants it that way.
2011-09-14 14:15:01 +05:30
Arun Raghavan
baccd26b6a virtual: Make volume sharing on by default
People who use this code (i.e. mostly filters) would presumably want
volume sharing on by default.
2011-09-14 14:15:01 +05:30
David Henningsson
f0ad6fd413 raop: Don't crash if fd is not open when trying to close it
BugLink: http://bugs.launchpad.net/bugs/845286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-14 09:23:38 +01:00
Colin Guthrie
aa3142ab20 volume: Rename 'sync volume' to 'deferred volume'.
This just covers Lennart's concern over the terminology used.

The majority of this change is simply the following command:
 grep -rli sync[-_]volume . | xargs sed -i 's/sync_volume/deferred_volume/g;s/PA_SINK_SYNC_VOLUME/PA_SINK_DEFERRED_VOLUME/g;s/PA_SOURCE_SYNC_VOLUME/PA_SOURCE_DEFERRED_VOLUME/g;s/sync-volume/deferred-volume/g'

Some minor tweaks were added on top to tidy up formatting and
a couple of phrases were clarified too.
2011-09-13 21:15:49 +01:00
Colin Guthrie
27343ed79a raop: Properly deal with the name coming from the device.
We need to properly quote our proplist arguments passed to the module.
2011-09-09 19:51:02 +01:00
Antonio Ospite
e93b32744c alsa-mixer: Add support for the Microsoft Kinect Sensor device
The Kinect shows up as a UAC device after the firmware has been loaded,
but in order to be detected by pulseaudio a 4-channels input only
mapping is needed. Provide a new profile for that and set it with a udev
rule.

fdo#39664
2011-09-09 19:48:03 +01:00
Maarten Bosmans
3ebc8f8e88 module-suspend-on-idle: Move vacuum code to core
pa_core_maybe_vacuum now vacuums if there are either no streams or all devices are suspended.
The mempool_vacuum argument to module-suspend-on-idle is gone and defaults to true now.
2011-09-09 09:55:48 +01:00
Colin Guthrie
db704130d6 alsa: Tidy up argument descriptions 2011-09-07 21:16:03 +01:00
Colin Guthrie
69fe26206f bluetooth: Bump DBus version to 1.3.0 and drop conditional code.
We used to support older DBus versions but 1.3.0 is two years old
now and by requiring it we cut down of deviated code paths at
runtime and thus have less support issues.

fdo#40635
2011-09-07 20:33:13 +01:00
Tanu Kaskinen
badc32adb9 loopback: New modargs: sink_input_properties and source_output_properties.
The new modargs replace sink_input_name, sink_input_role,
source_output_name and source_output_role.
2011-09-07 20:31:50 +01:00
Colin Guthrie
d36a9df63c raop: Use the port supplied by avahi when connecting to RAOP devices.
The Apple TV for example uses a non-default port, but we previously ignored
this. We now correctly parse the server string but in so doing, we end up
parsing the address twice. As we need a pure IP/hostname of the device itself
to use in our requests, this is somewhat unavoidable.

Sadly there are still other problems with Apple TVs, but this is still
one step closer.

Fixes part of #950
2011-09-05 22:23:17 +01:00
Colin Guthrie
8e298848be device-restore: Fix use-after-free error. 2011-09-05 20:29:36 +01:00
Colin Guthrie
2b96fdfd25 stream-restore: Add proper data validity checks to the legacy database entry read. 2011-09-04 12:54:41 +02:00
Colin Guthrie
e7b65d310d stream-restore: Add in some variable sets that were missing from 9ffa93.
This broke the conversion of the stream-restore database from
previous versions.
2011-09-04 12:28:07 +02:00
Colin Guthrie
47c9d8cf92 device-restore: Simplify the migration of data to per-port keys.
Rather than write all the keys out for each port, simply write a 'null'
port entry and modify the read code to 'fallback' to this when it cannot
find a key. This is needed as the code used when writing the key may not
actually have the sink ports available at the time it uses them,
and thus can cause a segv. This approach adds some degree of overhead
but it's relatively minimal and it can be mitigated by compiling
without support for legacy database formats if so desired.

Thanks to David Henningsson for pointing out the problem.
2011-09-03 12:47:10 +02:00
Maarten Bosmans
9133c6c935 Make gcc --std=c99 happy
We're now more or less C99 compliant
2011-09-03 12:17:28 +02:00
Maarten Bosmans
647048ebc4 module-equalizer-sink: Use correct limit in loop 2011-09-03 12:16:54 +02:00
Maarten Bosmans
3d04a05736 bluetooth/sbc: Use __asm__ keyword 2011-09-03 12:16:49 +02:00
Maarten Bosmans
918f168c15 module-equalizer-sink: Use = in initialising variables
This makes the compiler in C99 mode happy
2011-09-03 12:15:51 +02:00
Maarten Bosmans
fc3ddfb7f5 module-equalizer-sink: Use %z for printf of size_t variables 2011-09-03 12:15:36 +02:00
David Henningsson
96369919e5 alsa-mixer: Set "Front" control to 0 dB on headphone path
I've seen more than one system where the volume control named
"Front" is a part of audio path for headphones. This is somewhat
of a compromise: While we don't merge it into the path, as that
would be regressing machines where "Front" isn't a part of the
audio path, it would still enable sound on these machines.

BugLink: http://bugs.launchpad.net/bugs/804178
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-03 12:14:54 +02:00
David Henningsson
c7bba2464d module-switch-on-connect: Don't switch unlinked sink input and source outputs
Unlinked streams can not be moved, so don't try.

BugLink: http://bugs.launchpad.net/bugs/837386
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-31 18:49:44 +05:30
Arun Raghavan
3fd07a33ee equalizer: Comment out unused function
Gets rid of a compiler warning
2011-08-29 22:14:04 +05:30
Arun Raghavan
394d8a6b6b echo-cancel: Get rid of annoying compiler warnings 2011-08-29 22:13:44 +05:30
Arun Raghavan
837ac4c225 echo-cancel: Don't allow streams to attach while unloading
When unloading, some module may end up trin to move a sink-input or
source-output back onto our virtual sink/source, causing an infinite
loop of us moving the stream away and having it moved back.

We prevent this from happening by preventing any stream from being
attached during unload.
2011-08-29 21:42:57 +05:30
Arun Raghavan
fe52c351c3 echo-cancel: Make save_aec modarg a bool instead of an int 2011-08-29 21:42:57 +05:30
David Henningsson
c862c5caa4 Set better priorities on input paths
The priorities should be set in the approximately likeliness that someone
would like to use them. This is hard to guess of course, but this is
a better guess compared to the existing configuration.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-29 10:05:24 +01:00
Colin Guthrie
a13a402ed3 device-restore: Restore volumes on port change.
This will allow for volumes to be saved separately for e.g. Headphones vs. Speakers.

At present it is possible that no volume will be saved for the device prior to the port
switch. In this case the volume will not change from the value set under the other port.
In an ideal world we would save the volume before switching port, but that would require
a new hook.
2011-08-29 09:59:47 +01:00
Colin Guthrie
1ee97e57ca device-restore: Split device restore database into two parts.
The device restore saves both the current port for a device, and the volume/mute/formats.
The latter three are really related to the device+port, not the device on it's own.

Thus we store just the port for a device in one key and the volume/mute/formats
under a different key that includes both the device and the port.
2011-08-29 09:59:47 +01:00
Maarten Bosmans
55fdb0162c Remove extra ; s where they are not allowed in strict C99 2011-08-25 18:21:49 +05:30
Maarten Bosmans
168254f3bf echo-cancel: Use stream index in debug message
instead of the less useful stream pointer.
2011-08-25 18:19:41 +05:30
Arun Raghavan
7dfb166dba echo-cancel: Move speex preprocessing out of the main module
I initially included put the Speex preprocessing assuming that we'd want
to use the digital gain control and noise suppression from Speex for all
echo cancelling implementations. In practice, we're probably going to
get entire implementations all processing in one package (WebRTC, custom
modules from various vendors, etc.).

This moves out this preprocessing and related knobs into the speex
implementation, which serves to clean out all implementation-specific
details from the module-echo-cancel core.
2011-08-25 18:08:42 +05:30
Arun Raghavan
af6229cbe1 echo-cancel: Use pa_streq instead of strcmp 2011-08-25 17:53:37 +05:30
Arun Raghavan
ba69d66c33 echo-cancel: Add multiple include protection for header 2011-08-25 17:53:37 +05:30
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
David Henningsson
112c300ae1 Fix spelling sucess -> success
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-24 17:38:16 +05:30
David Henningsson
b746e09448 switch-on-connect: Don't switch to a monitor source
Buglink: http://bugs.launchpad.net/bugs/831675
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-24 17:38:05 +05:30