Commit graph

7405 commits

Author SHA1 Message Date
Tanu Kaskinen
a32c5e4354 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.
2013-08-27 15:34:33 +03:00
Tanu Kaskinen
2c14306507 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.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=66424
2013-08-27 15:34:33 +03:00
poljar (Damir Jelić)
9a590dd3f2 resampler: Add a choose_auto_resampler function
This function returns our preferred resampler if the user choose the
auto (or if he has chosen an unsupported) resampler.
2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
8ab6c37e10 resampler: Get rid of redundant implementation specific structs
This patch removes implementation specific structs that contain a single
member.
2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
0d525e9c85 resampler: Add assert to set_input/output_rate
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.
2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
4bdfebee5c resampler: Introduce a implementation specific struct
This struct holds all the implementation specific data in one place.
2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
c5cd65d81e 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.
2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
2bed8cda25 resampler: Add a function for comparing sample format precision 2013-08-27 12:33:10 +02:00
poljar (Damir Jelić)
7665f60cc0 resampler: choose_work_format use switch instead of if/else
This way the function for choosing the work format should
be more readable and easier to expand in the future.
2013-08-27 12:33:09 +02:00
poljar (Damir Jelić)
78c18e71e0 resampler: Move the work format finding logic into a separate function 2013-08-27 12:33:09 +02:00
poljar (Damir Jelić)
83cf44831f resampler: fix_method use switch instead of if/else
This way the fix method function should be more readable and easier to
expand in the future.
2013-08-27 12:33:09 +02:00
poljar (Damir Jelić)
2d9aba0946 resampler: Move the fix method logic into a separate function 2013-08-27 12:33:09 +02:00
poljar (Damir Jelić)
97feeab40c resampler: Make resampler struct implementation agnostic
The pa_resampler struct contains many implementation specific
structures. These create overhead and don't belong there anyways.

This patch moves the implementation specific structures out of the
pa_resampler structure.
2013-08-27 12:33:09 +02:00
Tanu Kaskinen
1cd6a3ad70 sink, source: Return early from pa_*_update_rate(), if there's no need to do anything 2013-08-27 12:02:32 +03:00
Tanu Kaskinen
963da3de93 sink, source: Small readability improvement 2013-08-23 13:26:43 +03:00
Tanu Kaskinen
eeea84d196 sink, source: Fix default and alternate rate assertions 2013-08-23 13:26:43 +03:00
Tanu Kaskinen
22058713af sink, source: Don't care about default and alternate rate in passthrough mode
In passthrough mode the device rate is set to match the stream rate,
and the default and alternate rates are ignored.
2013-08-23 13:26:43 +03:00
Tanu Kaskinen
9aaf053dad sink, source: Reduce indentation level in *_update_rate() 2013-08-22 16:53:07 +03:00
Tanu Kaskinen
8cca3b3c10 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.
2013-08-21 16:59:01 +03:00
Alexander Couzens
df0a9e12d8 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.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2013-08-21 16:37:38 +03:00
Alexander Couzens
dac6a74155 client-conf: refactor cookie loaders
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2013-08-21 15:08:46 +03:00
poljar (Damir Jelić)
bf9b3f0720 bash-completion: Fix device completion for pacat
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.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=68106
2013-08-15 10:03:40 +03:00
Magnus Ekhall
49f93eb2b0 pacat: Added support for recording from one specific sink input
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=66326
2013-08-14 16:09:54 +03:00
Arun Raghavan
f8f0d4c26b 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.
2013-08-08 11:58:22 +05:30
Arun Raghavan
bc7aaff377 alsa: Trivial whitespace deletion 2013-08-08 11:55:13 +05:30
Arun Raghavan
e870da40c3 doc: Update LICENSE to reflect optional libpulse dep on libdbus 2013-08-07 23:16:30 +05:30
Alexander Couzens
9fa3466366 thread-mq: Support a mainloop as thread/consumer
This is needed by the tunnel module rewrite, which runs pa_mainloop in
the IO thread instead of pa_rtpoll.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2013-08-06 18:26:26 +03:00
Cheng-Chia Tseng
7682cab60e i18n: Update zh_TW translation
https://bugs.freedesktop.org/show_bug.cgi?id=56454
2013-08-06 09:34:11 +05:30
Peter Meerwald
834d10fe65 cli: Use pa_xnew0 to save some 0 inits
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-08-02 16:25:42 +02:00
Peter Meerwald
193bf997c1 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

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-08-02 16:25:27 +02:00
Peter Meerwald
e729783331 cli: Output prompt and welcome message only when requested by 'hello'
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-08-02 16:24:41 +02:00
David Henningsson
e6051cdf8d 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.)

