Commit graph

425 commits

Author SHA1 Message Date
Tanu Kaskinen
46359043c4 alsa-mixer: Fix path set building when using the element-output or element-input mapping options in profile set configuration.
When creating synthesized paths, pa_alsa_path_set_new() created duplicate
elements for each path, and one of the duplicate elements would be marked as
required absent. That made path probing fail. While debugging this, I noticed
also that pa_alsa_path_synthesize() didn't initialize p->last_element properly.
2011-02-25 15:44:44 +00:00
Pierre-Louis Bossart
051d82133f alsa: disable period wakeups in tsched mode if possible
This patch reflects a new capability that Lennart was wishing
for. Wish granted...

Re-submitting it now that alsa-lib 1.0.24
provides additional entry points to disable period
wakeups in timer-scheduling mode if hardware can
work without it (HDAudio, oxygen and Intel SST).

    Example with standard playback on HDAudio output
    Before change:

    Top causes for wakeups:
       3.8% (  5.4)   [hda_intel] <interrupt>
       2.8% (  4.0)   alsa-sink

    After change:
    Top causes for wakeups:
       2.3% (  3.0)   alsa-sink

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2011-02-01 09:41:02 +00:00
Maarten Bosmans
974af43507 build: Don't include empty Makefile.am in subdirs 2011-01-31 12:40:43 +00:00
Lennart Poettering
1250b5d735 ratelimit: fix log levels of log suppression messages
When logging a suppression message do so on the same log level as the
suppressed messages.

Cherry picked by Colin Guthrie from ec5a785712
with a couple of additional changes due to extra limiting in master
that was not present in stable-queue.
2011-01-31 11:36:24 +00:00
Jyri Sarha
aefa94f052 alsa-sink: Don't assume we were able to enable hw-volume or sync-volume (v1.1)
This patch also disables mixer callback code if we do not have neither
HW-volume or HW-mute.
2011-01-15 13:26:21 +00:00
Jyri Sarha
98db3dffb6 alsa-sink: Fix double use of string 2011-01-15 13:26:07 +00:00
Zhang Wanming
0c0c285e79 Fix typos 2010-12-20 11:07:30 +00:00
Colin Guthrie
3e28f60592 build-sys: Replace dummy Makefiles with proper Makefile.am's
This is needed to better support out of tree builds (including
distcheck) and to ensure the necessary folders are created in the
build tree on configure and also works around an intl-tools bug
(https://bugs.launchpad.net/intltool/+bug/605826)

The Makefile.am's used are minimal (and in some cases completely
blank). At present they do not include anything interesting
with the majority of the real work still done by the monolitic
src/Makefile.am

It may make sense to start splitting out src/Makefile.am into
smaller chunks but this commit makes the minimum changes to address
the issues that result from using make distcheck and other out of
tree builds.

Note: This 'breaks' the ability to type make in e.g. the src/modules
folder and have all of PA rebuilt accordingly (this is because the
static Makefiles previously present just did a "make -C ..") which
was purportedly for use in emacs. But I'm sure there will be a better
and more robust way to configure emacs to do your builds properly if
this behaviour is still desirable.
2010-12-05 15:58:59 +00:00
Juho Hämäläinen
027786c6de alsa-sink: take base volume into account when applying hw volume
Currently if sink base volume differs from 0dB and sync-volume is used,
wrong volume values are written to hw. This patch fixes that.

Signed-off-by: Juho Hämäläinen <ext-juho.hamalainen@nokia.com>
2010-12-01 10:42:17 +00:00
Lennart Poettering
af18bc8038 alsa-source: fix enum types 2010-11-25 16:38:32 +00:00
Lennart Poettering
c72d878913 alsa-mixer: make a few strings translatable
Original patch contributed by 'kelemeng'

http://pulseaudio.org/ticket/843
2010-11-25 16:38:18 +00:00
Daniel T Chen
148a90e482 Handle 'Internal Mic 1' as an 'Input Source'
BugLink: https://launchpad.net/bugs/680810

