OSDN Git Service

android-x86/external-alsa-utils.git
8 years agobat: Don't pass incompatible function pointers to pthread_cleanup_push()
Takashi Iwai [Mon, 9 Nov 2015 13:09:50 +0000 (14:09 +0100)]
bat: Don't pass incompatible function pointers to pthread_cleanup_push()

pthread_cleanup_push() takes a function pointer for void (void *).
Although it may work in most cases, we shouldn't pass an incompatible
function pointer there, as some old gcc complains:
  alsa.c:560: warning: initialization from incompatible pointer type
  alsa.c:562: warning: initialization from incompatible pointer type

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agobat: Avoid local signal.h file
Takashi Iwai [Mon, 9 Nov 2015 13:04:11 +0000 (14:04 +0100)]
bat: Avoid local signal.h file

The local header file named as "signal.h" causes mysterious compile
error when built with an old glibc.
 signal.h:27: error: conflicting types for 'sin_generator_init'
 ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
 signal.h:28: error: conflicting types for 'sin_generator_next_sample'
 ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
 ....

This turned out to be the conflict of signal.h; namely, pthread.h that
is included before our local signal.h also includes "pthread.h".
Since our local "signal.h" has a higher priority, it gets loaded
instead of the expected pthread's one.  Then we load it again, and it
screws up.

Although it's basically a bug of pthread, it's anyway not good to have
a header file conflicting with the standard header file.  So, let's
name it more explicitly as specific to BAT, bat-signal.h, for avoiding
such a conflict.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoRelease v1.1.0
Jaroslav Kysela [Tue, 27 Oct 2015 16:34:26 +0000 (17:34 +0100)]
Release v1.1.0

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agobat: add all headers to noinst_HEADERS
Jaroslav Kysela [Tue, 27 Oct 2015 16:32:51 +0000 (17:32 +0100)]
bat: add all headers to noinst_HEADERS

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agobat: don't link all binaries with fftw library, add missing header
Jaroslav Kysela [Tue, 27 Oct 2015 16:15:58 +0000 (17:15 +0100)]
bat: don't link all binaries with fftw library, add missing header

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agoconfigure.ac: check for fftw3/m(sqrtf)/pthread only when BAT is enabled
Jaroslav Kysela [Tue, 27 Oct 2015 15:09:30 +0000 (16:09 +0100)]
configure.ac: check for fftw3/m(sqrtf)/pthread only when BAT is enabled

8 years agoBAT: Add missing locale.h header
Caleb Crome [Fri, 23 Oct 2015 17:46:09 +0000 (17:46 +0000)]
BAT: Add missing locale.h header

Missing include became apparent when -O3 was not specified.
Added the header to remove error messages during debug compile.

Signed-off-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add man page
Lu, Han [Wed, 21 Oct 2015 06:53:27 +0000 (14:53 +0800)]
BAT: Add man page

Add more information about BAT utility, including design intent,
principles, use mode, hardware connection, options, example and
return value.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Use dynamic temp file
Lu, Han [Tue, 20 Oct 2015 08:45:48 +0000 (16:45 +0800)]
BAT: Use dynamic temp file

Use dynamic temp file instead of fixed temp file to store recorded
wav data, for better security.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Change comments and interface of usage()
Lu, Han [Tue, 20 Oct 2015 08:45:47 +0000 (16:45 +0800)]
BAT: Change comments and interface of usage()

1. Change comment strings to make the descriptions more clear;
2. Add indent for option lines that have no indent;
3. Use a const string instead of argv[0] as program name.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Use colon instead of comma for separation
Lu, Han [Tue, 20 Oct 2015 08:45:46 +0000 (16:45 +0800)]
BAT: Use colon instead of comma for separation

Use colon instead of comma to separate frequency parameters, for
in several locale comma may be handled as decimal point.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Remove redundant message strings
Lu, Han [Tue, 20 Oct 2015 08:45:45 +0000 (16:45 +0800)]
BAT: Remove redundant message strings

Cutting down 6 message strings to 2, as translators need to work
on each different variant.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agobuild: Do not try to detect cross-compiler
Mike Frysinger [Thu, 8 Oct 2015 16:14:05 +0000 (12:14 -0400)]
build: Do not try to detect cross-compiler

