Commit graph

1845 commits

Author SHA1 Message Date
Peter Meerwald
c87fd823ea pipe: whitespace and log output cleanup 2012-05-29 09:03:11 +05:30
Frédéric Danis
21b1d92b79 bluetooth: Fix crash on disconnection
When a Bluetooth headset is connected only to HFP profile (not connected
to A2DP) and host streams to it, a crash occurs if host disconnects.

When HFP disconnects, audio thread will fail on POLLHUP then generate
a message to set PA profile to Off before ending.
If this message is managed before PA unload bluetooth device module,
all works fine.
But, if this message is managed during module unload, this finish by
re-entrance in release code (stop_thread) and a crash.

This fix prevents to process profile change when module is unloading.
2012-05-16 06:26:00 +03:00
Lennart Poettering
87ae830705 auth: move cookie file to ~/.config/pulse/cookie
In order to follow XDG basedir, read the cookie file from
~/.config/pulse/cookie if possible, but fall back to the old file.
if it doesn't exist.
2012-05-15 23:59:33 +02:00
Lennart Poettering
77c5901df2 build-sys: remove HAL support, it's obsolete since years 2012-05-15 16:06:42 +02:00
Lennart Poettering
08d4f8e2c3 build-sys: readd stub makefiles to subdirectories to make building with emacs easier 2012-05-15 14:17:58 +02:00
Paul Menzel
e54b0fa6c9 Correct spelling of PulseAudio
• s,Pulseaudio,PulseAudio,
• One last occurence of this “error” is in the French translation.
2012-05-11 18:25:36 +05:30
Arun Raghavan
ec316b04ac bluetooth: Fix crash due to usage of pa_bool_t instead of dbus_bool_t
pa_bool_t and dbus_bool_t cannot be used interchangably since their size
might (and do) vary. This caused a crash on some systems which was
reported and root caused by: Aidan Thornton <makosoft@googlemail.com>.

Ref: https://bugs.gentoo.org/show_bug.cgi?id=398097
2012-05-11 17:32:20 +05:30
Tanu Kaskinen
7bb8442c11 alsa: Add support for sound cards with 4-channel input.
Changes in v2:
 - Call the mapping a generic 4-channel input mapping
   instead of a 4-channel mic array mapping. The mapping
   will be used also by sound cards that have two stereo
   input jacks, so in those cases talking about mic arrays
   is wrong.
 - Added a comment about using the "hw" device name.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45813
2012-05-11 16:55:29 +05:30
Tanu Kaskinen
a0879ac3f6 echo-cancel: Clarify function call contexts. 2012-04-27 11:37:39 +03:00
Tanu Kaskinen
aca1c4001d echo-cancel: Fix memblockq length check.
In addition to changing "plen > u->blocksize" to "plen >=
u->blocksize", I also removed one of the duplicated ifs.
2012-04-27 11:37:26 +03:00
Tanu Kaskinen
af78613b70 echo-cancel: Drop the correct amount of samples when skipping. 2012-04-27 11:36:56 +03:00
Peter Meerwald
202b7e3abb echo-cancel: Upper/lowercase in comment. 2012-04-17 18:15:03 +03:00
Peter Meerwald
0033509019 dbus: Fix dbus argument type in iface-stream.c handle_move().
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48376
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-04-17 18:14:27 +03:00
Colin Guthrie
e1d551f364 alsa: Add the DTS/DCA mapping to extra-hdmi.conf too.
This is needed for 0b421f on Intel/NVidia hardware.
2012-04-15 13:43:14 +01:00
David Henningsson
6961d3e1c7 alsa-sink/source: Make sure volumes are synchronised after fast user switching
Log in as user A, fast user switch to user B, let user B change
port, volume or mute status, then switch back to user A.

At this point we must make sure that the ALSA and PA volumes are
synchronised by writing to the ALSA mixer when the ALSA device
becomes available.

