Commit graph

367 commits

Author SHA1 Message Date
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
Colin Guthrie
7f6531d3ce alsa: cover Input Source:Int Mic
As seen on some HDA chips (e.g. Fujitsu Siemens S6410)
Refs http://pulseaudio.org/ticket/772
2010-02-09 22:32:53 +00:00
Lennart Poettering
c88e4680f0 alsa: ignore volume changes from the hw if we are not on the active console 2010-02-09 22:32:28 +00:00
David Kågedal
cb38d4eba1 alsa: add profile set for M-Audio FastTrack Pro USB 2010-01-05 20:14:11 +01:00
Lennart Poettering
6daf112ce0 alsa: fix minor sampling rate deviations before adjusting the buffer size 2009-11-20 20:27:03 +01:00
Lennart Poettering
bd3467ff2f alsa: fix log output when the audio device refuses to give us again the same period settings we had before 2009-11-20 20:00:26 +01:00
Lennart Poettering
53b046d5c9 alsa: disable timer-based scheduling inside a VM
In virtual machines sound card clocks and OS scheduling tend to become
unreliable, adding various 'uneven' latencies. The adaptive algorithm
that handles drop-outs does not handle it this well: in contrast to
drop-outs on real machines that are evenly distributed, small and can
easily be encountered via the adpative algorithms, drop-outs in VMs tend
to happen abruptly, and massively, which is not easy to counter.

This patch simply disables timer based scheduling in VMs reverting to
classic IO based scheduling. This should help make PA perform better in
VMs.

https://bugzilla.redhat.com/show_bug.cgi?id=532775
2009-11-05 03:23:08 +01:00
Lennart Poettering
19516d4e7f alsa: introduce more standard path names 2009-11-05 03:21:10 +01:00
Lennart Poettering
83b181f92a alsa: cover 'Analog Output' control
http://pulseaudio.org/ticket/702
2009-11-04 00:15:47 +01:00