Some laptops have 'Internal Mic 1' exposed as an 'Input Source', e.g., Dell
XPSM 1530, so handle these, too.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2010-11-25 15:14:54 +00:00
David Henningsson
c2c11603a1 Add "Rear Mic" to alsa mixer paths.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2010-11-25 15:14:48 +00:00
Tanu Kaskinen
f1e43cd9b8 alsa: Print dB values in addition to percentages in debug messages.
How about this? There are a couple of bugs in sink_write_volume_cb,
by the way. Another patch will be sent once this dB value printing
patch is accepted.
-- 8< --
2010-11-19 16:21:21 +00:00
Arun Raghavan
1cbacead13 alsa: Sprinkle some PA_UNLIKELYs around error checks
This just adds a few PA_UNLIKELY macros around some error paths in
frequently called code.
2010-11-18 08:51:06 +00:00
Pierre-Louis Bossart
13cce22268 alsa: remove redundant call to snd_pcm_nonblock()
The PCM handle is already opened with the SND_PCM_NONBLOCK flag.
This additional call is useless.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2010-11-16 21:05:22 +00:00
Daniel Mack
8aa332c6f5 alsa-mixer: add profile for Native Instruments Korecontroller 2010-10-16 12:23:46 +01:00
Jyri Sarha
3e53e3bba3 daemon-conf: Add sync volume parameters to daemon-conf
Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com>
Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com>
Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
2010-10-16 11:53:39 +01:00
Jyri Sarha
1bea955829 alsa: Take syncronized HW volume infra into use for alsa-sink
Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com>
Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com>
Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
2010-10-16 11:53:39 +01:00
Colin Guthrie
2ecd764662 alsa: Only set the 'first' flag to false when we actually call snd_pcm_start()
Previously, if work_done was false, we could conceivably not call snd_pcm_start().
2010-09-14 19:44:57 +01:00
Colin Guthrie
f97faae006 alsa: Set the rewind safeguard proportionally to sample spec
Currently when rewinding alsa, a fixed value of 256 bytes is used,
which represents 1.33ms @ 48kHz (2ch, 16bit). This is typically fine
and due to DMA constraints we would not want to rewind less than this.

However with more demanding sample specs, (e.g. 8ch 192kHz 32bit)
256 bytes is likely not sufficient, so calculate what 1.33ms would
be and use which ever value is bigger.

Discussed with David Henningsson and Pierre-Louis Bossart here:
 http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/7286
2010-09-14 08:32:51 +01:00
Daniel Mack
d30d22dfb8 alsa-mixer: add profile for Traktor Kontrol S4
This new audio interface from Native Instruments has 2 stereo channels
for both input and output direction. This patch adds mappings for them.
2010-09-12 13:15:36 +01:00
Wim Taymans
c47d689613 alsa: make defines for smoother configuration
Make new defines for the smoother window size and adjust time constants instead
of reusing some unrelated constant.

Increase the smoother window size even more because the bigger it is, the
better. Since we have a 200ms max update interval and the max smoother history
is 64 entries, 10seconds is a good default.

Decrease the smoother adjust time to 1 second. The previous value of 4 seconds
was too much to adapt quickly after a resume.
2010-09-09 17:03:45 +01:00
Wim Taymans
f29acfd0e0 alsa: work around slightly broken _delay implementations
Use snd_pcm_avail_delay() in pa_alsa_safe_delay() so that we can check the delay
value against the avail value and patch it up when it looks invalid. Only do
this for capture.
2010-09-09 17:03:34 +01:00
Wim Taymans
e382589d84 alsa-source: refactor smoother and device start
Move the code to start the capture and the smoother closer together to improve
smoother accuracy.
Rework things to look more like the alsa sink where the device is started in
only one place.
2010-09-07 12:22:51 +02:00
Wim Taymans
dc5ec2c296 alsa: increase the smoother window
40ms for the smoother window is too small. Increase the size to 4 seconds, like
we do for the sinks.
2010-09-03 16:49:03 +02:00
Tanu Kaskinen
a543af539c alsa-sink/source: Use the "namereg_fail" module argument.
This allows the name registry to mangle the names of auto-detected sinks and
sources to be unique, which makes it possible to load multiple identical sound
cards using module-udev-detect.

At least for now the module argument can only be passed through
module-alsa-card.
2010-08-30 18:34:41 +03:00
Tanu Kaskinen
0525807b63 alsa-sink: Get rid of a compiler warning regarding rewind_safeguard type.
GCC gave a warning, because the pointer given to pa_modargs_get_value_u32() had
type size_t instead of uint32_t.
2010-08-24 18:19:49 +03:00
Tanu Kaskinen
c277dc65a3 module-alsa-card: New argument: namereg_fail.
This is added so that module-udev-detect can load multiple module-alsa-card
instances with the same card name - forcing namereg_fail to false allows the
name registry to mangle the card names to be unique.
2010-08-24 17:58:35 +03:00
Wim Taymans
ef8abcb1b5 alsa: resume smoother after unsuspend
The smoother is paused when the device is suspended but never resumed on
unsuspend. Pass the paused = FALSE flag to the pa_smoother_reset() call to make
it unpause when unsuspending. This patch improves source timings quite a bit.
2010-08-23 11:59:13 +02:00
Pierre-Louis Bossart
9b6c84ad6e AC3 passthrough support
Second version after Tanu's feedback