cross compilers are passed via path may not be a gcc based cross
compiler in such cases this check fails and try's to force gcc based
cross compiler detection, This code is a convenience that limits the
build system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoAdd bat binary to .gitignore
Takashi Iwai [Fri, 2 Oct 2015 10:47:25 +0000 (12:47 +0200)]
Add bat binary to .gitignore

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoAdd compile to .gitignore
Takashi Iwai [Fri, 2 Oct 2015 10:47:03 +0000 (12:47 +0200)]
Add compile to .gitignore

Another junk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add Makefile and configures
Lu, Han [Wed, 23 Sep 2015 07:48:55 +0000 (15:48 +0800)]
BAT: Add Makefile and configures

Add Makefile and configures that enable BAT on alsa-utils

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add spectrum analysis functions
Lu, Han [Wed, 23 Sep 2015 07:48:54 +0000 (15:48 +0800)]
BAT: Add spectrum analysis functions

Add functions that detecting signal frequency through spectrum
analyzing.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add converting functions
Lu, Han [Wed, 23 Sep 2015 07:48:53 +0000 (15:48 +0800)]
BAT: Add converting functions

Add functions that converting audio samples to double data for analysis,
and functions that converting float data to audio samples for playback.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add signal generator
Lu, Han [Wed, 23 Sep 2015 07:48:52 +0000 (15:48 +0800)]
BAT: Add signal generator

Add function that generates sine waveform through math lib.
The waveform can be used as source for playback or analysis.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add playback and record functions
Lu, Han [Wed, 23 Sep 2015 07:48:51 +0000 (15:48 +0800)]
BAT: Add playback and record functions

Add functions as main loop of playback thread and record thread.
The functions access pcm hardware through ALSA APIs.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add common definitions and functions
Lu, Han [Wed, 23 Sep 2015 07:48:50 +0000 (15:48 +0800)]
BAT: Add common definitions and functions

Add common definitions of macros and data structures; Add functions
that used by multiple components, such as wav file reading and writing.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoBAT: Add initial functions
Lu, Han [Wed, 23 Sep 2015 07:48:49 +0000 (15:48 +0800)]
BAT: Add initial functions

Add main entrance, command line parsing, parameter initiating and
thread initiating functions for BAT.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoalsactl: Manage both save and restore in a single unit
Takashi Iwai [Tue, 29 Sep 2015 15:26:34 +0000 (17:26 +0200)]
alsactl: Manage both save and restore in a single unit

With RemainAfterExit=true, we can manage both save and restore of the
card state in a single unit file.  This will fix also the case where
systemd reloads the service; with two individual units, it will
restore the previous state before saving, and may lead to inconsistent
state suddenly.

Also fix alsa-state.service as well to make both start and stop
working in a simpler way.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=929619
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoaplay: fix VU meter for S24_LE etc formats
Ricard Wanderlof [Tue, 15 Sep 2015 11:10:00 +0000 (13:10 +0200)]
aplay: fix VU meter for S24_LE etc formats

When recording or playing back audio in a format where the number of
significant bits is less than the physical width (e.g. S24_LE), the VU
meter code needs to consider the number of significant bits in the samples
rather than the physical sample width (e.g. 24 vs 32 bits). Otherwise the
resulting VU meter display will be far too low and it will just indicate
0% all the time.

Tested with a device supporting the S24_LE format.

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoarecord: Remove only regular files
Alexander Volkov [Mon, 21 Sep 2015 13:05:57 +0000 (16:05 +0300)]
arecord: Remove only regular files

arecord removes a file before writing into it. It's not
appropriate in some cases. For example, if you a pass
a symlink to a file, then the symlink will be removed
while the user expects to record into the symlink's target.
Another case is recording into the device file. Some
modems provide a tty device file as a voice device.
And it's not possible to write into it under root with
arecord, because it removes the device file.

So check the type of a file before writing into it and
remove only regular files.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agospeaker-test: fix option ordering
Ken Benoit [Thu, 17 Sep 2015 19:06:38 +0000 (15:06 -0400)]
speaker-test: fix option ordering

The -c and -s options needed to be provided in a specific order for the -s option to work correctly.

This pulls the speaker option check outside of the option parsing so that all the options have been parsed before checking to see if the parameter to -s is correct.

Signed-off-by: Ken Benoit <kbenoit@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
8 years agoalsactl: Add path condition to alsa-store and alsa-restore services
Takashi Iwai [Mon, 10 Aug 2015 12:42:24 +0000 (14:42 +0200)]
alsactl: Add path condition to alsa-store and alsa-restore services