BugLink: https://bugs.launchpad.net/bugs/915035
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-04-12 00:13:11 +02:00
David Henningsson
87edc1ccb0 alsa-sink/source: Really set volumes on port change
If deferred volumes were activated, set_volume does not really set
the volume, and is probably only meant to be called from the main
thread.
As we're currently really setting the port and the mute here (i e
modifying ALSA), we should really modify the volume as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-04-04 14:36:43 +02:00
David Henningsson
e815a1f81a module-loopback: Reset process_msg callbacks in teardown
Make sure we can't be called into by remaining references to
sink-inputs and source-outputs after we have unloaded, as
that will likely lead to segfaults.

Thanks to Tanu for providing valuable input on this patch.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-04-04 09:04:12 +02:00
Frédéric Dalleau
b762f4eef1 loopback: Fix crash on error during init
If an error during pa__init() causes a jump to fail: u->asyncmsgq is not
initialized.
2012-04-02 17:47:04 +03:00
Tanu Kaskinen
8747930747 device-manager: Add an assertion to get rid of a warning from Coverity.
Coverity thinks that device_name can be NULL when it's
dereferenced by strcmp. Adding an assertion doesn't hurt
here (in my opinion), and that should get rid of the
warning.
2012-03-28 17:34:01 +03:00
Tanu Kaskinen
9d640e4491 dbus: Add an assertion to get rid of a warning from Coverity.
Coverity thinks that sample can be NULL when it's
dereferenced after this line. Adding an assertion doesn't
hurt here (in my opinion), and that should get rid of the
warning.
2012-03-28 17:33:29 +03:00
Tanu Kaskinen
5a26404f12 alsa: Fix SND_MIXER_SCHN_LAST related stuff.
Valid channel id range is from 0 to SND_MIXER_SCHN_LAST,
inclusive, so the size of the masks array in pa_alsa_element
has to be SND_MIXER_SCHN_LAST + 1. Similar "too small"
arrays were also in alsa-sink's and alsa-source's userdata,
but actually those arrays were not used at all so they were
removed.

element_is_subset() in alsa-mixer.c skipped the last channel
id when iterating the element masks array; that's now fixed
as well.

Thanks to David Henningsson for spotting the too small
arrays in alsa-sink and alsa-source and the
element_is_subset() problem.
2012-03-28 17:32:04 +03:00
Tanu Kaskinen
191d60688d device-manager: Fix a memory leak. 2012-03-28 17:23:05 +03:00
Tanu Kaskinen
bce720c85d dbus: Fix device latency querying. 2012-03-28 17:21:59 +03:00
Maarten Lankhorst
3116547662 module-jack-sink/source: Set fixed latency correctly on creation
Changes since v1:
Use max value of jack_port_get_latency_range to calculate the latency
and squash compiler warnings cased by using jack_port_get_total_latency

Modifying latency only works inside a callback, and for hardware the
latency is generally fixed on jack, so just take the max value.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-03-28 13:19:47 +02:00
David Henningsson
6e449eca9a Fix input device for M-audio fasttrack pro
Some M-audio fasttrack pro devices, the input device is at index 1 instead of index 0.
According to
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-March/050701.html
the reason for this is probably that the device has mutually exclusive
analog and digital input. With this patch we can catch the input regardless
of state.

BugLink: https://bugs.launchpad.net/bugs/569932
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-28 13:19:46 +02:00
David Henningsson
f1a36e84a7 alsa-mixer: Fix a small issue when detecting required-any
If somebody writes the line "required-any=ignore", that shouldn't
mean a required-any element needs to be present for the path to
succeed probing.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-26 10:45:52 +02:00
David Henningsson
2577cc81b3 alsa-mixer: Show HDMI ports for older Nvidia cards
Some older cards do not have jack detection. This patch makes the
port still show up.
An implementation detail: the "required = ignore" line has in itself
no effect, but we have to write *something* there, or else the entire
jack detection section will be ignored by the parser.

