summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-sink.c
Commit message (Collapse)AuthorAgeFilesLines
* alsa-sink: fix mmap_write() work_doneWu Fengguang2011-06-281-1/+1
| | | | | mmap_write() work_done is wrongly initilized to TRUE. It ends up never being FALSE. Fix it to reduce the costly update_smoother() calls.
* Remove unnecessary #includesMaarten Bosmans2011-06-221-2/+1
|
* alsa-mixer: select nearest alsa volume step in sync-volume modeJuho Hämäläinen2011-06-221-3/+3
|
* alsa-sink: Some trivial tidyupsColin Guthrie2011-06-221-3/+2
| | | | | Mostly typo fixes but also a change to make a function relating to sink inputs use more generic variable names.
* core: Factor out passthrough checks into their own functionsArun Raghavan2011-05-021-2/+2
| | | | | | | | | | Since we currently have two mechanisms to signal a passthrough connection (non-PCM format or PA_SINK_INPUT_PASSTHROUGH flag), we move all the related checks into functions and use those everywhere. This makes things more consistent, and should we decide to get rid of the flag, we only need to change pa_sink_input_*_is_passthrough() accordingly.
* alsa: Reconfigure sink sample rate for passthrough inputsArun Raghavan2011-05-021-0/+52
| | | | | | When a passthrough sink-input is added, we need to reconfigure the sink's sample rate since no resampling occurs. We revert to the original rate when the passthrough sink-input is removed.
* sink: Remove PASSTHROUGH flagArun Raghavan2011-05-021-7/+0
| | | | | | | This removes the passthrough flag from sinks since we will drop exclusively passthrough sinks in favour of providing a list of formats supported by each sink. We can still determine whether a sink is in passthrough mode by checking if any non-PCM streams are attached to it.
* alsa: Fix log output to inform about positive base volumes correctly.Tanu Kaskinen2011-04-041-4/+1
| | | | | This fix was done for _set_port_cb() already, but the first fix didn't fix setup_mixer(). Now that's done too.
* ratelimit: fix log levels of log suppression messagesLennart Poettering2011-01-311-3/+3
| | | | | | | | | When logging a suppression message do so on the same log level as the suppressed messages. Cherry picked by Colin Guthrie from ec5a7857127a1b3b9c5517c4a70a9b2c8aab35ca with a couple of additional changes due to extra limiting in master that was not present in stable-queue.
* alsa-sink: Don't assume we were able to enable hw-volume or sync-volume (v1.1)Jyri Sarha2011-01-151-21/+21
| | | | | This patch also disables mixer callback code if we do not have neither HW-volume or HW-mute.
* alsa-sink: Fix double use of stringJyri Sarha2011-01-151-6/+8
|
* alsa-sink: take base volume into account when applying hw volumeJuho Hämäläinen2010-12-011-2/+8
| | | | | | | 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>
* alsa: Print dB values in addition to percentages in debug messages.Tanu Kaskinen2010-11-191-10/+28
| | | | | | | 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< --
* daemon-conf: Add sync volume parameters to daemon-confJyri Sarha2010-10-161-0/+1
| | | | | | Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com> Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com> Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
* alsa: Take syncronized HW volume infra into use for alsa-sinkJyri Sarha2010-10-161-13/+116
| | | | | | Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com> Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com> Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
* alsa: Only set the 'first' flag to false when we actually call snd_pcm_start()Colin Guthrie2010-09-141-1/+2
| | | | Previously, if work_done was false, we could conceivably not call snd_pcm_start().
* alsa: Set the rewind safeguard proportionally to sample specColin Guthrie2010-09-141-2/+3
| | | | | | | | | | | | | 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
* alsa: make defines for smoother configurationWim Taymans2010-09-091-2/+5
| | | | | | | | | | | | 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.
* alsa: work around slightly broken _delay implementationsWim Taymans2010-09-091-1/+1
| | | | | | 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.
* alsa-sink/source: Use the "namereg_fail" module argument.Tanu Kaskinen2010-08-301-1/+14
| | | | | | | | | 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.
* alsa-sink: Get rid of a compiler warning regarding rewind_safeguard type.Tanu Kaskinen2010-08-241-2/+2
| | | | | GCC gave a warning, because the pointer given to pa_modargs_get_value_u32() had type size_t instead of uint32_t.
* AC3 passthrough supportPierre-Louis Bossart2010-08-121-0/+7
| | | | | | | | | | | | 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>
* alsa: disable rewinds when using ALSA pluginsPierre-Louis Bossart2010-07-131-2/+12
| | | | | | | | | | 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>
* alsa: Fix assertion on mmap_write (triggered via a52 plugin)Colin Guthrie2010-07-131-0/+3
|
* alsa: Fix log output to inform about positive base volumes correctly.Tanu Kaskinen2010-05-101-4/+1
| | | | | | | 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.
* add rewind-safeguard parameterPierre-Louis Bossart2010-05-081-4/+14
| | | | | | | | | | 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.
* thread: name all threads so that the names appear in /proc/$PID/task/$TID/commLennart Poettering2010-05-071-1/+1
|
* alsa: don't make use of tsched related variables when tsched is disabledLennart Poettering2010-02-231-11/+23
|
* alsa: reset max_rewind/max_request while suspendingLennart Poettering2010-02-221-1/+10
|
* alsa: ignore volume changes from the hw if we are not on the active consoleLennart Poettering2010-02-091-0/+3
|
* alsa: fix log output when the audio device refuses to give us again the same ↵Lennart Poettering2009-11-201-1/+1
| | | | period settings we had before
* alsa: disable timer-based scheduling inside a VMLennart Poettering2009-11-051-4/+1
| | | | | | | | | | | | | | | 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
* alsa: disable period event only with tsched=1Lennart Poettering2009-10-061-1/+1
|
* alsa: properly report suspension error codesLennart Poettering2009-09-111-9/+14
|
* alsa: disable tsched for software devices before we configure the buffer ↵Lennart Poettering2009-09-091-5/+0
| | | | metrics so that we don't accidently set a buffer size that is suitable for tsched where we don't use tsched
* alsa: pass SND_PCM_NONBLOCK when opening device during unsuspend, the same ↵Lennart Poettering2009-09-091-1/+1
| | | | way we do it for initial opening
* alsa: rework buffer/period configurationLennart Poettering2009-09-091-20/+24
| | | | | | | | | | | | | - 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.
* alsa-sink: init after_avail earlier (llvm-clang-analyzer)Lennart Poettering2009-09-081-1/+1
|
* llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixesLennart Poettering2009-09-081-2/+1
|
* alsa: by default increase watermarks only on real underruns, don't try to be ↵Lennart Poettering2009-09-011-1/+4
| | | | smart
* alsa: distuingish real underruns from left_to_play=0Lennart Poettering2009-09-011-1/+3
|
* alsa: automatically decrease watermark after a time of stabilityLennart Poettering2009-08-241-34/+112
|
* alsa: increase interval between smoother updates exponentially for alsa ↵Lennart Poettering2009-08-231-5/+3
| | | | sources, following the scheme for sinks
* alsa-sink: reduce the amount of smoother updatesWim Taymans2009-08-201-4/+22
| | | | | | | Exponentially increase the amount of time between smoother updates. We start with a 2ms interval and increase up to 200ms intervals. Smoother updates and the resulting linear regression take a fair amount of CPU so we want to reduce the amount of updates.
* sink: volume handling rework, new flat volume logicLennart Poettering2009-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - We now implement a logic where the sink maintains two distinct volumes: the 'reference' volume which is shown to the users, and the 'real' volume, which is configured to the hardware. The latter is configured to the max of all streams. Volume changes on sinks are propagated back to the streams proportional to the reference volume change. Volume changes on sink inputs are forwarded to the sink by 'pushing' the volume if necessary. This renames the old 'virtual_volume' to 'real_volume'. The 'reference_volume' is now the one exposed to users. By this logic the sink volume visible to the user, will always be the "upper" boundary for everything that is played. Saved/restored stream volumes are measured relative to this boundary, the factor here is always < 1.0. - introduce accuracy for sink volumes, similar to the accuracy we already have for source volumes. - other cleanups.
* udev: allow passing of ignore_dB= parameter to alsa modulesLennart Poettering2009-08-191-13/+24
|
* log: place more rate limit invocationsLennart Poettering2009-08-151-1/+2
|
* alsa: properly treat ESTRPIPE as system suspendLennart Poettering2009-08-041-2/+2
|
* Recover stream when it's suspended upon rewindLubomir Rintel2009-08-031-1/+7
| | | | | | | | | | | | | Error from snd_pcm_rewind() might mean we just woke up from suspend and didn't have a chance to try to recover the stream since we didn't write to it in between. Call try_recover() in such cases. Note that for this to work kernel must return ESTRPIPE instead of EBADF for rewind/forward attempts on suspended streams, so that snd_pcm_recover() can recognize it should snd_pcm_resume() the stream. This is not the case yet (2.6.31-rc5), patch is available. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* alsa: throw timing data away after device resumeLennart Poettering2009-07-241-1/+5
|