With alsa-restore.service and alsa-store.service, systemd invokes
alsactl at boot and shutdown times.  When this is invoked on a system
without sound cards, it results in an ugly error message from alsact

  /usr/sbin/alsactl: save_state:1590: No soundcards found...
  return code is "19"

Add ConditionPathExistsGlob checks of /dev/snd/control* devices for
avoiding unnecessary invocations of alsactl on such a system.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=940950
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoalsaucm: Drop localbuild hacks
Takashi Iwai [Tue, 4 Aug 2015 16:26:40 +0000 (18:26 +0200)]
alsaucm: Drop localbuild hacks

The include and library paths shouldn't be across the build tree.
The installed alsa-lib must have the UCM support for building the
stuff here in alsa-utils repo correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoAdd topology/alsatplg to .gitignore
Takashi Iwai [Tue, 4 Aug 2015 15:46:02 +0000 (17:46 +0200)]
Add topology/alsatplg to .gitignore

Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Add command line topology tool to build topology binaries
Liam Girdwood [Tue, 4 Aug 2015 15:23:03 +0000 (16:23 +0100)]
topology: Add command line topology tool to build topology binaries

Add a command line tool that will parse topology text files and convert to the binary
topology data as used by the kernel.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agospeaker-test: Add option to specify signal scale
Julian Scheel [Tue, 30 Jun 2015 06:57:49 +0000 (08:57 +0200)]
speaker-test: Add option to specify signal scale

Allow generated signals (sine and noise) to have a specified signal scale
instead of using hardcoded limits of 80%. This can be handy for debugging, ie
when analysing clipping issues with audio drivers.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoalsactl: terminate readlink result string
Tobias Stoeckmann [Sat, 11 Jul 2015 11:23:57 +0000 (13:23 +0200)]
alsactl: terminate readlink result string

readlink does not guarantee that its result string is nul-terminated.
Instead, increase the buffer by one byte to make sure that we can
add '\0' at the end.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoaplay: Fix uninterruptible aplay
Takashi Iwai [Wed, 29 Apr 2015 16:01:58 +0000 (18:01 +0200)]
aplay: Fix uninterruptible aplay

When aplay is invoked to play from stdin, it can't be terminated by
normal signals like SIGTERM or SIGINT.  It's because our signal
handler tries to trap as much as possible while the stalling point is
not in the PCM loop but rather the file I/O.

For fixing this, leave our signal handler once when a signal is
received and snd_pcm_abort() is called.  At the next hit, it shall be
handled normally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoaplay: Fix type for signal flag
Takashi Iwai [Wed, 29 Apr 2015 16:01:07 +0000 (18:01 +0200)]
aplay: Fix type for signal flag

A flag used in signal handlers has to be a special atomic type,
volatile sig_atomic_t.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsa-info: Don't try update when wget isn't available
Takashi Iwai [Mon, 27 Apr 2015 19:27:05 +0000 (21:27 +0200)]
alsa-info: Don't try update when wget isn't available

... otherwise it overwrites a zero size file.  Also add a check of
zero size file in the update procedure, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoamixer: expand local storage for item name according to kernel code
Takashi Sakamoto [Wed, 8 Apr 2015 16:30:56 +0000 (01:30 +0900)]
amixer: expand local storage for item name according to kernel code

According to kernel code (snd_ctl_elem_init_enum_names() in
sound/core/control.c), the maximum length of item name is 63 characters
(+ 1 terminator = 64 bytes). But current amixer implementation
uses 40 bytes. This causes name truncation and fail to operation.

This commit fixes this bug by expanding the length of local variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoamixer: Don't set only the first item in sset_enum()
Peter Meerwald [Tue, 3 Mar 2015 17:39:52 +0000 (18:39 +0100)]
amixer: Don't set only the first item in sset_enum()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoRelease v1.0.29
Jaroslav Kysela [Thu, 26 Feb 2015 14:49:40 +0000 (15:49 +0100)]
Release v1.0.29

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoalsa-info.sh: add script to EXTRA_DIST (automake)
Jaroslav Kysela [Thu, 26 Feb 2015 14:47:27 +0000 (15:47 +0100)]
alsa-info.sh: add script to EXTRA_DIST (automake)

