Commit graph

6481 commits

Author SHA1 Message Date
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
Lennart Poettering
bea524cb7a util: use the return value of gethosid() as fallback, not the address of the function
Yikes!
2012-05-15 14:13:19 +02:00
Lennart Poettering
10f146ddc8 util: /etc/machine-id should be tried first, the D-Bus only as fallback for legacy systems 2012-05-15 14:13:19 +02:00
Lennart Poettering
3173358f76 proplist: document new meaning of the session ID 2012-05-15 14:06:46 +02:00
Lennart Poettering
8a55219599 util: XDG_SESSION_COOKIE is unsuitable as session ID
XDG_SESSION_COOKIE was supposed to be used for access control to the
session and should not be exposed to other users.

Replace usage of XDG_SESSION_COOKIE by XDG_SESSION_ID which is the right
choice here since it is actually a proper session ID that may be
published.
2012-05-15 14:04:31 +02:00
Arun Raghavan
8f540c6e76 sink-input,source-output: Avoid unneccessary rate updates
This makes sure we only call sink/source update_rate() if the stream
being woken up has a sample spec that doesn't match the corresponding
device'.

https://bugs.freedesktop.org/show_bug.cgi?id=49875
2012-05-14 12:29:13 +05:30
poljar
d85360e65c pacmd: Added --help and --version descriptions to the man page.
The pacmd man page should show the available options. A simple
description for the --version and --help option was added.
2012-05-13 19:39:23 +03:00
Arun Raghavan
ed85ad64cf build-sys: Bump soname
Double-bump since v1.99.2 got a bump but the commit never landed.
2012-05-11 18:51:37 +05:30
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
1eb7c4a465 resampler: Add support for resamplers that consume less data than asked.
libsamplerate_resample() assumed that src_process() would
always consume the whole input buffer. That was an invalid
assumption leading to crashes.

This patch adds a leftover memchunk for storing any
non-consumed input. When pa_resampler_run() is called next
time, the leftover is prepended to the new input.

Changes in v3:
 - Make the calculations in pa_resampler_result() and
   pa_resampler_max_block_size() more readable and more
   correct.
 - Rework the leftover storing: instead of using a dedicated
   buffer for it, store it in the beginning of remap_buf.
   This can avoid some memory copying. (The idea was
   suggested by Wang Xingchao.)
 - Use a generic save_leftover() function instead of doing
   the leftover copying in the resampler implementation.
 - Use the leftover logic also with the speex and ffmpeg
   resamplers.
   [ed: dropped the speex bit since the API guarantees that
    it will consume everything -- Arun]

Changes in v2:
 - If add_leftover() is called with zero-length input while
   the leftover length is non-zero, we don't try to acquire
   the input memblock.
 - Instead of taking a reference to the original input in
   libsamplerate_resample(), we copy the leftover data to a
   new memblock. This is done, because otherwise, if the
   input is one of the internal buffers, the data can get
   overwritten before reading it in add_leftover().
 - Store add_leftover_buf size in bytes instead of samples
   (more convenient, but less consistent with other code).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=47156
2012-05-11 16:29:20 +05:30
Tanu Kaskinen
1a75e1c297 resampler: Use more descriptive buffer names. 2012-05-11 16:26:42 +05:30
Tanu Kaskinen
7921a851eb resampler: Use pa_xnew0() to avoid manual zeroing. 2012-05-11 16:26:38 +05:30
poljar
a6394b1cb0 pacmd: Added --help and --version options.
All utilities should have the --help and --version command line options.
These two were added to pacmd, also the goto label was changed from fail
to quit like in the other utilities.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45030
2012-05-05 13:35:18 +03:00
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
Paul Menzel
fed2d8d4e8 doc: Add entry for correct spelling
Due to the formatting of `README` the only occurence of PulseAudio in a
text is capitalized. People reading `README` should at least see the
correct spelling once.

In contrast to reformat just add a spelling section as an easy solution.

Since it is not that important the last place in the ordering might
suffice.
2012-04-27 13:13:23 +05:30
David Henningsson
38b24e40fc sink/source.h: Clarify set_port comment
State which thread calls set_port in which scenario.