BugLink: https://bugs.launchpad.net/1085402
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-08-02 15:17:04 +02:00
Arun Raghavan
55e169655d sample: Apply SPARC-specific condition on SPARC only
Improves correctness, unbreaks software volume in recent Android.
2013-08-02 14:25:29 +05:30
Kerrick Staley
328ef1d35a Fix typos in command_names 2013-07-31 14:25:17 +02:00
Tanu Kaskinen
1470fc325a resampler: Fix peaks resampler's channel handling
In the resampling phase the input and output data have the same number
of channels (o_ss.channels).
2013-07-29 10:49:19 +03:00
Tanu Kaskinen
60f1e695fd loopback: Increase the maximum allowed latency
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.
2013-07-29 10:43:12 +03:00
David Henningsson
908deb136c alsa-ucm: Make combination ports have lower priority
Usually, you want to use one input or output at a time: e g,
you expect your speaker to mute when you plug in headphones.

Therefore, the headphones+speaker port should have lower priority
and both headphones and speaker.

A practical formula to do this is 1/x = 1/xa + 1/xb + .. + 1/xn.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-07-26 14:30:08 +02:00
David Henningsson
ce21dc4348 daemon.conf: Document new speex-float-1 default
We document the default values in daemon.conf, but this was not
updated when we changed the default from speex-float-3 to speex-float-1.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-07-23 15:58:42 +02:00
Tanu Kaskinen
9813ada2ec vala: Add CVolume.set()
Thanks to Alberto Ruiz for the patch.
2013-07-18 09:16:22 +03:00
Tanu Kaskinen
7c3d31abe7 dbus: Fix invalid dbus_bool_t values
libdbus doesn't like it if it's passed a boolean whose value is not 0
nor 1.
2013-07-17 23:17:23 +03:00
Tanu Kaskinen
afb2c8f9e3 sink: Add missing curly braces
The missing braces didn't cause any practical problems, but obviously
the intention was to reset the chunk only if the memblock was
non-NULL.
2013-07-16 14:01:06 +03:00
Luiz Augusto von Dentz
16886bbf87 pactl: Print available flag of card profiles 2013-07-15 19:51:45 +03:00
Luiz Augusto von Dentz
b98a2e158f introspect: Expose card profile available flag
Available flag can be used by clients to disable the selection of
profiles unavailable.

Update protocol to 29
2013-07-15 19:41:07 +03:00
Tanu Kaskinen
b76b9c32d9 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.
2013-07-15 17:09:07 +03:00
Tanu Kaskinen
b5e1c06a5e log: Harmonize log target output
The file targets used different output format than stderr and syslog.
That's now fixed.
2013-07-15 16:47:29 +03:00
Tanu Kaskinen
a1fdbcfaa7 log: Use pa_write() instead of write() 2013-07-15 16:46:06 +03:00
Tanu Kaskinen
bc2ed3482a log: Remove pa_log_set_fd()
The function isn't used any more.
2013-07-15 16:34:19 +03:00
João Paulo Rechi Vita
4a4b0c6785 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.
2013-07-15 13:08:55 +03:00
João Paulo Rechi Vita
ed4d0d989c bluetooth: Fix coding style 2013-07-15 13:08:20 +03:00
João Paulo Rechi Vita
4359647841 bluetooth: Remove unused DBusError 2013-07-15 13:08:16 +03:00