9 years agoconfigure: allow contitional compilation of alsaucm
Matthieu Crapet [Wed, 14 Jan 2015 14:44:19 +0000 (15:44 +0100)]
configure: allow contitional compilation of alsaucm

If alsa-lib have been compiled with --disable-ucm, alsaucm can't be built.
Detection is dynamic, no configure command line option is available for now.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsactl/init: Add "Line Out" to list of outputs to initialize
David Henningsson [Mon, 12 Jan 2015 15:48:38 +0000 (16:48 +0100)]
alsactl/init: Add "Line Out" to list of outputs to initialize

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsactl/init: Change the "basic rules" description
David Henningsson [Mon, 12 Jan 2015 15:48:37 +0000 (16:48 +0100)]
alsactl/init: Change the "basic rules" description

We now enable more outputs than just the main speaker, so update
the basic rules to reflect the actual situation.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsactl: add missing state_unlock() call
Jaroslav Kysela [Wed, 24 Dec 2014 19:15:26 +0000 (20:15 +0100)]
alsactl: add missing state_unlock() call

9 years agoamixer: Parse the value more strictly
Takashi Iwai [Sun, 23 Nov 2014 09:04:24 +0000 (10:04 +0100)]
amixer: Parse the value more strictly

So far amixer allows some unexpected suffix and assumes as a raw
absolute value without returning an error.  This is rather dangerous,
e.g. user might not notice that a completely wrong value was set when
the command line included a typo.

This patch makes the parser a bit more strict: it doesn't allow any
longer invalid suffixes, instead either returns an error or skips the
invalid value, depending on the operation mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoamixer: Make "dB" case-insensitive in set commands
Takashi Iwai [Sun, 23 Nov 2014 08:40:07 +0000 (09:40 +0100)]
amixer: Make "dB" case-insensitive in set commands

We don't have to be necessarily too strict about case-sensitivity of
"dB" suffix used in set commands.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoRevert "aplay: fix pcm_read() return value"
Jaroslav Kysela [Wed, 1 Oct 2014 13:43:57 +0000 (15:43 +0200)]
Revert "aplay: fix pcm_read() return value"

This reverts commit 8aa13eec80eac312e4b99423909387660fb99b8f.

The semantics for pcm_read() and pcm_readv() was changed, but the
callers expect the exact frame count as requested. It's possible
to fix callers, but the fix is more complicated than to revert the
change. Note that '-d' processing was broken in some cases.

Note: The reverted commit allows that the return value might be
greater than requested (see the first condition in read routines).

9 years agoalsactl: coverity - missing_va_end – va_end was not called for "ap"
Jaroslav Kysela [Wed, 24 Sep 2014 08:52:17 +0000 (10:52 +0200)]
alsactl: coverity - missing_va_end â€“ va_end was not called for "ap"

9 years agomonitor: fix clang warning - Declared variable-length array (VLA) has zero size
Jaroslav Kysela [Wed, 24 Sep 2014 08:50:54 +0000 (10:50 +0200)]
monitor: fix clang warning - Declared variable-length array (VLA) has zero size

9 years agospeaker-text: fix simple signess assignment warning
Jaroslav Kysela [Wed, 24 Sep 2014 08:47:48 +0000 (10:47 +0200)]
speaker-text: fix simple signess assignment warning

9 years agoalsactl: aded missing monitor() prototype
Jaroslav Kysela [Wed, 24 Sep 2014 08:46:02 +0000 (10:46 +0200)]
alsactl: aded missing monitor() prototype

9 years agoalsactl: Fix the file locking routines (for the state management)
Jaroslav Kysela [Wed, 24 Sep 2014 08:35:53 +0000 (10:35 +0200)]
alsactl: Fix the file locking routines (for the state management)

9 years agospeaker-test: Add missing draining at the end
Takashi Iwai [Tue, 16 Sep 2014 14:36:44 +0000 (16:36 +0200)]
speaker-test: Add missing draining at the end

Without the call of snd_pcm_drain() the pending data on the buffer
might be discarded, which results in the abort of playback sound in
the middle.  Let's fix it.

Reported-and-tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsa-info: Refactor "withall" logic
David Henningsson [Fri, 22 Aug 2014 08:31:41 +0000 (10:31 +0200)]
alsa-info: Refactor "withall" logic

Previously, using --output, --no-upload, --upload and --pastebin
switches implied the withall switch.

