]> code.delx.au - pulseaudio/log
pulseaudio
11 years agobuild-sys: Bump soname
Arun Raghavan [Mon, 17 Dec 2012 09:00:09 +0000 (14:30 +0530)]
build-sys: Bump soname

11 years agoalsa-mixer: Add device.icon-name property for some common ports
David Henningsson [Fri, 7 Dec 2012 15:37:23 +0000 (16:37 +0100)]
alsa-mixer: Add device.icon-name property for some common ports

If we expose this information, UIs can use this to make better
decisions about what icon to display.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agobuild-sys: Bump soname
Arun Raghavan [Wed, 5 Dec 2012 03:51:58 +0000 (09:21 +0530)]
build-sys: Bump soname

11 years agoalsa-mixer: Add Dell Inspiron One 2020 to mic whitelist
David Henningsson [Wed, 5 Dec 2012 13:34:54 +0000 (14:34 +0100)]
alsa-mixer: Add Dell Inspiron One 2020 to mic whitelist

BugLink: https://bugs.launchpad.net/bugs/1073420
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa udev quirks: Add some more Dell devices to speaker whitelist
David Henningsson [Wed, 5 Dec 2012 13:08:30 +0000 (14:08 +0100)]
alsa udev quirks: Add some more Dell devices to speaker whitelist

Added Dell Inspiron 3420, 3520 and Vostro 2420, 2520.

Note that this is only necessary for kernels 3.3 to 3.5, as 3.6
has phantom jack support.

BugLink: https://bugs.launchpad.net/bugs/1076840
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa: Try to support non-standard rates in alsa-sink/source
Arun Raghavan [Mon, 3 Dec 2012 05:57:27 +0000 (11:27 +0530)]
alsa: Try to support non-standard rates in alsa-sink/source

We inadvertantly stopped supporting non-standard rates when the
passthrough work was done. This makes sure that if no standard rates are
supported, we try to fallback to whatever ALSA gives us.

11 years agobluetooth: Fix unacquired transports during sink resume
Mikel Astiz [Wed, 28 Nov 2012 18:20:58 +0000 (19:20 +0100)]
bluetooth: Fix unacquired transports during sink resume

The sink can be resumed while the source is still in PA_SOURCE_INIT.
This is the case if a module such as module-stream-restore routes the
audio to the sink during pa_sink_put(), leading to an inconsistent
state: the sink stays RUNNING but the transport is not actually
acquired.

11 years agobluetooth: Request headset audio during profile switch
Mikel Astiz [Mon, 3 Dec 2012 10:03:59 +0000 (11:03 +0100)]
bluetooth: Request headset audio during profile switch

When a headset is having a profile switch, we can either leave the
SCO state unmodified (as it was before this patch) or we can
alternatively request it (as older versions of PA).

This patch tries to avoid a potential regression in case a module
such as module-suspend-on-idle is not present, due to the provided
resume-on-running policy. Without this patch, and without such a policy,
the sink and sources would stay suspended until the user manually
performed another profile switch (i.e. hsp->off->hsp).

There are several other solutions currently being discussed as a longer
term solution, some of which require extendind the core. This patch is
therefore proposed as a short-term workaround to avoid the regression.

11 years agobluetooth: Do not setup stream before thread starts
Mikel Astiz [Mon, 3 Dec 2012 10:03:58 +0000 (11:03 +0100)]
bluetooth: Do not setup stream before thread starts

bt_transport_acquire() might get called from the main thread, in case
the IO thread hasn't been started yet. In this case, we should not call
setup_stream() since this is going to be called in the beginning of
thread_func().

11 years agobluetooth: Trivially refactor to call setup_stream() directly
Mikel Astiz [Mon, 3 Dec 2012 10:03:57 +0000 (11:03 +0100)]
bluetooth: Trivially refactor to call setup_stream() directly

If the transport is already acquired and the stream needs to be started,
call setup_stream() directly instead of bt_transport_acquire(u, TRUE).
Both calls are identical in these conditions, with the exception of the
log trace which has now been moved to setup_stream().

11 years agoconf: Load bluetooth-policy module by default
Mikel Astiz [Mon, 26 Nov 2012 17:32:09 +0000 (18:32 +0100)]
conf: Load bluetooth-policy module by default

Headset use-cases shouldn't get affected by this module and the support
for A2DP source is interesting, therefore load the module by default.

11 years agobluetooth: Disable profile auto-switch policy for headsets
Mikel Astiz [Mon, 26 Nov 2012 17:32:08 +0000 (18:32 +0100)]
bluetooth: Disable profile auto-switch policy for headsets

Given that headsets have just one single port exposing whether the
audio is streaming (playing) or not, it's not possible that
module-bluetooth-policy would distinguish A2DP/HSP cases, and thus
the automatic selection of the card profile is not deterministic.

For this reason, disable the policy entirely for headsets and focus
only on HFGW and A2DP source profiles.

11 years agobluetooth: Merge headset ports into one
Mikel Astiz [Mon, 26 Nov 2012 17:32:07 +0000 (18:32 +0100)]
bluetooth: Merge headset ports into one

Merge the former "hsp-output" and "a2dp-output" ports into one single
port, in order to fix the regression of having several independent
entries in the UI.

