Commit graph

2631 commits

Author SHA1 Message Date
Arun Raghavan
a14db55c2b echo-cancel: Allow enabling the extended filter in webrtc AEC
This creates a longer filter that is more complex and less sensitive to
incorrect delay reporting from the hardware. There is also a
delay-agnostic mode that can eventually be enabled if required.

In some very quick testing, not enabling this seems to provide better
results during double-talk.
2016-02-24 18:43:58 +02:00
Arun Raghavan
f8beaae238 echo-cancel: Update webrtc-audio-processing usage to new API
The code now needs C++11 support to compile with the updated
webrtc-audio-processing library.
2016-02-24 18:43:58 +02:00
Peter Meerwald
571aadfe3b modules: Fix compiler warning comparing 0 with bool
modules/module-stream-restore.c: In function 'clean_up_db':
modules/module-stream-restore.c:2344:74: warning: comparison of constant '0' with boolean expression is always true [-Wbool-compare]
         pa_assert_se(entry_write(u, item->entry_name, item->entry, true) >= 0);

reported by Ubuntu gcc-6

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2016-02-18 14:08:13 +01:00
Sangchul Lee
d049c2941e role-ducking: Fix improper unducking behavior in case of operating globally
Fix improper unducking behavior when using this module with "global=1" argument.

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

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2016-02-18 15:09:14 +05:30
Arun Raghavan
3977a906e2 coreaudio: Catch devices with more channels than we support 2016-02-12 19:34:58 +05:30
Arun Raghavan
cf503f9560 coreaudio: Dynamically allocate C string when converting from CFString 2016-02-12 19:34:58 +05:30
Jungsup Lee
2086fc82b6 rescue-streams : Fix a typo
Fix a typo in log message.

Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
2016-02-02 14:56:36 +05:30
Tanu Kaskinen
323dc5bfb9 device-manager: improve logging about non-existing data
Previously a missing key would cause this kind of log output:

D: [pulseaudio] module-device-manager.c: Database contains invalid data for key: sink:auto_null (probably pre-v1.0 data)
D: [pulseaudio] module-device-manager.c: Attempting to load legacy (pre-v1.0) data for key: sink:auto_null
D: [pulseaudio] module-device-manager.c: Size does not match.
D: [pulseaudio] module-device-manager.c: Unable to load legacy (pre-v1.0) data for key: sink:auto_null. Ignoring.

That is now replaced with

D: [pulseaudio] module-device-manager.c: Database contains no data for key: sink:auto_null
2016-01-26 15:46:20 +02:00
Jonathan Perkin
68216e8ff8 solaris: Catch up with newer API
Patch upstreamed from pkgsrc by Kamil Rytarowski <n54@gmx.com>.

See commit e4a7625ba8 for why this was
originally done.
2016-01-22 13:25:29 +05:30
Jason Gerecke
00ba340618 bluetooth: Prevent aborts caused by invalid module arguments
If 'pa_modargs_new' returns a NULL, we need to be careful to not call
'pa_modargs_free' in the failure path since it requires that we pass it
a non-null argument. Also updates 'module-bluetooth-policy.c:pa__init'
to follow the standard "goto fail" pattern used everywhere else.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
2016-01-15 16:20:53 +05:30
KimJeongYeon
19c71ce851 module-tunnel: Fix double free
Local pointer 'dn' freed again when pa_thread_new() failed.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
2016-01-07 17:59:15 +05:30
Mihai Moldovan
403ba1e676 module-coreaudio-device: get channel name as CFString and convert to plain C string.
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
The old code fetched the channel name via AudioObjectGetPropertyData()
and accessed the "returned" data as a plain char buffer.

This may or may not have worked at some point according to the Apple
CFString documentation, which warns that the actual data layout is an
implementation detail and subject to change at any time.