A more intuitive logic would be that --with-all is disabled if you
use another --with* switch, such as --withdmesg, and only then.

Also update script version to reflect the behaviour change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsa-info: Make sure all full script is run even with "output" option
David Henningsson [Fri, 22 Aug 2014 08:31:40 +0000 (10:31 +0200)]
alsa-info: Make sure all full script is run even with "output" option

For some reason, when the --output option is used, less information
is included compared to when no options are used. This is unexpected.

Fix this by running "withall" also when the output option is used.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoAdd missing alsa-info entry to the root Makefile.am
Takashi Iwai [Tue, 12 Aug 2014 14:19:06 +0000 (16:19 +0200)]
Add missing alsa-info entry to the root Makefile.am

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoAdd alsa-info.sh to alsa-utils repo
Takashi Iwai [Wed, 30 Jul 2014 10:18:07 +0000 (12:18 +0200)]
Add alsa-info.sh to alsa-utils repo

Copied the latest version (0.4.63) from alsa-driver repo.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoalsamixer: include missing mixer_controls.h
Jaroslav Kysela [Wed, 25 Jun 2014 08:49:23 +0000 (10:49 +0200)]
alsamixer: include missing mixer_controls.h

9 years agoalsactl: save state - do not call rename for stdio
Jaroslav Kysela [Wed, 25 Jun 2014 08:47:21 +0000 (10:47 +0200)]
alsactl: save state - do not call rename for stdio

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoRelease v1.0.28
Jaroslav Kysela [Fri, 13 Jun 2014 17:21:05 +0000 (19:21 +0200)]
Release v1.0.28

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoaplay: Fix VU-meter stdout/stderr mess
Sergey [Fri, 13 Jun 2014 01:28:49 +0000 (05:28 +0400)]
aplay: Fix VU-meter stdout/stderr mess

Commit 6bbeb78d forgot to change some of VU-meter output to stderr.
This patch makes the output of `aplay -vvv` consistent again.

Signed-off-by: Sergey <sergemp@mail.ru>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoalsactl: Fixup test for mydatadir/sbindir
David Henningsson [Fri, 13 Jun 2014 09:31:44 +0000 (11:31 +0200)]
alsactl: Fixup test for mydatadir/sbindir

Use the "mydatadir" name consistently.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoalsactl: Do not run udev rule before datadir/sbindir are both mounted
David Henningsson [Fri, 13 Jun 2014 08:04:25 +0000 (10:04 +0200)]
alsactl: Do not run udev rule before datadir/sbindir are both mounted

Sometimes 90-alsa-restore.rules is run before /usr is mounted,
and alsactl restore depends on /usr/share/alsa being present.

If /usr/share/alsa is not present, we're so early in the boot
process that alsa-restore.service (or upstart equivalent) will
run later on.

BugLink: https://bugs.launchpad.net/bugs/1289730
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoaplay/arecord: Add more in_aborting checks to read/write loops
Jaroslav Kysela [Fri, 13 Jun 2014 08:52:26 +0000 (10:52 +0200)]
aplay/arecord: Add more in_aborting checks to read/write loops

Reported-by: Sergey <sergemp@mail.ru>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
9 years agoconfigure.ac: cosmetic change
Jaroslav Kysela [Thu, 12 Jun 2014 08:48:22 +0000 (10:48 +0200)]
configure.ac: cosmetic change

10 years agoalsactl: add -L (no-lock) and change -D (lock-dir) to -O (state-lock-file)
Jaroslav Kysela [Wed, 7 May 2014 09:13:41 +0000 (11:13 +0200)]
alsactl: add -L (no-lock) and change -D (lock-dir) to -O (state-lock-file)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoModernize configure.ac
Jaroslav Kysela [Wed, 7 May 2014 07:49:52 +0000 (09:49 +0200)]
Modernize configure.ac

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoconfigure.in -> configure.ac rename
Jaroslav Kysela [Wed, 7 May 2014 07:46:08 +0000 (09:46 +0200)]
configure.in -> configure.ac rename

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoMakefiles - use AM_CPPFLAGS instead INCLUDES
Jaroslav Kysela [Wed, 7 May 2014 07:43:45 +0000 (09:43 +0200)]
Makefiles - use AM_CPPFLAGS instead INCLUDES

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoupdate the gettext configuration
Jaroslav Kysela [Wed, 7 May 2014 07:29:16 +0000 (09:29 +0200)]
update the gettext configuration

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoconfigure: add --with-lock-dir option
Jaroslav Kysela [Wed, 7 May 2014 07:19:36 +0000 (09:19 +0200)]
configure: add --with-lock-dir option

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoalsactl: Store lockfile in /var/lock, add -D option to specify the lock dir
Julian Scheel [Tue, 6 May 2014 19:32:19 +0000 (21:32 +0200)]
alsactl: Store lockfile in /var/lock, add -D option to specify the lock dir