11 years agovirtual-surround: check if resampled memblock is not equal to input
Niels Ole Salscheider [Sat, 24 Nov 2012 11:32:51 +0000 (12:32 +0100)]
virtual-surround: check if resampled memblock is not equal to input

Since commit e32a408b3cdd46857fdf12210c1bf5bdbf3a96f8, we silence the
input memblock in order to give the resampler enough input samples, if
necessary.
But if there is no need to resample the hrir, the resampled memblock is
actually the same as the input memblock. Thus, we have to make sure that
we do not silence it in this case.

11 years agobluetooth: Unload device module when no audio profiles connected
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:28 +0000 (15:20 +0100)]
bluetooth: Unload device module when no audio profiles connected

Without this patch, device modules will be left around after the
device has been disconnected and when they are reconnected, the
discovery module will load duplicate device module instances.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=57239
11 years agobluetooth: Run the discovery hook only when necessary
Mikel Astiz [Thu, 22 Nov 2012 14:20:27 +0000 (15:20 +0100)]
bluetooth: Run the discovery hook only when necessary

This is a minor optimization too, but the main benefit is that it's
makes the code easier to understand (I hope), since run_callback()
won't be called at times when it's not needed.

11 years agobluetooth: Add helper pa_bluetooth_device_any_audio_connected()
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:26 +0000 (15:20 +0100)]
bluetooth: Add helper pa_bluetooth_device_any_audio_connected()

The new helper function makes it easier to check whether any audio
profiles are connected. That information is needed by the discovery
module for deciding whether a new device module should be loaded. The
device module should use this information too to unload itself at the
right time, but that's currently not implemented.

11 years agobluetooth: Rename former device_is_audio()
Mikel Astiz [Thu, 22 Nov 2012 14:20:25 +0000 (15:20 +0100)]
bluetooth: Rename former device_is_audio()

Use a more accurate name for the function since it doesn't just check
if it is an audio device (which can be detected quite early), but it
also checks if the most relevant properties (device info, etc.) have
been received.

Besides, add the const qualifier to the pointer since it's not going to
be modified.

11 years agobluetooth: Ignore Device.Connected
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:24 +0000 (15:20 +0100)]
bluetooth: Ignore Device.Connected

The Device.Connected was only used for tracking whether a device module
should be loaded, but that information is already included in the
individual profile state properties. The property can therefore be
completely ignored without any loss in functionality.

11 years agobluetooth: Add a pa_bluetooth_discovery pointer to pa_bluetooth_device.
Tanu Kaskinen [Tue, 20 Nov 2012 12:51:27 +0000 (14:51 +0200)]
bluetooth: Add a pa_bluetooth_discovery pointer to pa_bluetooth_device.

This simplifies some function argument lists.

11 years agostream-restore: Add missing method handler argument.
Juho Hämäläinen [Tue, 20 Nov 2012 06:30:22 +0000 (08:30 +0200)]
stream-restore: Add missing method handler argument.

Stream-restore DBus API method argument list is missing last boolean
argument apply_immediately, causing assert to fail in AddEntry handling.

Signed-off-by: Juho Hämäläinen <jusa@hilvi.org>
11 years agocore: Remove bad free() call
Arun Raghavan [Mon, 19 Nov 2012 15:58:22 +0000 (21:28 +0530)]
core: Remove bad free() call

The string created when trying to use XDG_RUNTIME_DIR is freed before it
is used in a debug message, and is freed again.

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

11 years agosink-input, source-output: Check rate update success for passthrough
Arun Raghavan [Mon, 19 Nov 2012 07:22:28 +0000 (12:52 +0530)]
sink-input, source-output: Check rate update success for passthrough

This makes sure we don't try to plug in a passthrough stream if the
final sink/source sample spec doesn't match what we want. In the future,
we might want to change rate updates to try a full sample spec update
for passthrough streams.

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

11 years agosource-output: Fix volume fixup for rate update
Arun Raghavan [Mon, 19 Nov 2012 07:03:25 +0000 (12:33 +0530)]
source-output: Fix volume fixup for rate update

The could that should have been after the rate update ended up being
before, which is incorrect.

11 years agobuild-sys: Drop ChangeLog generation
Arun Raghavan [Sat, 17 Nov 2012 05:25:05 +0000 (10:55 +0530)]
build-sys: Drop ChangeLog generation

This drops ChangeLog generation from git. It does not make sense to
distribute 500 kB of ChangeLog given how easy it is these days to browse
history with git.

We might replace this with a release-annoucement-esque high-level
summary of changes.

11 years agobuild-sys: Bump soname
Arun Raghavan [Sat, 17 Nov 2012 05:24:16 +0000 (10:54 +0530)]
build-sys: Bump soname

11 years agobuild-sys: Bump BlueZ dependency to 4.99
Arun Raghavan [Fri, 16 Nov 2012 17:43:26 +0000 (23:13 +0530)]
build-sys: Bump BlueZ dependency to 4.99

Since the old UNIX fd IPC mechanism was removed and we rely on the D-Bus
based API, this is the oldest version that is known to reliably work.

11 years agomodules: Micro-optimisation for rewind_requested paths
Arun Raghavan [Fri, 16 Nov 2012 17:39:15 +0000 (23:09 +0530)]
modules: Micro-optimisation for rewind_requested paths