Reported-by: Jyri Sasha <oku@iki.fi>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-04-18 11:41:48 +02:00
Peter Meerwald
9e55b29c28 pulse: Fix warning in introspect.h; minor rewording and punctuation. 2012-04-17 18:15:42 +03:00
Peter Meerwald
a3513e7c9d pulse: Clarify proplist doxygen documentation. 2012-04-17 18:15:29 +03:00
Peter Meerwald
92fbb294b7 core: Fix comments. 2012-04-17 18:15:21 +03:00
Peter Meerwald
202b7e3abb echo-cancel: Upper/lowercase in comment. 2012-04-17 18:15:03 +03:00
Peter Meerwald
e724bcdb73 build: Fix spelling in src/Makefile.am. 2012-04-17 18:14:50 +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
Colin Guthrie
29e4b187a3 cli: Allow source-output volumes/mute to be set via CLI
This should have been done a long time ago but it brings symmetry to the API
2012-04-10 09:49:27 +01:00
Colin Guthrie
aa19646d34 man: Document the cli inteface a little.
This just documents the cli interface syntax. Mostly a lift from
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/CLI
with some minor editing and bringing up to date.

Also document a few undocumented commands.

Shuffle around the order in 'pacmd help' output to match the order
in the new docs for consistency.

https://bugs.freedesktop.org/show_bug.cgi?id=45029
2012-04-10 09:49:27 +01: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
1c134f4517 dbus: Add assertions to get rid of warnings from Coverity.
Coverity thinks that expected_method_sig can be NULL when
it's dereferenced by pa_streq(). Adding assertions doesn't
hurt here (in my opinion), and that should get rid of the
warnings.
2012-03-28 17:34:19 +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
2f7a586a23 sample-util: Remove redundant check from pa_volume_memchunk.
Add also an assertion for the sample spec validity. The
existing code already does crash in case of an invalid
sample spec, but the error would not be as obvious: the
crash would happen due to a divide-by-zero operation in
pa_frame_aligned().
2012-03-28 17:22:44 +03:00
Tanu Kaskinen
c2c5e044cc padsp: Fix a double-free bug. 2012-03-28 17:22:23 +03:00
Tanu Kaskinen
bce720c85d dbus: Fix device latency querying. 2012-03-28 17:21:59 +03:00
David Henningsson
b7fab75fdd sink-input/source-output: Prevent filter sink/source cycles
Misbehaving clients can try to set a filter sink to output to
itself, leading to crashes later on. This patch protects us from that.

Thanks to Roman Beslik for testing and finding an error in the first
version of this patch.

Tested-by: Roman Beslik <rabeslik@gmail.com>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=44397
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-28 13:19:47 +02: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
Pino Toscano
8499afc36f libpulse: Cope with systems not implementing SA_NOCLDWAIT
Even though SA_NOCLDWAIT is a POSIX mandatory flag the Hurd doesn't
implement it. So let's only check for it if it's defined.
2012-03-28 16:23:52 +05:30
Colin Guthrie
8ea6b0585e Revert "resamplers: Optimize trivial resampler"
This causes problems with 24kHz audio (results in echoing)
when upscaling to 44.1kHz or 48kHz.

It can be reapplied when the optimisation works for all cases.

This reverts commit 8539fe9765.
2012-03-28 11:31:36 +01:00
Colin Guthrie
664985b7c2 core-util: Attempt to make runtime paths smaller to avoid 108 char limit.
When the runtime path gets long (which can happen on some NFS
mounts where $HOME is not just /home/$USER), it can grow
longer the 108 char limit imposed by sockaddr_un.sun_path.

This just calls realpath which should ultimately point into
/tmp in most cases and result in a much smaller path.

Only do this when we are adding on a name component to the
runtime path so creating the actual symlink will still get
the original, long name, but this shouldn't be a problem
as it never goes into the sockaddr_un.sun_path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44680
2012-03-28 11:17:29 +01:00
Arun Raghavan
5e9e0d5086 stream: Fix sample spec initialisation for extended API
This fixes pa_sample_spec init to use the correct API. Not doing so
triggers a valgrind warning as we call pa_sample_spec_valid() on this
later on, which checks the rate and channels fields. Thanks to Rémi
Denis-Courmont for reporting this.
2012-03-28 01:26:07 +05:30
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