BugLink: https://bugs.launchpad.net/bugs/961286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-26 10:31:47 +02:00
Deng Zhenrong
737a6180d4 fix compilation warning via PRI prefix
modules/alsa/alsa-mixer.c:3110:21:
    warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'pa_channel_position_mask_t' [-Wformat]
modules/alsa/alsa-mixer.c:3110:21:
    warning: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'pa_channel_position_mask_t' [-Wformat]

pa_channel_position_mask_t is type defined to uint64_t, and to display
uint64_t, it's better to use PRIx64 primitives.

Signed-off-by: Deng Zhenrong <dzrongg@gmail.com>
2012-03-23 10:37:23 +01:00
Tanu Kaskinen
4502d7cb28 bluetooth: Remove unused variable. 2012-03-22 19:39:46 +02:00
David Henningsson
1f97db720b module-switch-on-port-available: Do not switch profile if current port is available
For switching profiles, we are a little more cautious, only switch
from an unavailable port to an available one. Profile switching is
mainly used for HDMI/DisplayPort, and this is to avoid switching from
analog to HDMI/DP when it becomes available.

See http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-March/012991.html
and replies for more information.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-21 10:35:09 +01:00
David Henningsson
00c3a4958e module-loopback: Never call adjust_rates after teardown
Calling adjust_rates after teardown results in segfault, and
judging from the Ubuntu bug report, this can happen.
Actively prevent this by destroying the time event, and by
setting adjust_time to 0, we also prevent this routine being
called on max request update.

BugLink: https://bugs.launchpad.net/bugs/946400
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-20 11:44:15 +01:00
Lennart Poettering
860d1cf3a7 systemd: complement module-console-kit with module-systemd-login
ConsoleKit has been deprecated and replaced by systemd's logind daemon,
hence provide the same functionality of module-console-kit in
module-systemd-login. This also makes sure that the CK module becomes a
NOP if the system is booted with systemd, resp. that the systemd module
becomes a NOP if the system is booted without systemd, thus being nice
to OSes such as Debian which want to support multiple init systems.
2012-03-17 01:52:41 +01:00
David Henningsson
fa80315b2c alsa-mixer: Don't remove paths if jacks state.(un)plugged differ
If the jack state differs, they are not the same path, so don't
remove them.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-12 10:49:50 +00:00
Giorgos Boutsioukis
50a7bf1175 xen: Add Xen paravirtualized sink support.
A part of Xen's paravirtualized audio driver has been developed as a
pulseaudio module. This module acts as a tunnel over Xen's shared memory
mechanism and allows a domU guest to send audio data to a dom0 backend.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=43503
2012-03-11 21:15:14 +00:00
David Henningsson
e02cb7fb2e alsa-mixer: Make speaker get available=no when headphones are plugged in
While developing the new UI we had to ask ourselves the question of whether
"speakers" should be considered available when headphones are plugged in.
In most cases, they are not available and therefore we should list them
as such.

OTOH, we don't want unplugging the headphones to be considered an act of
wanting to use the speakers (the user might prefer HDMI), and there might
be line-outs that keeps the speakers from unmuting anyway. So, at this point,
I think the most reasonable would be to make the speakers have
PA_PORT_AVAILABLE_NO when headphones are plugged in and
PA_PORT_AVAILABLE_UNKNOWN when they are not. But we might want to revisit
this decision once we have the priority lists up and running.

The same reasoning applies for "Internal Mic", which should become unavailable
when any other mic is plugged in.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
d1ce4c0aea Add a new module switch-on-port-available that acts on port changes
This module tries to switch to a port when availability changes to
"YES", and tries to switch away when availability changes to "NO".