Since some devices can be chatty with regards to how often they return
from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested
checks in our sink modules to make the general case (no rewind was
requested) the fast path.

11 years agosink: Process rewind requests also when suspended.
Tanu Kaskinen [Thu, 30 Aug 2012 13:50:13 +0000 (16:50 +0300)]
sink: Process rewind requests also when suspended.

When a rewind is requested on a sink input, the request parameters are
stored in the pa_sink_input struct. The parameters are reset during
rewind processing, and if the sink decides to ignore the rewind
request due to being suspended, stale parameters are left in
pa_sink_input. It's particularly problematic if the rewrite_bytes
parameter is left at -1, because that will prevent all future rewind
processing on that sink input. So, in order to avoid stale parameters,
every rewind request needs to be processed, even if the sink is
suspended.

Reported-by: Uoti Urpala
11 years agosink, source: Prevent unnecessary rate update attempts
Arun Raghavan [Thu, 15 Nov 2012 10:21:52 +0000 (15:51 +0530)]
sink, source: Prevent unnecessary rate update attempts

We don't need to try a rate update if the desired sample rate is the
same as the one the sink or source is already using.

11 years agoalsa-mixer: Prefer "Digital Input Source:Digital Mic 1"
David Henningsson [Fri, 16 Nov 2012 12:16:04 +0000 (13:16 +0100)]
alsa-mixer: Prefer "Digital Input Source:Digital Mic 1"

...over "Digital Input Source:Analog Input". It makes life a little
easier for users of Dell xps m1330.

Just an old Ubuntu delta I never upstreamed until now.
The patch was originally written by Daniel T Chen <crimsun@ubuntu.com>.

BugLink: https://bugs.launchpad.net/bugs/453966
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomainloop: Don't care about the mainloop state variable when waking up the mainloop.
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:05 +0000 (15:01 +0300)]
mainloop: Don't care about the mainloop state variable when waking up the mainloop.

If the mainloop is just about to enter polling, but m->state
is not POLLING yet when some other thread calls
pa_mainloop_wakeup(), the mainloop will not be woken up.
It's safe to write to the wakeup pipe at any time, so let's
just remove the check.

11 years agomainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:02 +0000 (15:01 +0300)]
mainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.

The variable is accessed from multiple threads, so it should
be atomic.

11 years agoalsa-mixer: Add "CLFE" and "Bass Speaker" names
David Henningsson [Fri, 9 Nov 2012 06:10:24 +0000 (07:10 +0100)]
alsa-mixer: Add "CLFE" and "Bass Speaker" names

These are sometimes being used in the HDA driver and we should
support them.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoman: Correction for how sample rate switching is disabled
Arun Raghavan [Mon, 12 Nov 2012 16:54:52 +0000 (22:24 +0530)]
man: Correction for how sample rate switching is disabled

Setting to 0 in the parser causes daemon startup to fail.

11 years agobuild-sys: Correct bluez support error if sbc is missing
Sjoerd Simons [Sat, 10 Nov 2012 16:41:27 +0000 (16:41 +0000)]
build-sys: Correct bluez support error if sbc is missing

11 years agoalsa-mixer: Add a few more machines to internal mic whitelist
David Henningsson [Fri, 9 Nov 2012 11:14:18 +0000 (12:14 +0100)]
alsa-mixer: Add a few more machines to internal mic whitelist

Based on feedback in the bug below (comments 128, 129, 131).

BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agopulse: Fix hole handling in pa_stream_peek().
Tanu Kaskinen [Wed, 7 Nov 2012 14:52:37 +0000 (16:52 +0200)]
pulse: Fix hole handling in pa_stream_peek().

Previously, if there was a hole in a recording stream,
pa_stream_peek() would crash. Holes could be handled silently inside
pa_stream_peek() by generating silence (wouldn't work for compressed
streams, though) or by skipping any holes. However, I think it's
better to let the caller decide how the holes should be handled, so
in case of holes, pa_stream_peek() will return NULL data pointer and
the length of the hole in the nbytes argument.

This change is technically an interface break, because previously the
documentation didn't mention the possibility of holes that need
special handling. However, since holes caused crashing anyway in the
past, it's not a regression if applications keep misbehaving due to
not handing holes properly.

Some words about when holes can appear in recording streams: I think
it would be reasonable behavior if overruns due to the application
reading data too slowly would cause holes. Currently that's not the
case - overruns will just cause audio to be skipped. But the point is
that this might change some day. I'm not sure how holes can occur
with the current code, but as the linked bug shows, they can happen.
It's most likely due to recording from a monitor source where the
thing being monitored has holes in its playback stream.

BugLink: http://bugs.launchpad.net/bugs/1058200
11 years agointrospect: Minor documentation fix
Arun Raghavan [Thu, 8 Nov 2012 09:23:55 +0000 (14:53 +0530)]
introspect: Minor documentation fix

s/pa_latency_info/pa_timing_info

11 years agoalsa: get avail, delay, timestamps in a single kernel call
Pierre-Louis Bossart [Mon, 30 Jul 2012 00:46:59 +0000 (19:46 -0500)]
alsa: get avail, delay, timestamps in a single kernel call