It can not be generally assumed that the directories in which asound.state
resides are writable. Use /var/lock and allow users to alter this path.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agofix aconnect -l option
Karl Bongers [Wed, 7 May 2014 04:06:47 +0000 (23:06 -0500)]
fix aconnect -l option

aconnect -l would just print usage.
This fix makes it do what usage says it should do.

Signed-off-by: Karl Bongers <karlbongers@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agospeaker-test: update man page for new -X arg, also consistency fixes
Erik Ackermann [Wed, 26 Feb 2014 14:52:29 +0000 (06:52 -0800)]
speaker-test: update man page for new -X arg, also consistency fixes

Signed-off-by: Erik Ackermann <kurterikackermann@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agospeaker-test: add --force-frequency option to allow hz outside range
Erik Ackermann [Tue, 25 Feb 2014 19:45:24 +0000 (11:45 -0800)]
speaker-test: add --force-frequency option to allow hz outside range

Signed-off-by: Erik Ackermann <kurterikackermann@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoaplay: fix timespec to msec conversion
Olivier Langlois [Tue, 21 Jan 2014 20:25:12 +0000 (15:25 -0500)]
aplay: fix timespec to msec conversion

There is 1M nsec in a msec.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsa-restore.rules: refer to correct attr
Dave Reisner [Sun, 12 Jan 2014 16:15:52 +0000 (11:15 -0500)]
alsa-restore.rules: refer to correct attr

$attr{number} in the RUN rule is an empty expansion. This makes sense,
because the path doesn't exist -- i.e., it refers to the path:

/sys/devices/pci0000:00/foo/bar/sound/card0/controlC0/number

Instead, refer to $attr{device/number}, which does exist.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoaplay: fix pcm_read() return value
Olivier Langlois [Wed, 8 Jan 2014 04:18:17 +0000 (23:18 -0500)]
aplay: fix pcm_read() return value

Because of the way the pcm_read() functions are currently used, returning
rcount or result is equivalent but I feel it is more accurate to
return 'result'.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsactl: Fix the va_list initialization in cerror_() and dbg_()
Jaroslav Kysela [Sun, 29 Dec 2013 19:03:21 +0000 (20:03 +0100)]
alsactl: Fix the va_list initialization in cerror_() and dbg_()

The <ap> argument for syslog_() was uninitialized.

From: Alan Hamilton <alanh@arizonaroads.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoalsactl: monitor all cards as default
Takashi Iwai [Tue, 26 Nov 2013 13:27:30 +0000 (14:27 +0100)]
alsactl: monitor all cards as default

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsactl: Fix REMOVE event handling in monitor command
Takashi Iwai [Tue, 26 Nov 2013 12:59:19 +0000 (13:59 +0100)]
alsactl: Fix REMOVE event handling in monitor command

SND_CTL_EVENT_MASK_REMOVE has to be checked at first and ignore the
rest if it matches.  Suggested by Clemens.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsactl: Add monitor command
Takashi Iwai [Tue, 26 Nov 2013 10:44:40 +0000 (11:44 +0100)]
alsactl: Add monitor command

With monitor command, you can monitor the events received from the
given control device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoconfigure: detect udevdir via pkg-config, fallback to /lib/udev/rules.d
Ivailo Monev [Sat, 16 Nov 2013 14:00:19 +0000 (14:00 +0000)]
configure: detect udevdir via pkg-config, fallback to /lib/udev/rules.d

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsaconf: update gentoo to use modprobe.d method as everyone else
Mike Frysinger [Wed, 13 Nov 2013 18:23:48 +0000 (13:23 -0500)]
alsaconf: update gentoo to use modprobe.d method as everyone else

