Commit graph

195 commits

Author SHA1 Message Date
Wim Taymans
1c29f5582d 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-14 08:46:41 +01:00
Wim Taymans
1503b8cf9b 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-14 08:45:29 +01:00
Colin Guthrie
a65825fa45 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-04 12:49:26 +01:00
Tanu Kaskinen
8748ebdad3 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-09-04 12:49:16 +01:00
Pierre-Louis Bossart
514fd1eee8 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-09-04 11:41:18 +01:00
Lennart Poettering
e2ef3a1391 alsa: don't make use of tsched related variables when tsched is disabled 2010-09-04 11:41:11 +01:00
Wim Taymans
4fb02d8e0e 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:18:29 +01:00
Wim Taymans
93750199f8 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:31:46 +01:00
Pierre-Louis Bossart
aaae99d89f 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-15 12:47:34 +01:00
Colin Guthrie
6c8660abd2 alsa: Fix assertion on mmap_write (triggered via a52 plugin) 2010-07-15 12:47:29 +01:00
Lennart Poettering
bc7314f14e thread: name all threads so that the names appear in /proc/$PID/task/$TID/comm 2010-05-03 13:28:39 +02:00
Daniel T Chen
29845be64d 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-03-12 08:53:23 +00:00
Lennart Poettering
dd682d6f96 alsa: reset max_rewind/max_request while suspending 2010-02-22 05:06:33 +01:00
Lennart Poettering
522c446ddc alsa-util: strip spaces from ALSA card/pcm names
http://pulseaudio.org/ticket/778
2010-02-22 04:55:21 +01:00
Lennart Poettering
307bd142fe 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-16 00:59:24 +01:00
Lennart Poettering
0c836aacd8 alsa: cover "Internal Mic" elements
https://bugzilla.redhat.com/show_bug.cgi?id=562216
2010-02-16 00:58:49 +01:00
Lennart Poettering
7d6bab0d00 alsa: cover 'Shared Mic/Line in', 'Analog Source'
https://bugzilla.redhat.com/show_bug.cgi?id=558638
2010-02-15 23:39:12 +01:00
Lennart Poettering
e8cb96c010 alsa: cover "Desktop Speaker" mixer elements
As exposed by really old Microsoft USB sound systems
2010-02-15 22:23:39 +01:00
David Kågedal
66e1a2d051 alsa: add profile set for M-Audio FastTrack Pro USB 2010-01-15 01:33:35 +01:00
Lennart Poettering
48e0f6808b alsa: cover bass boost mixer element
http://pulseaudio.org/ticket/740
2010-01-14 02:53:50 +01:00
Colin Guthrie
291cd09601 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-01-13 23:47:21 +00:00
Colin Guthrie
67c6535222 alsa: cover Input Source:Int Mic
As seen on some HDA chips (e.g. Fujitsu Siemens S6410)
Refs http://pulseaudio.org/ticket/772
2010-01-13 23:44:00 +00:00
Lennart Poettering
540ec7b961 alsa: ignore volume changes from the hw if we are not on the active console 2010-01-13 20:30:36 +01:00
Lennart Poettering
7ab8e83cb0 alsa: fix minor sampling rate deviations before adjusting the buffer size 2009-11-23 05:03:49 +01:00
Lennart Poettering
366e3ebe19 alsa: fix log output when the audio device refuses to give us again the same period settings we had before 2009-11-23 05:03:41 +01:00
Lennart Poettering
3b25302554 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-11 05:26:36 +01:00
Lennart Poettering
b47a9e7ea4 alsa: introduce more standard path names 2009-11-11 05:17:52 +01:00
Lennart Poettering
ab573f2e06 alsa: cover 'Analog Output' control
http://pulseaudio.org/ticket/702
2009-11-11 05:17:39 +01:00
Lennart Poettering
4323c9f22f alsa: create a seperate mixer path for Speaker elements
On some cards line-out is independant of Sepaker and it is a good idea
to cover that so that they can independantly be activated.