Refactor code to fetch avail, delay and timestamp values
in a single call to snd_pcm_status().
The information reported is exactly the same as before,
however it is extracted in a more atomic manner to
improve timer-based scheduling.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
11 years agoRevert "tests: modify alsa-time-test to use 'check' framework"
Arun Raghavan [Mon, 5 Nov 2012 12:11:53 +0000 (17:41 +0530)]
Revert "tests: modify alsa-time-test to use 'check' framework"

This reverts commit 1569601864af375c3788fbce429b6773bd48072e.

Rethinking this, it makes more sense to not add this to the check
framework. This is mostly useful for exposing ALSA driver issues, and
it's handy to be able to build this as a standalone executable.

11 years agoalsa: Drop verbosity on UCM message
Arun Raghavan [Mon, 5 Nov 2012 12:11:19 +0000 (17:41 +0530)]
alsa: Drop verbosity on UCM message

We don't need to log an error-level message for missing UCM config.

11 years agobuild: fix Mac OS X configure process
Deng Zhengrong [Thu, 19 Jul 2012 08:41:31 +0000 (16:41 +0800)]
build: fix Mac OS X configure process

The original header file doesn't exist on Lion (10.7.4).

11 years agoresampler: Fix crash if 'auto' resampler chooses ffmpeg with variable rate
Frédéric Dalleau [Wed, 22 Aug 2012 13:42:16 +0000 (15:42 +0200)]
resampler: Fix crash if 'auto' resampler chooses ffmpeg with variable rate

To reproduce, add resampler-method = ffmpeg in daemon.conf
then start PA, and load module-loopback

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb2f1db40 (LWP 23047)]
0x00000000 in ?? ()
(gdb) bt
0  0x00000000 in ?? ()
1  0xb7c463cb in pa_resampler_set_input_rate (r=0x80e9438, rate=44011) at pulsecore/resampler.c:365
2  0xb7c6321d in pa_sink_input_process_msg (o=0x80e87a0, code=3, userdata=0xabeb, offset=0, chunk=0x0)
    at pulsecore/sink-input.c:1833
3  0xb7e9840b in sink_input_process_msg_cb (obj=0x80e87a0, code=3, data=0xabeb, offset=0, chunk=0x0)
        at modules/module-loopback.c:538
4  0xb7c2709b in pa_asyncmsgq_dispatch (object=0x80e87a0, code=3, userdata=0xabeb, offset=0, memchunk=0xb2f1d17c)
        at pulsecore/asyncmsgq.c:322
5  0xb7c4c6e3 in asyncmsgq_read_work (i=0x80dd580) at pulsecore/rtpoll.c:564
6  0xb7c4b34a in pa_rtpoll_run (p=0x80fb7e0, wait_op=true) at pulsecore/rtpoll.c:238
7  0xb7dd90af in thread_func (userdata=0x80afe88) at modules/alsa/alsa-sink.c:1785
8  0xb7bf3291 in internal_thread_func (userdata=0x8095d08) at pulsecore/thread-posix.c:83
9  0xb7ab9d4c in start_thread (arg=0xb2f1db40) at pthread_create.c:308
10 0xb79f3ace in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

11 years agobuild: Add PROTOCOL to EXTRA_DIST.
Tanu Kaskinen [Sat, 6 Oct 2012 11:42:46 +0000 (14:42 +0300)]
build: Add PROTOCOL to EXTRA_DIST.

It's useful documentation, no reason to leave it out of the tarball.

11 years agodevice-restore: When restoring volume, print the restored volume to the log.
Tanu Kaskinen [Tue, 23 Oct 2012 15:55:42 +0000 (18:55 +0300)]
device-restore: When restoring volume, print the restored volume to the log.

11 years agobuild: Add .gitignore files to EXTRA_DIST.
Tanu Kaskinen [Sat, 6 Oct 2012 12:05:08 +0000 (15:05 +0300)]
build: Add .gitignore files to EXTRA_DIST.

As a packager, I want to be able to do "git format-patch
v3.0..origin/master" and I want the generated patches to apply cleanly
against the 3.0 tarball. The patches don't currently apply cleanly if
there are any changes to the .gitignore files, because the .gitignore
files are not shipped in the tarball. This patch fixes that problem.

11 years agoman pulse-daemon.conf: Correct typoes
Wieland Hoffmann [Wed, 31 Oct 2012 17:50:24 +0000 (18:50 +0100)]
man pulse-daemon.conf: Correct typoes

11 years agobuild-sys: Document libpulsecommon vs. libpulse duplication
Arun Raghavan [Sat, 3 Nov 2012 10:50:10 +0000 (11:50 +0100)]
build-sys: Document libpulsecommon vs. libpulse duplication

11 years agoi18n: Fix POTFILES for poll changes
Arun Raghavan [Sat, 3 Nov 2012 09:52:35 +0000 (10:52 +0100)]
i18n: Fix POTFILES for poll changes

poll.c was moved to poll-posix.c and poll-win32.c was added for the
Windows port.

11 years agobuild-sys: Bump soname
Arun Raghavan [Sat, 3 Nov 2012 09:44:42 +0000 (10:44 +0100)]
build-sys: Bump soname