TODO:
    - notify client that volume control is disabled
    - change sink rate in passthrough mode if needed
    - automatic detection of passthrough mode instead of hard
    coded profile names

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2010-08-12 18:20:27 +01:00
Pierre-Louis Bossart
f26c849efc alsa: add missing iec958 files from previous commit 2010-07-15 08:18:29 +01:00
Pierre-Louis Bossart
fb405765d9 alsa: fix mixer profiles, add passthrough config
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2010-07-13 23:33:45 +01:00
Pierre-Louis Bossart
cb55b00ccd alsa: disable rewinds when using ALSA plugins
This is required to when playing on a52: device, rewind is broken
in those plugins.
Credits to Michael Rans <mcarans@yahoo.co.uk> for finding this
workaround, and Tanu Kaskinen <tanuk@iki.fi> for providing
valuable feedback.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2010-07-13 22:10:39 +01:00
Colin Guthrie
3ede7e4c01 alsa: Fix assertion on mmap_write (triggered via a52 plugin) 2010-07-13 22:08:23 +01:00
Tanu Kaskinen
7bc5cd7845 alsa: Fix log output to inform about positive base volumes correctly.
Positive base volume can happen, if the alsa volume range has been limited. For
example, in an embedded environment it may be known that the sound device is
capable of louder output than what the speakers can handle, so setting the max
volume below 0 dB makes sense.
2010-05-10 14:07:12 +03:00
Tanu Kaskinen
6a5f0ba431 alsa-mixer: Replace erroneous PA_ALSA_VOLUME_IGNORE with PA_ALSA_ENUMERATION_IGNORE.
This fix doesn't have any concrete effect, because the two constants have the
same value.
2010-05-10 14:05:25 +03:00
Tanu Kaskinen
77312d06c8 alsa-mixer: Use pa_xfree() instead of pa_xstrdup() for freeing a string. 2010-05-10 14:04:51 +03:00
Daniel T Chen
f7b262763a alsa: Handle 'Digital Mic' as an 'Input Source'
BugLink: https://launchpad.net/bugs/533877

Some laptops have 'Digital Mic' exposed as an 'Input Source', e.g., Dell
XPS 1330, so handle these, too.
2010-05-08 14:20:06 +01:00
Pierre-Louis Bossart
4df443bbe6 add rewind-safeguard parameter
Rewinding the ring buffer completely causes audible issues with DMAs.
Previous solution didn't work with tsched=0, and used tsched_watermark
for guardband, which isn't linked to hardware and could become really high
if underflows occurred.

Added separate parameter that can be tuned to hardware limitations and size
of DMA bursts.
2010-05-08 01:38:25 +02:00
Lennart Poettering
cdc2769162 thread: name all threads so that the names appear in /proc/$PID/task/$TID/comm 2010-05-07 23:58:59 +02:00
Lennart Poettering
d11cd33e3a alsa: don't make use of tsched related variables when tsched is disabled 2010-02-23 03:23:22 +01:00
Lennart Poettering
250aeceb4d alsa: reset max_rewind/max_request while suspending 2010-02-22 04:54:24 +01:00
Lennart Poettering
0b3d7c637c alsa-util: strip spaces from ALSA card/pcm names
http://pulseaudio.org/ticket/778
2010-02-21 22:00:49 +01:00
Lennart Poettering
abfd2aa0e7 alsa: use default output port names
instead of coming up with pointless aliases, reuse the already established
names, for second headphones, and second speakers.
2010-02-21 17:47:23 +01:00
Lennart Poettering
dfa00bf8f8 alsa: cover "Internal Mic" elements
https://bugzilla.redhat.com/show_bug.cgi?id=562216
2010-02-21 17:47:13 +01:00
Lennart Poettering
67e3925795 alsa: cover 'Shared Mic/Line in', 'Analog Source'
https://bugzilla.redhat.com/show_bug.cgi?id=558638
2010-02-21 17:47:09 +01:00
Lennart Poettering
14e4369bee alsa: cover "Desktop Speaker" mixer elements
As exposed by really old Microsoft USB sound systems
2010-02-21 17:47:01 +01:00
Lennart Poettering
4315f277bc alsa: cover bass boost mixer element
http://pulseaudio.org/ticket/740
2010-02-09 22:43:14 +00:00
Colin Guthrie
7b89c8531c alsa: Cover the 'Int Mic Boost' element.
This is not 100% ideal as we have not way to tie specific boosts to specific
inputs and this particular chipset (as noted in #772) appears to
support just that.

For the time being incorporate it into the normal boost logic.

See http://pulseaudio.org/ticket/772
2010-02-09 22:33:18 +00:00