We migrated off modules.d a long time ago.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsaconf: support newer m-i-t and kmod
Mike Frysinger [Wed, 13 Nov 2013 18:23:47 +0000 (13:23 -0500)]
alsaconf: support newer m-i-t and kmod

The m-i-t package made it up to 3.10 versions before ending, so update
the glob to handle those too.

Most distros are moving on to kmod, so we also want to handle the version
string that package outputs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agospeaker-test: Show out-of-chmap channels as Unknown
Anssi Hannula [Sun, 10 Nov 2013 18:29:19 +0000 (20:29 +0200)]
speaker-test: Show out-of-chmap channels as Unknown

Currently speaker-test falls back to ALSA default channel names for
channels out-of-chmap.

This causes e.g. the 4th channel of
$ speaker-test -c4 -Dhdmi -m "FR,FL,FC"
to be shown as "Rear Right".

Change the code to show such channels as Unknown instead, similar to
when snd_pcm_chmap_long_name() does not know the name.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agospeaker-test: Always show chmap channel names if available
Anssi Hannula [Sun, 10 Nov 2013 18:29:18 +0000 (20:29 +0200)]
speaker-test: Always show chmap channel names if available

Currently speaker-test only uses channel names retrieved by
snd_pcm_chmap_long_name() when a channel map has been manually set.

However, the device may provide a default (or fixed) channel map that
differs from the traditional ALSA map, in which case wrong channel names
are shown.

Fix that by always using the name from the channel map when a channel
map is present.

Note that the names retrieved by snd_pcm_chmap_long_name() are not
currently localized via gettext.