11 years agoRevert "core: adjust playing_for and underrun_for at rewind"
Arun Raghavan [Sat, 3 Nov 2012 09:29:20 +0000 (10:29 +0100)]
Revert "core: adjust playing_for and underrun_for at rewind"

This reverts commit 5bc6cadcb2e7255fd333ed88cc80b61a7673ddd9.

I wasn't meaning to push this out - just merged for review / testing.

11 years agocore: adjust playing_for and underrun_for at rewind
Uoti Urpala [Sat, 28 Jul 2012 20:51:46 +0000 (23:51 +0300)]
core: adjust playing_for and underrun_for at rewind

A rewind may erase data that sink_input counted in playing_for or
underrun_for earlier. Add code adjusting those values after a rewind.

One visible symptom of this bug was problems recovering from an
underrun. When a client calls pa_stream_write() with a large block of
memory, the function can split that into smaller pieces before sending
it to the server. When receiving new data for a stream that had
silence queued due to underrun, the server would do a rewind to
replace the queued-but-not-played silence with the new data. Because
of the bug, this rewind itself would not change underrun_for. It's
possible for multiple rewinds to be done without filling the sink
buffer in between (which is what would eventually reset underrun_for).
In this case, the server rapidly processing the split packets would
rewind the stream for _each_ of them (as underrun_for would stay set),
erasing valid audio as a result.

11 years agosvolume: Fix ARM alignment issues
Arun Raghavan [Tue, 30 Oct 2012 06:34:42 +0000 (12:04 +0530)]
svolume: Fix ARM alignment issues

As Peter Meerwald <p.meerwald@bct-electronic.com> discovered, our ARM
svolume code performance is quite terrible when the incoming samples are
not word-aligned. This can very easily be the case, since the
architecture only requires that the samples be 16-bit aligned, and we
might end up running the innermost loop after processing modulo-4
samples. The performance degradation was ~50x on a Cortex A9
(Pandaboard).

This reworks the svolume logic to first consume enough samples to make
sure the rest is word aligned, and reordering the processing to work
with 4 samples at a time first, and then finally deal with the
remainder.

With this, performance is comparable for arbitrary alignments (~3x
faster than the C code).

11 years agotests: Minor alignment adjustment fix for cpu-test
Arun Raghavan [Tue, 30 Oct 2012 14:58:24 +0000 (20:28 +0530)]
tests: Minor alignment adjustment fix for cpu-test

11 years agomatch: Use the SINK_INPUT_FIXATE hook instead of NEW.
Tanu Kaskinen [Thu, 27 Sep 2012 13:41:59 +0000 (16:41 +0300)]
match: Use the SINK_INPUT_FIXATE hook instead of NEW.

The callback relies on the sample spec being finalized, which is not
true with the NEW hook.

In case you're wondering about the "hook EARLY - 1, to match before
stream-restore" comment that was not changed even though the code that
the comment concerned was changed: the comment was apparently written
at a time when module-stream-restore used the NEW hook too, and later
stream-restore has been changed to use the FIXATE hook. So, the
comment was wrong/nonsensical before this patch. Since these two
modules now use the same hook again, the comment makes sense again.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=55135
11 years agocombine: Keep the timer active in the null mode only when running.
Tanu Kaskinen [Thu, 20 Sep 2012 06:42:18 +0000 (09:42 +0300)]
combine: Keep the timer active in the null mode only when running.

Previously thread_func() used PA_SINK_IS_OPENED() to check whether
some data should be rendered. process_render_null() used a different
check: it would return immediately if the sink was not in the RUNNING
state. This caused a busy loop when the sink was in the IDLE state,
because process_render_null() didn't update the timestamp, and
thread_func() still kept the timer active using the old timestamp.
pa_rtpoll_run() would return immediately because of the old timestamp.

This is fixed by using the same check in both thread_func() and
process_render_null(). Since the checks are the same, it's actually
redundant to have the check in process_render_null(), so it is now an
assertion.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54779
11 years agovirtual-surround-sink: Fix setting max_request and max_rewind.
Tanu Kaskinen [Wed, 22 Aug 2012 06:00:25 +0000 (09:00 +0300)]
virtual-surround-sink: Fix setting max_request and max_rewind.

The sink has different frame size than the sink input, so
the max_request and max_rewind values of the sink input need
to be converted when setting the sink max_request and
max_rewind values.

The conversion is already done correctly in
sink_input_update_max_request_cb() and
sink_input_update_max_rewind_cb().

11 years agoloopback: Don't fix the source output format/rate/channels.
Tanu Kaskinen [Tue, 14 Aug 2012 14:08:35 +0000 (17:08 +0300)]
loopback: Don't fix the source output format/rate/channels.

Once the sink input has been routed in pa_sink_input_new(),
the sample spec and channel map have already become fixed.
The sink input and source output must use the same stream
format, because the data is copied as-is.

11 years agoloopback: Use the real sample spec once it's known.
Tanu Kaskinen [Tue, 14 Aug 2012 14:08:34 +0000 (17:08 +0300)]
loopback: Use the real sample spec once it's known.

When module-loopback is loaded without arguments, the ss and
map variables are initialized with dummy values. This caused
a problem, because also pa_memblockq_new() was called with
the dummy values, making it work incorrectly. The base was
set to 1 instead of the real frame size, which in turn
caused alignment related crashes.

