Takashi Iwai [Thu, 14 Jun 2012 11:14:48 +0000 (13:14 +0200)]
alsactl: Read only *.conf files when a directory is passed via INCLUDE
When alsactl init is invoked and a directory path is passed to INCLUDE
command in the config file, read only *.conf files in that directory.
This will avoid reading backup files or invalid files that have been
created accidentally.
Also by using scandir() with alphasort(), alsactl reads the files in
alphabetical order. Thus it's highly recommended to use some number
prefix to the file name for assuring the order.
Jaroslav Kysela [Sun, 13 May 2012 11:24:01 +0000 (13:24 +0200)]
alsaloop: fix the avail_min setup
The previous code does not work as expected for some period_size
configurations. We do not rely on the period size value, so do not
correlate the avail_min parameter with this value.
Jaroslav Kysela [Wed, 9 May 2012 06:45:47 +0000 (08:45 +0200)]
alsactl: Do not access other cards than specified for init
When the global state does not exist, alsactl tries to
initialize all soundcards. It is not good when alsactl
is called multiple times from udev. Also, selinux can deny
access to non-existent devices.
Mike Frysinger [Wed, 18 Apr 2012 14:25:54 +0000 (10:25 -0400)]
configure.in: look for ncurses pkg-config first
Newer ncurses installs pkg-config files, and these are much easier
to manage when cross-compiling, so default to searching for those.
If they can't be found, we fall back to the existing xxx-config.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Wed, 2 Nov 2011 18:44:12 +0000 (19:44 +0100)]
aplaymidi: clarify multi-port documentation
The man page did not document what happens when multiple ports are
specified; this could be misinterpreted as the events being duplicated
so that they are played on all ports simultaneously. As suggested by
Peter Billam, clarify that these ports are only used for multi-port MIDI
files.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Jaroslav Kysela [Wed, 2 Nov 2011 16:27:47 +0000 (17:27 +0100)]
alsamixer: Fix X-win related crash for PulseAudio plugin (bad linking)
A lot of reports that alsamixer crashes in X terminal when the PulseAudio
CTL plugin is activated were entered to the tracking systems.
I figured that there is a linking clash for the shutdown() function.
The shutdown() function in glibc is socket related, but the alsamixer code
redefines this function and appearently that under some linking
circumstances - which PA client invokes during the runtime dynamic linking
- the wrong function is called.
This patch, for safety, renames the shutdown() function from alsamixer
to app_shutdown(), but it might make sense to figure the real linking
culprit to avoid future surprises.
BugLink: https://bugs.launchpad.net/bugs/816388 Reported-by: Chad Dunlap <cldunlap1@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Michał Górny [Wed, 31 Aug 2011 20:27:10 +0000 (22:27 +0200)]
fix use of $(SED)
The alsactl Makefile used 'sed $(SED)' which is going to failed when SED
is actually set. Replaced that with '$(SED)', and a few 'sed' calls in
alsaconf Makefile as well. Added AC_PROG_SED to configure to have it
set.
Fixes: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5363 Fixes: http://bugs.gentoo.org/show_bug.cgi?id=366587 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Tim Blechmann [Wed, 29 Jun 2011 07:44:06 +0000 (09:44 +0200)]
aplay: increase channel limit to 256
aplay is limited to 32 channels, which makes it impossible to use it for
testing devices with more channels. here we increase the limit to 256,
which should be sufficient for a virtual device made of 4 64-channel
soundcards.
Signed-off-by: Tim Blechmann <tim@klingt.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Daniel T Chen [Sat, 4 Jun 2011 21:44:43 +0000 (17:44 -0400)]
speaker-test.1: Clarify man page by giving examples
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620513
From the Debian bug report:
"The speaker-test manpage could be improved somewhat by helping a
little bit the user determine how to find out the devices he can test.
Based on http://alsa.opensrc.org/Speaker-test I have make some changes
to the manpage (diff attached) to describe a little bit more how
speaker-test can be used alongside 'aplay'.
Please consider the following patch for
alsa-utils-1.0.23/speaker-test/speaker-test.1"
Signed-off-by: Javier Fernández-Sanguino Peña <jfs@debian.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 3 Jun 2011 10:41:26 +0000 (12:41 +0200)]
aplay: Add -i option for interactive mode
The recent addition of pause/resume control via keyboard brought
a problem when aplay/arecord is invoked in background. For avoiding
regressions, it's safer to use non-interactive mode as default and
enable the new feature via an option.
Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stephen Warren [Thu, 2 Jun 2011 22:45:13 +0000 (16:45 -0600)]
alsaucm: Don't double-free empty lists
When snd_use_case_get_list (and hence also snd_use_case_card_list) returns
an empty list, alsaucm still attempts to free it. This ends up double-
freeing the returned list, or worse, freeing an invalid pointer, depending
on how snd_use_case_get_list gets implemented. Fix alsaucm to return early
on empty lists to avoid this.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Stephen Warren [Thu, 2 Jun 2011 22:45:12 +0000 (16:45 -0600)]
alsaucm: Add list1 command for non-tuple lists
snd_use_case_get_list returns lists of strings that are either:
a) A sequence of single strings
b) A sequence of pairs of strings all flattened into a single list
The current list command assumes layout (b) above, and hence prints
nothing when printing a single-entry list that's actually in layout (a).
Add a new command "list1" to dump lists in layout (a).
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The CD analog playback line is seldom used these days, as all
modern players rip the CD and use the DAC on the sound card.
In addition, it causes background hum on some machines.
Therefore keep it muted by default.
BugLink: http://bugs.launchpad.net/bugs/747184 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Peter Korsgaard [Mon, 14 Mar 2011 08:48:13 +0000 (09:48 +0100)]
alsamixer: fix build on uClibc
exp10 is a glibc extension, which isn't supported on uClibc. Luckily,
exp10() is trivial to compute based on exp(), so add a wrapper for
the uClibc case.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Clemens Ladisch [Mon, 6 Dec 2010 13:07:48 +0000 (14:07 +0100)]
alsamixer: use cubic scale for volume bars
Instead of mapping the raw volume values linearly to the screen, use
a mapping where the bar height is proportional to the audible volume,
i.e., where the amplitude is the cube of the bar height.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Clemens Ladisch [Mon, 6 Dec 2010 13:05:10 +0000 (14:05 +0100)]
alsamixer: increase step size for big control value ranges
For controls with a big range, stepping through all values can become
tedious and make it impossible to adjust the volume easily. Therefore,
ensure that all steps are big enough so that the full range has at most
one hundred steps.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Colin Guthrie [Thu, 25 Nov 2010 21:40:25 +0000 (21:40 +0000)]
alsactl: Add a --with-udev-rules-dir configure option.
After the previous patch to install udev rules it is impossible to do a
non-root, custom-prefix make install. This is generally not a problem
when building official packages but it can be a pain for developers
and debuggers etc.
Ozan Çağlayan [Thu, 25 Nov 2010 07:36:37 +0000 (09:36 +0200)]
configure.in: Fix variable name
Fix variable name for --with-asound-state-dir as currently we have
to pass --with-ASOUND_STATE_DIR= which is wrong and inconsistent with
the other switches.
alsactl: Move asound.state location to /var/lib/alsa
.... and add configure switch for it.
/etc might be on a read-only partition which is not suitable for dynamic
data such as the mixer settings. Hence move the location of asound.state
to /var/lib.
This is based on a patch from Ubuntu/Debian which hardcoded the pah in
/var/lib.
Signed-off-by: Lennart Poettering <mznyfn@0pointer.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add minimal systemd and udev support to alsactl so that mixer settings
are restored at boot, when sound cards are plugged in and saved on
shutdown.
This is similar to existing udev/init script solutions in various
distributions.
Note that alsactl is called both synchronously from the udev rules as
well as asynchronously at boot. This is intended, and to ensure two
things:
- At boot the asound.state file might not be readable, since it resides
on a different file system. That means exclusively restoring sound card
settings from udev rules will no suffice, since if the rule is
executed at early boot (for example within udev settle) then the file
will no be readable and cannot be restored.
- We need to ensure that applications monitoring sound cards coming and
going (such as PA) must not get these events before the mixer settings
have been restored. That means the mixer settings must be restored
synchronously withing the udev rules, before the events are passed on
to the apps.
That basically means we need to restore the settings once in udev, to
deal with sound cards becoming available during runtime. And once in
early boot to deal with coldplugged soundcards whose data files might
not have been available at time of plugging. Hence we call alsactl
twice: one from the udev rule, and once from he systemd unit file.
Signed-off-by: Lennart Poettering <mznyfn@0pointer.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Mon, 11 Oct 2010 08:24:14 +0000 (10:24 +0200)]
alsaloop: Fixes and added --workaround option
- added workaround for alsa-lib (pthread configuration parsing issue) -
the workaround must be activated manually using ('--workaround serialopen')
- fixed avail_min initialization (caused high CPU usage or xruns)
- fixed shared buffer initialization (both capture and playback buffers
must have equal number of samples in this config)
Jaroslav Kysela [Wed, 18 Aug 2010 06:29:03 +0000 (08:29 +0200)]
Introduce alsaloop utility
alsaloop allows create a PCM loopback between a PCM capture device
and a PCM playback device.
alsaloop supports multiple soundcards, adaptive clock synchronization,
adaptive rate resampling using the samplerate library (if available in
the system). Also, mixer controls can be redirected from one card to
another (for example Master and PCM).
Stefan Schmidt [Wed, 30 Sep 2009 19:12:17 +0000 (21:12 +0200)]
alsaucm: Add Use Case Manager utility
alsaucm is a command line tool that can be used to generate and debug UCM
configuration files. The alsaucm utility can fully use the UCM functionality
to query and configure all the UCM functionality in alsa-lib.
This work was sponsored by Slimlogic Ltd, Texas Instruments Inc and Wolfson
Microelectronics PLC.
CC: Ian Molton <ian@mnementh.co.uk> CC: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Justin Xu <justinx@slimlogic.co.uk> Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Clemens Ladisch [Wed, 26 May 2010 08:27:25 +0000 (10:27 +0200)]
alsactl: correctly restore dB values of controls with changed range
When the range of a control has changed between driver versions, it is a
good idea to restore the same dB value of the control. However,
computing the dB value by interpolating betweem the min/max dB values
duplicates alsa-lib's TLV functions and does not even work for controls
with a linear dB range.
A simple conversion to dB and back can be done if we add the dB value(s)
to the saved state.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Clemens Ladisch [Wed, 26 May 2010 08:18:43 +0000 (10:18 +0200)]
alsactl: move alloca out of loop
Reserving new space from the stack in every loop iteration is not
necessary, so move the call to snd_ctl_elem_id_alloca outside where it
is executed only once.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>