Arun Raghavan [Wed, 21 Aug 2013 09:28:06 +0000 (14:58 +0530)]
alsa-ucm: Make combination port names deterministic
At the moment, port names combined from multiple devices are generated
based on the order that the devices are specified in config. This makes
programmatic use of thsee ports a bit painful, so let's make them be
combined in alphabetical order.
Arun Raghavan [Wed, 7 Aug 2013 17:26:58 +0000 (22:56 +0530)]
alsa-ucm: Use playback/capture rate specification from UCM
Add new PlaybackRate/CaptureRate values for UCM that can be used to
specify custom rates for devices. This value can either be set on the
verb, which makes it apply to all devices, or on the device to override
the verb setting.
Arun Raghavan [Wed, 7 Aug 2013 12:56:26 +0000 (18:26 +0530)]
alsa: Allow sample spec override in mappings
This allows mappings to override some or all of the sample_spec used to
open the ALSA device. The intention, to start with, is to use this for
devices in UCM that need to be opened at a specific rate (like modem
devices). This can be extended to allow overrides in profile-sets as
well.
Since the hashmap stores a pointer to the key provided at pa_hashmap_put()
time, it make sense to allow the hashmap to be given ownership of the key and
have it free it at pa_hashmap_remove/free time.
To do this cleanly, we now provide the key and value free functions at hashmap
creation time with a pa_hashmap_new_full. With this, we do away with the free
function that was provided at remove/free time for freeing the value.
Pierre Ossman [Thu, 11 Jul 2013 11:57:41 +0000 (13:57 +0200)]
module-tunnel: automatically find the PulseAudio server
Make the PulseAudio tunnel behave the same way as a client
when it comes to figuring out how to connect to the current
PulseAudio daemon. This can be useful if you start a second
PulseAudio instance for e.g. network access.
Tanu Kaskinen [Thu, 29 Aug 2013 14:36:53 +0000 (17:36 +0300)]
suspend-on-idle: Allow disabling suspending for specific devices
Sometimes it would be nice to disable module-suspend-on-idle for
specific devices. For me the use case is to keep a HDMI sink running
all the time to avoid loss of audio when starting to play a stream to
the device (the HDMI receiver eats a bit from the beginning of the
stream when the device is opened). This is arguably a hacky solution
to the problem, but on the other hand, I think it's very sensible to
interpret negative timeout in the module-suspend-on-idle.timeout
property as disabling the suspending altogher. This is also how the
exit-idle-time configuration option behaves (negative value disables
automatic exiting).
I moved the property parsing from the timer restart function to the
function that creates the device_info objects, because if the timeout
is negative, we don't need to create the device_info object at all.
Alexander Couzens [Thu, 12 Sep 2013 12:01:51 +0000 (14:01 +0200)]
tunnel-source-new: counterpart to module-tunnel-sink-new
The old tunnel module duplicates functionality that is in libpulse,
due to implementing the native protocol, and the protocol code in
the old tunnel module tends to get broken every now and then, because
people forget to update the tunnel module protocol implementation
when changing the native protocol. module-tunnel-source-new avoids this
problem by using libpulse to communicate with the remote server.
Tanu Kaskinen [Wed, 28 Aug 2013 11:11:54 +0000 (14:11 +0300)]
resampler: Never return zero for max block size
With very low input sample rates the memory pool max block size may
not be big enough, in which case we should return the size of one
frame. Returning zero caused crashing.
Alexander Couzens [Tue, 27 Aug 2013 01:18:35 +0000 (03:18 +0200)]
context: add pa_context_load_cookie_from_file()
There is no function to load the authentication cookie for a context.
You can only set environment variables. This patch adds
pa_context_load_cookie_from_file().
Tanu Kaskinen [Fri, 9 Aug 2013 06:39:49 +0000 (09:39 +0300)]
source: When updating a monitor source's rate, update the sink rate too
If the sink rate is not updated, then the monitor source will appear
to have a different rate than the sink, but in reality there's never
any resampling done when moving data from the sink to the monitor
source, so it's a lie that the monitor source has a different rate.
The result of lying is that clients that capture from the monitor
source will have streams that run too fast or slow.
Tanu Kaskinen [Fri, 9 Aug 2013 04:45:26 +0000 (07:45 +0300)]
source: Fix monitor source rate changing
When a sink changes its sample rate, also the monitor source rate
needs to be changed. In order to determine whether a source supports
rate changing, the code checks if the update_rate() callback is set,
but monitor sources don't have that callback set, so the old code
always failed to change the monitor source rate.
This patch fixes the monitor source rate changing by handling monitor
sources as a special case in pa_source_update_rate(): if the source is
a monitor source, then the update_rate() callback is not required.
This adds asserts to check if the implementation has an update rate
function defined for the unlikely event that some implementation forgets
to assign a update rate function we can simply bail.
It is expected from the resampling implementations to have such a
function even if the state of the resampler is completely reset.
Resampler: Don't use the peaks resampler for upsampling
This patch fixes this assertion:
Assertion 'r->i_ss.rate >= r->o_ss.rate' failed at ../../src/pulsecore/resampler.c:1744, function peaks_init(). Aborting.
Tanu Kaskinen [Wed, 14 Aug 2013 13:54:28 +0000 (16:54 +0300)]
source-output: Get the correct source for "direct_on_input" streams
If a capture stream captures from a single sink input (so the capture
stream is a so called "direct on input" stream), then it needs to
connect to the monitor source of the sink to which the sink input is
connected. Previously the correct source was not figured out
automatically, causing the capture stream creation to fail.
Alexander Couzens [Wed, 21 Aug 2013 11:58:19 +0000 (13:58 +0200)]
tunnel-sink-new: add a rewrite of module-tunnel using libpulse
The old tunnel module duplicates functionality that is in libpulse,
due to implementing the native protocol, and the protocol code in
the old tunnel module tends to get broken every now and then, because
people forget to update the tunnel module protocol implementation
when changing the native protocol. module-tunnel-sink-new avoids this
problem by using libpulse to communicate with the remote server.
The Bash shell completion for pacat --device combines the name of the
last sink and the name of the first source. This patch fixes that by
adding a whitespace separator in the list of devices.
Arun Raghavan [Sat, 3 Aug 2013 06:09:17 +0000 (11:39 +0530)]
sink-input: Don't assert when removing non-existent volume factor
This makes it easier for users of this API to add/updated a volume
factor by doing a _remove_volume_factor() followed by an
add_volume_factor(), rather than having to either remember whether this
is the first set operation or have an API to query whether a factor has
already been set.
Peter Meerwald [Mon, 29 Jul 2013 20:13:41 +0000 (22:13 +0200)]
pacmd: Discriminate between interactive and non-interactive mode
interactive sessions are initiated with a hello message in order to
receive a welcome message from the PA daemon and a command prompt
interactive sessions have a terminal connected to stdin
non-interactive sessions execute commands given on the command line
or received via stdin; non-interactive sessions have neither welcome
message nor command prompt
David Henningsson [Fri, 2 Aug 2013 13:03:26 +0000 (15:03 +0200)]
alsa-mixer: Prefer moving "Capture" before moving boosts
Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
control, both ranging from 0 dB to +30 dB, you get better quality if
"Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.
By changing the order in the configuration files, this patch makes us prefer
leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.
(This is based on limited experience, and there is no guarantee that there are
no sound cards that work the other way around, and therefore this patch could
potentially regress quality on those machines. Hopefully those are fewer, so
this is what we should default to.)
Currently the biggest possible sink latency is 10 seconds. The total
latency of the loopback is divided evenly for the source, an
intermediate buffer and the sink, so if I want to test 10 s sink
latency, the total needs to be three times that, i.e. 30 seconds.
Tanu Kaskinen [Thu, 27 Jun 2013 16:19:14 +0000 (19:19 +0300)]
ucm: Fix an incorrect log message
The log message didn't match the code, so one of them was wrong. It's
entirely possible that the code is wrong, but I didn't have the
motivation to study the code enough to understand what the code is
supposed to do.
João Paulo Rechi Vita [Fri, 12 Jul 2013 17:51:25 +0000 (14:51 -0300)]
build-sys: Fix misuse of "dependant"
Dependant in British English is a person who is financially supported by
someone else. To express software dependency relations "dependent"
should be used instead, which is correct for both British and US
English.
u->sink->state is not yet updated, so the state must be read from
u->sink->thread_info.state. This makes pausing and resuming of the
smoother happen at the right time.
The reference ratio should always be kept up-to-date. If the reference
ratio is not updated when the input volume changes, the stale
reference ratio ends up being used as the new input volume when the
input is moved.
All pa_cvolume_snprint(), pa_volume_snprint(),
pa_sw_cvolume_snprint_dB() and pa_sw_volume_snprint_dB() calls have
been replaced with pa_cvolume_snprint_verbose() and
pa_volume_snprint_verbose() calls, making the log output more
informative and the code sometimes simpler.
Mikel Astiz [Mon, 1 Jul 2013 08:27:21 +0000 (10:27 +0200)]
loopback: Fix cork state not updated after move
The source output and sink inputs should be corked if the corresponding
sink/source is suspended, as handled during module initialization. This
also needs to be handled during stream move, because the suspend state
of the destination sink/source might be different to the previous one.
This fixes the issue with an infinite number of "Requesting rewind due
to end of underrun" traces after a stream move.
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
Tanu Kaskinen [Wed, 26 Jun 2013 13:13:47 +0000 (16:13 +0300)]
dynarray: Reimplement with nicer semantics
A dynamic array is a nice simple container, but the old interface
wasn't quite what I wanted it to be. I like GLib's way of providing
the free callback at the container creation time, because that way
the free callback doesn't have to be given every time something is
removed from the array.
The allocation pattern was changed too: instead of increasing the
array size always by 25 when the array gets full, the size gets
doubled now (the lowest non-zero size is still 25).
The array can't store NULL pointers anymore, and pa_dynarray_get() was
changed so that it's forbidden to try to access elements outside the
valid range.
The set of supported operations may seem a bit arbitrary. The
operation set is by no means complete at this point. I have included
only those operations that are required by the current code and some
unpublished code of mine.
Tanu Kaskinen [Wed, 19 Jun 2013 15:39:58 +0000 (18:39 +0300)]
device-port: Assert that ports have a description
It's easier to work with the port description if it can be assumed
that it's always non-NULL. I have checked that the current code base
always ensures a non-NULL description.