11 years agoresampler: Make sure that there are no overflows when multiplying potentially big...
Tanu Kaskinen [Mon, 9 Jul 2012 07:07:05 +0000 (10:07 +0300)]
resampler: Make sure that there are no overflows when multiplying potentially big numbers.

This fixes at least one crash that has been observed. The
multiplication in trivial_resample() overflowed when
resampling from 96 kHz to 48 kHz, causing an assertion
error:

Assertion 'o_index * fz < pa_memblock_get_length(output->memblock)' failed at pulsecore/resampler.c:1521, function trivial_resample(). Aborting.

Without the assertion, the memcpy() after the assertion
would have overwritten some random heap memory.

11 years agomemblockq: Fix the order of setting minreq and prebuf.
Tanu Kaskinen [Sat, 28 Apr 2012 15:54:11 +0000 (18:54 +0300)]
memblockq: Fix the order of setting minreq and prebuf.

11 years agocore-util: Don't error out on existing runtime directory.
Thomas Martitz [Tue, 30 Oct 2012 10:35:26 +0000 (11:35 +0100)]
core-util: Don't error out on existing runtime directory.

When compiling without HAVE_SYMLINK the runtime dir is a real directory,
which is attempted to be created. In the case it already exists we shouldn't
error out. The HAVE_SYMLINK-enabled code already does this.

11 years agocore: Proper poll() emulation to fix pacat and friends on Windows
Thomas Martitz [Tue, 30 Oct 2012 10:35:24 +0000 (11:35 +0100)]
core: Proper poll() emulation to fix pacat and friends on Windows

Currently, Windows versions of pacat and friends fail because the current
poll emulation is not sufficient (it only works for socket fds).

Luckily Gnulib has a much better emulation that seems to work good enough.
The implementation has been largely copied (except a few bug fix
regarding timeout handling, to be pushed upstream) and works on pipes
and files as well. The copy has been obtained through their gnulib-tool utility,
which gives a LGPLv2.1+ licensed file.

This fixes the "Assertion (!e->dead) failed" error coming and lets pacat
and friends stream happily to/from a server (I didn't actually test parec).

11 years agobuild-sys: Drop -Wvla from compiler flags
Arun Raghavan [Tue, 30 Oct 2012 06:08:01 +0000 (11:38 +0530)]
build-sys: Drop -Wvla from compiler flags

Since we mandate C99 support, not reason to keep this around.

11 years agotests: Fix a cpu-test debug message
Arun Raghavan [Tue, 30 Oct 2012 06:07:06 +0000 (11:37 +0530)]
tests: Fix a cpu-test debug message

We align at sample granularity and not byte granularity (which might
violate arch alignment requirements).

11 years agotests: Run svolume on different channel counts
Arun Raghavan [Tue, 30 Oct 2012 06:00:16 +0000 (11:30 +0530)]
tests: Run svolume on different channel counts

This adds checks to run svolume tests with 1, 2 and 3 channels (we don't
run Orc with 3 channels since only 1/2-ch are implemented there).

11 years agotests: Make cpu-test less verbose
Arun Raghavan [Tue, 30 Oct 2012 05:54:33 +0000 (11:24 +0530)]
tests: Make cpu-test less verbose

Drops the correctness debug output since we want to run this several
times, and the output becomes much more verbose than required.

11 years agotests: Run svolume test for various sample alignments
Arun Raghavan [Tue, 30 Oct 2012 04:00:32 +0000 (09:30 +0530)]
tests: Run svolume test for various sample alignments

Allows us to make sure that svolume works independently of sample
alignment, and that performance doesn't degrade based on this.

11 years agocore: Fix warning on non-win32 builds
Arun Raghavan [Mon, 29 Oct 2012 12:02:32 +0000 (17:32 +0530)]
core: Fix warning on non-win32 builds

11 years agobuild: Add a2dp-codecs.h to libbluetooth-util sources.
Tanu Kaskinen [Sat, 6 Oct 2012 11:43:07 +0000 (14:43 +0300)]
build: Add a2dp-codecs.h to libbluetooth-util sources.

11 years agotests: Minor cpu-test fixes for non-NEON builds
Arun Raghavan [Mon, 29 Oct 2012 09:10:00 +0000 (14:40 +0530)]
tests: Minor cpu-test fixes for non-NEON builds

The s16->float test is only run on ARM with NEOn at the moment, so we
don't define that code in other cases.

11 years agotests: Print average outer-loop iteration time in cpu-test
Arun Raghavan [Mon, 29 Oct 2012 07:56:25 +0000 (13:26 +0530)]
tests: Print average outer-loop iteration time in cpu-test

11 years agotests: Increase sconv cpu-test timeout
Arun Raghavan [Fri, 26 Oct 2012 11:15:32 +0000 (16:45 +0530)]
tests: Increase sconv cpu-test timeout

This takes longer on ARM CPUs, especially older ones.

11 years agotests: Allow off-by-one error in sconv test
Arun Raghavan [Fri, 26 Oct 2012 11:09:11 +0000 (16:39 +0530)]
tests: Allow off-by-one error in sconv test

With some optimised sconv implementations (read NEON), rounding
inaccuracy might lead to a difference of 1 with the reference
implementation. The inaccuracy is worth the performance gain.

Also increases floating-point accuracy while printing errors to make
errors easier to analyse.

11 years agosconv: Fix NEON sconv rounding code
Arun Raghavan [Fri, 26 Oct 2012 11:06:49 +0000 (16:36 +0530)]
sconv: Fix NEON sconv rounding code

Rounding with 0.5 causes us to always round up for any value of the form
x.5. IEEE754 specifies round-to-nearest-even as the behaviour in this
case. This might not always be possible with NEON code, but this change
gets us much closer to it.

11 years agotests: Implement test code for ARM NEON sconv s16_to_float
Peter Meerwald [Sat, 27 Oct 2012 12:59:43 +0000 (14:59 +0200)]
tests: Implement test code for ARM NEON sconv s16_to_float

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agotests: Fix test description in cpu-test
Peter Meerwald [Fri, 26 Oct 2012 11:04:47 +0000 (13:04 +0200)]
tests: Fix test description in cpu-test

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agocore: Add ARM NEON optimized sample conversion code
Peter Meerwald [Tue, 23 Oct 2012 15:54:57 +0000 (17:54 +0200)]
core: Add ARM NEON optimized sample conversion code

final:
* includes some minor style fixes and build-time changes to allow
  building a single binary for neon and non-neon systems
v4:
* fix for sample length < 4
v3:
* convert from intrinsics to inline assembly
v2:
* load and store data with vld1/vld1q and vst1/vst1q, resp., to work
  around alignment issues of compiler-generated vldmia instruction
* remove redundant check for NEON flags

Ubuntu/Linaro gcc 4.6.3
arm-linux-gnueabi-gcc -O2 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon

runtime on beagle-xm:

D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_from_float
I: [pulseaudio] sconv_neon.c: NEON: 3754 usec.
I: [pulseaudio] sconv_neon.c: ref: 58594 usec.
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_to_float
I: [pulseaudio] sconv_neon.c: NEON: 1831 usec.
I: [pulseaudio] sconv_neon.c: ref: 10528 usec.
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.

conversion may be off by one for some samples due to rounding issues

11 years agobuild-sys: Add volume code to libpulsecommon
Arun Raghavan [Fri, 26 Oct 2012 03:11:08 +0000 (08:41 +0530)]
build-sys: Add volume code to libpulsecommon

Commit dd31d652a ("utils: Adding a function to get volume from string")
uses pa_sw_volume_from_dB(), which is part of libpulse, in libpulsecore.
This breaks as-needed builds. We fix this by also building the volume
code in libpulsecommon.

11 years agocard: Store a pa_card pointer in pa_card_profile.
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:55 +0000 (18:04 +0300)]
card: Store a pa_card pointer in pa_card_profile.