Also note that Linux kernel HDMI driver reported wrong default channel
maps before 56cac413dd6d43af8355f5d1f90a199b540f73fc ("ALSA: hda - hdmi:
Fix reported channel map on common default layouts").

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agospeaker-test: Fix chmapped channel selection without specified chmap
Anssi Hannula [Mon, 11 Nov 2013 22:04:02 +0000 (00:04 +0200)]
speaker-test: Fix chmapped channel selection without specified chmap

The channel selection currently does not work properly when there is a
driver-provided non-ALSA-traditional channel map but no manual channel
map was explicitely requested with "-m".

For example, the CEA/HDMI 8ch map is FL,FR,RLC,RRC,FC,LFE,RL,RR. Note
that it is otherwise the same as the traditional ALSA channel map,
except that the traditional rear speakers are considered
rear-center speakers and the traditional side speakers are considered
rear speakers.

Speaker-test tries to play back channels in this following order:
  0, /* Front Left  */
  4, /* Center      */
  1, /* Front Right */
  7, /* Side Right  */
  3, /* Rear Right  */
  2, /* Rear Left   */
  6, /* Side Left   */
  5, /* LFE         */

When it is the time to play back Side Left/Right, speaker-test tries to
look for SL/SR in the chmap, but doesn't find it, so it just plays back
channels 6/7 (which indeed are the side speakers, or RL/RR in this
channel map - so the correct channels are selected).

When it becomes the time to playback Rear Left/Right, speaker-test again
tries to find RL/RR in the chmap, and this time it does find them in the
chmap positions 6/7.

So the channels 6/7 are tested twice and 2/3 are never tested.

To fix this, define a generic playback order channel_order[] to be used
when the channel map is present (but not user-defined) and generate a
(speaker/playback number => channel number) mapping with the channels
ordered in the following order:
1. regular channels found in channel_order[] in the defined order,
2. channels not found in channel_order[] ordered by channel number.
3. UNKNOWN channels ordered by channel number.
4. NA channels ordered by channel number.
For channels outside the channel map just use their channel numbers (so
they will be last after all of the above).

For example, if the playback device has a fictional default channel map
of FR,FL,UNKNOWN1,FOO,BAR,RR,RL,UNKNOWN2, the playback order will be
FL,FR,RR,RL,FOO,BAR,UNKNOWN1,UNKNOWN2(,any_extra_channels).

When the channel mapping is specified manually, the specified order is
used for playback as before.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsaloop: pcmjob.c: use portable way to initialize recursive mutex
John Spencer [Fri, 8 Nov 2013 12:59:41 +0000 (13:59 +0100)]
alsaloop: pcmjob.c: use portable way to initialize recursive mutex

PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not in POSIX, as _NP
(non-portable) suggests.

exposing such a symbol in musl libc would lock in the ABI for all
times and makes it impossible to do future changes to the under-
lying struct without hideous symbol versioning hacks.

use the portable way instead: pthread_once was designed for such
cases.

Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Tested-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoamixer: fix indentation when printing container TLV contents
Anssi Hannula [Tue, 1 Oct 2013 20:46:53 +0000 (23:46 +0300)]
amixer: fix indentation when printing container TLV contents

decode_tlv() adds indentation in the beginning, with the expectation
that the TLV will be printed on the line afterwards in a switch-case.

However, in the case of a container TLV the switch-case simply adds
another level of indentation and calls decode_tlv() for the inner TLVs.
This causes the first inner TLV to be printed with too much indentation
and double '|'.

Fix that by printing "container" and a newline for container TLVs, so
that the result is as follows:
  : values=0,0,0,0,0,0,0,0
  | container
    | chmap-variable=FL,FR
    | chmap-variable=FL,FR,LFE
    | chmap-variable=FL,FR,FC

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoamixer: actually print all TLVs in a container TLV
Anssi Hannula [Mon, 30 Sep 2013 20:46:50 +0000 (23:46 +0300)]
amixer: actually print all TLVs in a container TLV

Due to a wrong indexing of tlv[] decode_tlv() always skips to the end of
the container TLV since the used tlv[1] contains the container TLV size
instead of the intended element size.

This causes, for example, only the first HDMI channel map TLV to be
shown.

Fix the indexing to actually use the element size.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsaloop: add -z,--syslog option to use syslog for errors
Jaroslav Kysela [Fri, 26 Jul 2013 14:16:00 +0000 (16:16 +0200)]
alsaloop: add -z,--syslog option to use syslog for errors

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoaplay: fix two off by one errors
Jurgen Kramer [Mon, 9 Sep 2013 10:02:29 +0000 (12:02 +0200)]
aplay: fix two off by one errors

Attached patch for aplay fixes two off-by-one errors preventing usage
of the last available sample format.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoalsaloop: fix wrong alias for signal.h
Jaroslav Kysela [Tue, 23 Jul 2013 12:57:05 +0000 (14:57 +0200)]
alsaloop: fix wrong alias for signal.h

in POSIX, there is no <sys/signal.h>.

it's merely a legacy alias used by glibc, and the header does nothing
else than including <signal.h>.

so let's do the right thing and use the right name, which works everywhere.

Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoalsactl: alsa-state.service - fix typo (rkill -> kill)
Jaroslav Kysela [Fri, 19 Jul 2013 12:36:52 +0000 (14:36 +0200)]
alsactl: alsa-state.service - fix typo (rkill -> kill)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoRelease v1.0.27.2
Jaroslav Kysela [Tue, 9 Jul 2013 15:28:37 +0000 (17:28 +0200)]
Release v1.0.27.2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agospeaker-test: Fix wrong wave file played back in chmap setup
David Henningsson [Mon, 10 Jun 2013 14:42:48 +0000 (16:42 +0200)]
speaker-test: Fix wrong wave file played back in chmap setup

When explicitly specifying channel maps, we need to use that when
loading wave files so the correct file is played back.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
10 years agoamixer: Print TLV of channel map controls
David Henningsson [Fri, 14 Jun 2013 09:41:01 +0000 (11:41 +0200)]
amixer: Print TLV of channel map controls

Previously these were written as "unk-25..." which wasn't very user friendly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
11 years agoamixer: fix print_dB for -0.99 .. -0.01 range
Jaroslav Kysela [Tue, 28 May 2013 06:43:30 +0000 (08:43 +0200)]
amixer: fix print_dB for -0.99 .. -0.01 range

The first number is 0 when input dB (hundreds) is in range -99 .. -1 .
The printed number was positive in this case. This patch fixes this issue.

Reported-by: Tom Becker <GTBecker@RighTime.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
11 years agoamixer: Fix the hctl elem search bug
Jaroslav Kysela [Mon, 27 May 2013 14:40:26 +0000 (16:40 +0200)]
amixer: Fix the hctl elem search bug

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
11 years agoalsactl: return back the udevrules_DATA rule for 90-alsa-restore.rules
Jaroslav Kysela [Mon, 27 May 2013 07:26:39 +0000 (09:26 +0200)]
alsactl: return back the udevrules_DATA rule for 90-alsa-restore.rules

Signed-off-by: Jaroslav Kysela <perex@perex.cz>