On recent OS X versions, this behavior led to "random data" channel
names like >H��{, H��{<.

We need to actually let AudioObjectGetPropertyData() populate a CFString
struct and convert this into a plain char buffer.

The conversion function will not free the CFString, so do that in the
caller.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
2016-01-04 12:39:21 +05:30
Arun Raghavan
810aa36189 alsa: Don't disable timer-based scheduling on USB devices
This isn't a great fix, but we need ALSA API to do this right. In the
mean time, USB devices work fine with timer-based scheduling, so there's
no reason to force a large minimum latency by disabling tsched on them.
2015-12-29 06:00:14 +05:30
Tanu Kaskinen
e8d5a6af1e always-sink: simplify hook management with pa_module_hook_connect() 2015-12-21 05:37:28 +02:00
Georg Chini
fc803b4883 loopback: Validate the rate parameter 2015-12-18 07:35:15 +02:00
Arun Raghavan
12b5e7c873 echo-cancel: Don't skip canceller when sink is inactive
This forces the canceller engine to be invoked even if playback is not
currently active. We need to do this for cases where the engine provides
additional processing that is independent of playback, such as noise
suppression and AGC.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83557
2015-12-15 17:09:31 +05:30
Tanu Kaskinen
1d7ce90139 conf-parser: add support for .d directories
This allows a configuration scheme where after loading configuration
from "somefile", the parser loads configuration from files in
directory "somefile.d". This feature needs to be enabled on a per-file
basis, though, and this patch doesn't yet enable the feature for any
files.
2015-12-14 13:45:39 +01:00
Juho Hämäläinen
f61a16b8b1 alsa-mixer: Have valid proplist for synthesized path as well.
When synthesized alsa path is freed there is an assert from NULL
proplist. Create empty proplist for the path to fix.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@nomovok.com>
2015-12-11 10:05:41 +01:00
Kamil Rytarowski
93cccdee8d core, pulse, modules: Fix undefined behavior with array subscript of invalid type
From the NetBSD manual:

     The first argument of these functions is of type int, but only a very
     restricted subset of values are actually valid.  The argument must either
     be the value of the macro EOF (which has a negative value), or must be a
     non-negative value within the range representable as unsigned char.
     Passing invalid values leads to undefined behavior.

     --  ctype(3)
2015-12-08 08:56:07 +05:30
Kiran Krishnappa
96b368b960 module: Remove redundant core argument from pa_module_unload()
pa_module_unload() takes two pointers: pa_module and pa_core.
The pa_core pointer is also available via the pa_module object,
so the pa_core argument is redundant

[David Henningsson: Rebased to git HEAD]
2015-12-07 09:31:58 +01:00
Alexander E. Patrakov
04737989ec alsa-sink: Don't pretend to support passthrough on HDMI surround sinks
It doesn't work currently (fails and falls back to PCM), due to channel
count mismatch between the sink sample spec and the sample spec required
by IEC61937.

To be reverted when someone implements changing channel count without
switching profiles. This would also be required for HBR passthrough over
HDMI.

Reported-by: Xamindar <junkxamindar@gmail.com>
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-12-04 17:40:24 +05:30
Nazar Mokrynskyi
30a9523b75 alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support
In 2.1 mode LFE is not actually working at all, so it is removed.
With Linux 4.3-rc1+ Mic/Line are hw:%f,0,0 as it should be: https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=5ee20bc792467d7d612157e0a9962765aa943b08
So now we support both Linux 4.2.x- and 4.3-rc1+ setups.
Also in Linux 4.3-rc1 S/PDIF input was detected incorrectly (there is no such hardware input), so it is not present in config.
2015-11-26 18:31:48 +01:00
David Henningsson
bea37613ce module-card-restore: Remove "version" from internal entry struct
If we always write entries of the latest version, we can simplify
code a little by only handling old versions in the "entry_read"
function and assume we have the latest version everywhere else.

Suggested-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:32 +02:00
David Henningsson
e87100d41e module-switch-on-port-available: Route to preferred profile
This makes the routing slightly more aggressive:

 * It will try to route to another profile, if such a profile
   is preferred by the port.

 * It will allow changing profiles on transitions both to
   PA_AVAILABLE_YES and PA_AVAILABLE_NO

To accommodate there is also some refactoring.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:30 +02:00
David Henningsson
063a1d350f module-switch-on-port-available: Use input and output names
In case input or output names are filled in, we can use this to
get a better match in the profile_good_for_input/output functions
instead of guessing based on number of sources and channels.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:29 +02:00
David Henningsson
9059fb3b4e card-restore: Save and restore "preferred profile" of port
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:27 +02:00
David Henningsson
2a71fd7597 alsa-mixer: Fill in input and output names
Fill in input_name and output_name to make routing easier for
routing modules.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:21 +02:00
Arun Raghavan
a01354db00 tests: Make echo-cancel-test not crash
Adding AGC broke this test, so we hard-disable the volume code in test
mode. This is probably okay for now, since at least with analog AGC, the
source volume changes and the data we get is going to be with AGC
applied, but digital gain won't be encapsulated here.

Long term, we might need to figure out how to deal with this properly.
2015-11-20 19:24:50 +05:30
Arun Raghavan
d084cf144a alsa: Use helper function for byte conversion across sample specs 2015-11-20 17:34:38 +05:30
David Henningsson
107dfa8e01 alsa-mixer: Return early in case of no mixer poll descriptors
We encountered an alsa plugin a while ago (not sure if the source
can be shared) which had mixer controls, but no descriptors to
poll for changes.

Quit early to avoid latter assertion failures.

BugLink: https://bugs.launchpad.net/bugs/1092377
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-17 09:30:58 +01:00
Zbigniew Kempczyński
f621aa5e2c alsa-sink: Avoid unloading alsa-sink module before calling try_recover()
This fixes rare condition when pulseaudio client tries to rewind,
but a device previously reached underrun and was changed to XRUN state.
2015-11-14 09:50:34 +05:30
David Henningsson
a6bc996dc1 alsa-mixer: Add "Front Headphone" to headset mic path
The combination "Front Headphone" + "Headset Mic Phantom"
was found on one the machines we enable. Without this patch,
the headset mic appeared plugged in when nothing was plugged
into the jack.

BugLink: https://bugs.launchpad.net/bugs/1513384
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-06 15:30:30 +01:00
Lev Melnikovsky
9d2b763e29 rtp: fix non null terminated string / non portable sscanf
In rtp.c:

if (sscanf(t+9, "%i %64c", &_payload, c) == 2)

the string c seems to be non-null terminated. It is later used as
following:

c[strcspn(c, "\n")] = 0;

The same piece of code is responsible for the inability of pulseaudio
on OpenWRT to handle RTP stream at the rate 48000 from another
machine:

[pulseaudio] sdp.c: Failed to parse SDP data: missing data.

It turns out that uClibc does not agree with glibc about "%64c", see
http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=92568
2015-11-04 12:45:21 +02:00
Tanu Kaskinen
69af1a713d alsa-ucm: fix pa_device_port.profiles leak
pa_device_port.profiles is initialized in pa_device_port_new(), so no
need to do that in alsa-ucm.c.
2015-10-26 10:14:57 +01:00
Georg Chini
2902cdc4ca null-sink: correct update of timestamp when state changes to RUNNING or IDLE
u->timestamp should be reset to "now" when the sink state changes from
INIT or SUSPENDED to IDLE or RUNNING.
Thanks to Olivier Delbeke for reporting the bug and testing the patch.
Bug report is here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024553.html
2015-10-25 16:36:51 +02:00
David Henningsson
fcbbe34e00 alsa-mixer: Ignore volume with unexpected number of channels
We currently only support one and two channels for volumes, and
bail out otherwise. This makes Xonar users unhappy because they
have a volume with eight channels, and bailing out means they
don't have a path/port at all.

This way they will at least have a port, which will in turn make
the gnome/unity UI behave better.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=84983
BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=745017
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-23 14:40:55 +03:00
David Henningsson
91313e60a8 module-alsa-card: Report available ports before unavailable ones
In case the same jack causes one port to become available and another
one unavailable, the available should be reported first.

This is to avoid unnecessary changes: e g, consider a 'Headphone Jack'
making 'Headphone' available and 'Speaker' unavailable. In case the
unavailable change triggers first, and there is also a currently available
third port (e g 'Digital out'), the routing system might choose to route
to this port because neither of the 'Speaker' and 'Headphone' ports are
available.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-20 13:13:03 +03:00
John Horan
f8cd444de0 make availability of ports visible over dbus 2015-10-19 11:02:44 +02:00
Juho Hämäläinen
2261567758 dbus: Add card profile availability info to API
[diwic: Profile availability to boolean bug fixed]
2015-10-19 10:57:35 +02:00
Tanu Kaskinen
e061f9afd2 alsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always
The jack is already in analog-output-speaker, so let's have the same
handling in analog-output-speaker-always too.
2015-09-25 15:05:43 +03:00
Takashi Iwai
4a9916ba15 alsa-mixer: Recognize "Dock Line Out" jack
Some machines provide "Dock Line Out Jack" control that should be
handled like a normal line out.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-25 15:05:43 +03:00
Manish Sogi
ff24ea7695 bluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in bluez4
<EP-F69A421D31544C56BDE97C590307C014>
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
2015-09-25 15:05:43 +03:00
David Henningsson
4a8bf9ab30 alsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf
I'm not sure how much they are needed nowadays with the latest
changes to the subset elimination (I found this while
researching a bug on an older PA version), but I guess they could
be added for consistency at least.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-25 15:05:43 +03:00
Deepak Srivastava
2d5eec2d2c Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.
component: core

<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-09-25 17:29:02 +05:30
Peter Meerwald
3193f6a2c4 modules: Fix entry leak in module-card-restore
CID 1323585

entry_read() allocates an entry which must be freed
2015-09-16 08:10:35 +02:00
Alexander E. Patrakov
c7310f8e37 loopback: Fix the obviously-wrong "buffer+=buffer" logic
Originally pointed out by Georg Chini.

Calculating buffer = buffer + (send_counter - recv_counter)
in one branch and buffer = 2 * buffer - (recv_counter - send_counter)
looks very obviously wrong. In other words, before the patch, the
contribution from the previous lines was double-counted.
2015-09-13 19:24:10 +03:00
Tanu Kaskinen
031ca87821 alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-40 mapping
It was reported that the 4.0 mode doesn't work properly:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23677/focus=23904
2015-08-28 08:27:03 +03:00
Tanu Kaskinen
9083750fc8 alsa-mixer: sb-omni-surround-5.1.conf: rename analog-stereo to analog-stereo-output
The mapping is only useful for output, and this renaming makes the
name symmetric with the input mapping.
2015-08-28 08:26:48 +03:00
Nazar Mokrynskyi
b7744e5004 alsa-mixer: Add support for Creative SoundBlaster Omni Surround 5.1 USB sound card
Mic and Line in inputs were not working at all, since they use the
hw:x,1,0 device, which is not supported in the default configuration.
2015-08-28 08:26:39 +03:00
Arun Raghavan
f506203fcd alsa: Clarify potentially confusing device port data field
The meaning of the code is unchanged here, but it is clearer that the
PA_DEVICE_PORT_DATA field is a struct ucm_port pointer.
2015-08-25 21:12:05 +05:30