Once there is a priority list infrastructure in place and ready,
this functionality might be redundant, but this will do as an
interim solution.
2012-03-11 12:23:46 +05:30
David Henningsson
56018683b1 alsa: Add port information to HDMI profiles
For Nvidia and Intel, support probing of up to four HDMI devices.
Also add port information to all HDMI profiles.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
dedf1340c6 alsa: Jack detection kcontrol implementation
Support the new jack detection interface implemented in Linux 3.3
(and Ubuntu's 3.2 kernel).

Jacks are probed and detected using the snd_hctl_* commands, which
means we need to listen to them using fdlists. As this detection
needs to be active even if there is currently no sink for the jack,
so this polling is done on the card level.

Also add configuration support in paths, like this:
[Jack Headphone]
required-any = any

...where 'Jack Headphone' should match 'Headphone Jack' as given by
ALSA (as seen in e g 'amixer controls').
"Required", "required-any" and "required-absent" is supported. Using
required-any, one can have several ports even though there is no
other indication in the mixer that this path exists.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
Niels Ole Salscheider
6a9caff9dd Add module-virtual-surround-sink.
It provides a virtual surround sound effect.

v2: Normalize hrir to avoid clipping, some cleanups
v3: use fabs, not abs
v4: implement changes proposed by Tanu Kaskinen
v5: likewise
v6: use channel map from hrir file
v7: remove hrir_ss and hrir_map form userdata
v8: update naming of sink
2012-03-09 07:20:13 +02:00
Colin Guthrie
3927b4b607 bluetooth: Run update-sbc
This is primarily for the bluez commit 03bb9d3 by Siamashka Siamashka
which fixes a compilation error with gcc 4.7
2012-02-24 21:22:41 +00:00
Alexander E. Patrakov
0b421f0d93 alsa: add DTS profile
Hi. Could you please apply the attached trivial patch so that I could drop
the corresponding instructions from dcaenc's README file in the future? It
adds a profile for on-the-fly DTS encoding, similar to the existing AC3
profile.

--
Alexander E. Patrakov
>From 22310a1c28385acc7ce883e020b9eb2e5b0813b7 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 12 Feb 2012 17:19:48 +0600
Subject: [PATCH] alsa: add DTS profile

This requires dcaenc from http://aepatrakov.narod.ru/dcaenc/
2012-02-21 08:52:13 +05:30
Luiz Augusto von Dentz
014511310a bluetooth: Fix calling many times Audio.GetProperties for the same device
Audio.GetProperties is been called for as many times as there are UUIDs
instead of just once when the UUIDs are discovered.
2012-02-21 08:36:21 +05:30
David Henningsson
811235d14c tunnel: fixup create_record_stream
The tunnel source has been broken since protocol v22 (PA 1.0),
and connecting fails with a protocol error. Fix.

BugLink: https://bugs.launchpad.net/bugs/923661
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-02-20 14:29:15 +05:30
David Henningsson
13a84d0747 alsa-mixer: Don't use dangling pointers as port hashmap keys
If alsa settings/options were used, the string to construct the
name was freed, leading to dangling pointers to strings inside
the hashmap.

BugLink: https://bugs.launchpad.net/bugs/932804
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-02-19 22:45:41 +05:30
Tanu Kaskinen
9c84f1274e virtual-sink: Remove irrelevant comment.
The comment is inherited from module-ladspa-sink. It
doesn't make sense in module-virtual-sink.
2012-02-12 16:23:17 +02:00
Peter Meerwald
db8fa449e4 alsa: fix comment 2012-02-10 17:21:31 +05:30
Arun Raghavan
89a49d9611 loopback: Trivial whitespace fix 2012-02-07 14:03:47 +05:30
Frédéric Dalleau
d0f1a3a770 loopback: Fix crash when moving sink-input fails 2012-02-07 14:03:28 +05:30
David Henningsson
91b2500597 alsa-mixer: Take override-maps into account in subset elimination
The practical problem is that some users were left with only one
"LFE on Mono" port, as analog-output was considered a subset of
analog-output-lfe-on-mono. Which was not what they wanted.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=40910
BugLink: https://bugs.launchpad.net/bugs/922656
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-02-02 12:41:51 +00:00
David Henningsson
43a705ae18 alsa-mixer: Make sure unsupported paths are removed after probing
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-01-30 11:17:08 +00:00