11 years agobluetooth: Add hook to announce late UUIDs
Mikel Astiz [Tue, 23 Oct 2012 14:41:59 +0000 (16:41 +0200)]
bluetooth: Add hook to announce late UUIDs

UUIDs might be announced at any time, so a hook is needed to notify any
interested module. In practice, the UUIDs are quite stable with the
exception of the pairing procedure, where the UUIDs are reported by
BlueZ as soon as they are discovered.

11 years agocard: Support adding ports dynamically
Mikel Astiz [Tue, 23 Oct 2012 14:41:56 +0000 (16:41 +0200)]
card: Support adding ports dynamically

Card profiles -specially the ones registered with pa_card_add_profile()-
might need to create new ports during the lifetime of the card.

11 years agocard: Support adding profiles dynamically
Mikel Astiz [Tue, 23 Oct 2012 14:41:55 +0000 (16:41 +0200)]
card: Support adding profiles dynamically

Some cards might need to add profiles during their lifetime, that is,
after the card has been created.

11 years agoutils: Adding a function to get volume from string
Flavio Ceolin [Wed, 24 Oct 2012 19:29:45 +0000 (17:29 -0200)]
utils: Adding a function to get volume from string

The allowed volume formats are dB, % or integer.
For example: 10% or 10db or 10.

11 years agotests: Run sconv tests with multiple alignments
Arun Raghavan [Wed, 24 Oct 2012 07:18:02 +0000 (12:48 +0530)]
tests: Run sconv tests with multiple alignments

This allows us to test the sconv code with the incoming samples at
various byte alignments. The test is also now split into correctness and
performance checks.

11 years agoalsa-mixer: Don't let "Mic Jack Mode" alone create a "Line In" path
David Henningsson [Tue, 16 Oct 2012 09:35:00 +0000 (11:35 +0200)]
alsa-mixer: Don't let "Mic Jack Mode" alone create a "Line In" path

The IDT/Sigmatel codec driver often creates a "Mic Jack Mode" for
every mic jack, so it can change functionality between Mic and Line In.

However, as the "Mic Jack" is the standard naming, our current solution
does not make the Line In port unavailable when nothing is plugged in.

This patch makes the "Line In" port not to be created just because there
is a "Mic Jack Mode" that could be set to "Line". This makes the behaviour
consistent with e g "Dock Mic Jack Mode", "Front Mic Jack Mode" etc, where
we don't create a "Dock Line" or "Dock Mic" port either.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agortp: Fix warning using pa_assert_not_reached()
Peter Meerwald [Tue, 23 Oct 2012 15:37:24 +0000 (17:37 +0200)]
rtp: Fix warning using pa_assert_not_reached()

  modules/rtp/module-rtp-recv.c:462:8: warning: 'r' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agovirtual-surround: Limit the number of hrir samples.