https://bugzilla.redhat.com/show_bug.cgi?id=520884
2009-11-11 05:17:32 +01:00
Lennart Poettering
8a26fbf863 alsa: leave other headphone control enabled if possible 2009-11-11 05:17:26 +01:00
Lennart Poettering
08d0654867 alsa: lower priority for Headphone2 path 2009-11-11 05:17:19 +01:00
Lennart Poettering
18018b3ff3 alsa: cover Input Source:AUX IN
As seen on some HDA chips:

https://bugzilla.redhat.com/attachment.cgi?id=359804
2009-11-11 05:17:12 +01:00
Lennart Poettering
d711caa38c alsa: cover Headphone2 mixer element
As seen on some drivers:

https://bugzilla.redhat.com/show_bug.cgi?id=498612
2009-11-11 05:17:06 +01:00
Lennart Poettering
82d7b75528 alsa: cover 'Digital Input Source' element
As used by some HDA devices:

https://bugzilla.redhat.com/attachment.cgi?id=365290
2009-11-11 05:17:00 +01:00
Lennart Poettering
6fad76558d alsa: cover Mic Jack Mode element
As used by some HDA chips:

https://bugzilla.redhat.com/attachment.cgi?id=366816
2009-11-11 05:16:53 +01:00
Lennart Poettering
833bf30cb9 alsa: disable period event only with tsched=1 2009-11-11 05:11:49 +01:00
Lennart Poettering
88b777311d alsa: make build gcc clean on 32bit 2009-09-20 03:17:36 +02:00
Colin Guthrie
fd25e8fa8b alsa: Give all ports a human name to allow UI tools to present the choice to users. 2009-09-18 09:22:23 +01:00
Lennart Poettering
a37e48a819 alsa: fix Surround mixer element name
s/Sourround/Surround/

Spotted by Colin Guthrie
2009-09-18 04:14:36 +02:00
Vladimir Kokarev
e63c867f87 alsa: correct assumptions about channels an element lacks
If an element does not control some channels assume they are 0dB in
comparison to the other elements, i.e. do not influence the volume at
all. Previously we were assuming they were as high as the highest of the
channels we do control.
2009-09-17 01:26:18 +02:00
Lennart Poettering
80b4457476 alsa: properly report suspension error codes 2009-09-11 01:22:10 +02:00
Lennart Poettering
bb36bb4bbe alsa: properly convert sample buffer sizes 2009-09-11 01:21:46 +02:00
Lennart Poettering
d5f43bd4c6 alsa: disable tsched for software devices before we configure the buffer metrics so that we don't accidently set a buffer size that is suitable for tsched where we don't use tsched 2009-09-09 23:57:49 +02:00
Lennart Poettering
8364b959b4 alsa: when probing for profiles configure buffer/period sizes since some broken drivers apparently need that 2009-09-09 23:56:51 +02:00
Lennart Poettering
84ade2140e alsa: pass SND_PCM_NONBLOCK when opening device during unsuspend, the same way we do it for initial opening 2009-09-09 04:44:51 +02:00
Lennart Poettering
557c429510 alsa: rework buffer/period configuration
- As discussed on alsa-devel it's probably better to initialize the
  buffer size first, followed by the period size. If that fails try the
  other way round. If that fails try to configure only buffer size. If
  that fails try to configure only period size. Finally, try to
  configure neither.

- Don't require integral periods anymore.

Both of these changes should help improving compatibility with various
weirder sound devices, such as TV cards.
2009-09-09 04:28:52 +02:00
Lennart Poettering
382eced35d alsa-sink: init after_avail earlier (llvm-clang-analyzer) 2009-09-08 23:47:23 +02:00
Lennart Poettering
f5046759cd llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixes 2009-09-08 23:46:23 +02:00
Lennart Poettering
8cd635bc61 alsa: add more input sources to path set 2009-09-03 04:45:55 +02:00
Lennart Poettering
46b9ca7fd5 alsa: by default increase watermarks only on real underruns, don't try to be smart 2009-09-01 04:55:05 +02:00