Niels Ole Salscheider [Fri, 5 Oct 2012 19:46:49 +0000 (21:46 +0200)]
virtual-surround: Limit the number of hrir samples.

v2: better log message

11 years agovirtual-surround: Add silence to hrir if necessary.
Niels Ole Salscheider [Fri, 5 Oct 2012 19:46:48 +0000 (21:46 +0200)]
virtual-surround: Add silence to hrir if necessary.

Otherwise, the hrir might be too short to get completely resampled

v2: take different sample rates into account

11 years agopulse: Fix for volume documentation
Flavio Ceolin [Thu, 9 Aug 2012 18:52:52 +0000 (15:52 -0300)]
pulse: Fix for volume documentation

Fixing the documentation for the function pa_cvolume_dec().

11 years agotests: Add a basic sanity test to sconv cpu-test
Arun Raghavan [Tue, 23 Oct 2012 12:59:27 +0000 (18:29 +0530)]
tests: Add a basic sanity test to sconv cpu-test

This seems redundant with the previous check in that function, but it
makes sure that the result of the speed comparison is what we think it
is.

11 years agotests: Reorganise cpu-test to reuse code
Arun Raghavan [Tue, 23 Oct 2012 12:56:39 +0000 (18:26 +0530)]
tests: Reorganise cpu-test to reuse code

This factors out the basic measurement code for each test into a
separate block so that each test can be broken down into a basic
correctness test, and a performance comparison with minimum effort.

11 years agotests: Factor out core sconv test code in cpu-test
Arun Raghavan [Tue, 23 Oct 2012 09:58:47 +0000 (15:28 +0530)]
tests: Factor out core sconv test code in cpu-test

This will let us add tests for non-SSE sconv tests.

11 years agotests: Add a copyright header to cpu-test
Arun Raghavan [Tue, 23 Oct 2012 09:58:26 +0000 (15:28 +0530)]
tests: Add a copyright header to cpu-test

11 years agortp: Fix rtp_port reading.
Tanu Kaskinen [Thu, 29 Mar 2012 13:03:59 +0000 (16:03 +0300)]
rtp: Fix rtp_port reading.

pa_atou() return value was not checked, and the cast of a
16-bit variable pointer to a 32-bit variable pointer could
corrupt cseq.

11 years agogccmacro: Disable printf-like format checking on mingw32 compilers.
Thomas Martitz [Tue, 23 Oct 2012 10:10:45 +0000 (12:10 +0200)]
gccmacro: Disable printf-like format checking on mingw32 compilers.

Am 23.10.2012 08:25, schrieb Arun Raghavan:
> On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:
>> Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:
>>> Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :
>>>> There are tons of warnings, most of them because the function is not
>>>> recognized as printf-like.
>>> Removing checks looks very fishy.
>>>
>>> To use C99 and/or GNU format specifiers on MingW, you need to use the
>>> gnuprintf attribute instead of printf. With printf, the format string is
>>> validated according to the antiquated MSVC rules.
>>>
>> Interesting, I didn't know about gnuprintf. FWIW, what are those
>> antiquated MSVC rules? I assumed the return value which isn't int for
>> some affected functions?
> Is this one going to be respun?
>

Yes, here you go.

>From c5f15eec69bf95c9a1261e0d82abbd039156e75e Mon Sep 17 00:00:00 2001
From: Thomas Martitz <kuge@rockbox.org>
Date: Wed, 8 Aug 2012 17:38:04 +0200
Subject: [PATCH 1/3] gccmacro: Work around warnings due to printf redirection
 by libintl.

Libintl defines printf as libintl_printf, which breaks the format
attribue. Unfortunately the workaround around provided by libintl
is only enabled for cygwin, but not for mingw builds. Therefore
install the workaround manually.

11 years agobluetooth: Refactor code to create profile ports
Mikel Astiz [Mon, 22 Oct 2012 08:46:42 +0000 (10:46 +0200)]
bluetooth: Refactor code to create profile ports

Put the created ports in a hashmap, but not necessarily inside a struct
pa_card_new_data.

11 years agobluetooth: Refactor code to create card profiles
Mikel Astiz [Mon, 22 Oct 2012 08:46:41 +0000 (10:46 +0200)]
bluetooth: Refactor code to create card profiles

Use a helper function to create the card profiles, given an UUID.

11 years agoecho-cancel: Fix false warning in webrtc AEC.
Peter Meerwald [Mon, 22 Oct 2012 21:48:27 +0000 (23:48 +0200)]
echo-cancel: Fix false warning in webrtc AEC.

  CXX      libwebrtc_util_la-webrtc.lo
modules/echo-cancel/webrtc.cc: In function 'pa_bool_t pa_webrtc_ec_init(pa_core*, pa_echo_canceller*, pa_sample_spec*, pa_channel_map*, pa_sample_spec*, pa_channel_map*, uint32_t*, const char*)':
modules/echo-cancel/webrtc.cc:196:9: warning: 'rm' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>