Commit graph

291 commits

Author SHA1 Message Date
Sergey
a9705ca48f 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>
2014-06-13 18:39:11 +02:00
Jaroslav Kysela
c06dbf0774 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>
2014-06-13 10:52:26 +02:00
Jaroslav Kysela
0a6c9e80f7 Makefiles - use AM_CPPFLAGS instead INCLUDES
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2014-05-07 10:55:59 +02:00
Olivier Langlois
360878f9c3 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>
2014-01-22 08:05:17 +01:00
Olivier Langlois
8aa13eec80 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>
2014-01-08 11:56:52 +01:00
Jurgen Kramer
719faff809 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>
2013-09-09 12:02:29 +02:00
Jordi Mallach
093a371a27 Several formatting fixes for manpages.
Fix many occurrences of unescaped “-”.
Fix minor English issue.

Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:38:13 +02:00
Elimar Riesebieter
48554fc28b Fix several typos in manpage and help strings.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:38:02 +02:00
Jaroslav Kysela
b4f34ac260 arecord: add a missing break to the capture loop
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-17 08:34:34 +02:00
Jaroslav Kysela
1d0042d7e9 aplay/arecord: change the interrupt handling using snd_pcm_abort()
It is required (exclude the fatal SIGABRT) to call snd_pcm_close() and
the end of work (outside of the interrupt handler). Use new snd_pcm_abort()
function to inform alsa-lib to not ignore EINTR and move the in_aborting
variable to the global scope to be checked in the i/o loops.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 13:30:54 +02:00
Jaroslav Kysela
6de3c709b3 aplay/arecord: added isatty() check (interactive mode)
Turn off the interactive mode when stdin is not a tty.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-03-22 14:00:44 +01:00
Takashi Iwai
de61ec66fe aplay: Add the support for big-endian WAV format (RIFX)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-13 10:53:19 +01:00
Fabio Estevam
c6614dbdab aplay: Show usage if no parameter is passed
When aplay/arecord are called without any argument the application hangs forever.

Instead of hanging, print the usage and exit.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-13 14:33:40 +01:00
Jaroslav Kysela
6017849f1b aplay: fix typo & silence warning..
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-09-24 16:18:54 +02:00
Takashi Iwai
000bf230cf aplay: More support for channel map option
Now aplay tries to follow the given channel map by rearranging the
channels even when the channel map override isn't allowed but if the
device is still capable to return a channel map.

Also update the man page appropriately.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-20 13:55:24 +02:00
Takashi Iwai
a9add2252f aplay: Add support for channel mapping
With -m option, user can specify the order of channel map.
As of this commit, it just tries to override the channel map, thus it
works only on devices that support the channel map override like HDMI.
Adjusting the channel order in aplay itself will be added later.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-17 12:23:33 +02:00
Arun Raghavan
16bc934c0b aplay: Use open() instead of open64()
AC_SYS_LARGEFILE in configure.in will automatically set up defines so
that open() will support large files if supported, and if not, this
allows us to fall back gracefully to non-LFS open().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 15:08:03 +02:00
Arun Raghavan
ae0a7d6f0a aplay: Fix signal.h include
The correct header to include is <signal.h> not <sys/signal.h>.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17 15:07:31 +02:00
Jerome Carretero
6bbeb78dba aplay: print vu-meter to stderr, not stdout
It allows showing the vu-meter while recording to stdout, eg:

   aplay -C -V stereo | oggenc - > out.ogg

Signed-off-by: Jerome Carretero <cJ@zougloub.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-11 17:09:50 +02:00
Ben Gardiner
658c3cfd57 aplay/arecord: option to treat any xrun as fatal
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-19 15:44:16 +01:00
Pavel Hofman
2d105e0f18 aplay - option to dump HW parameters
Dumping HW parameters of the current device with snd_pcm_hw_params_dump,
a new option --dump-hw-params added.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-06 10:42:17 +01:00
Jaroslav Kysela
5b91ee7f61 Fix the examples in aplay.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-02-06 14:58:03 +01:00
Jaroslav Kysela
dc02bd4517 aplay: Add backward compatible endian macro definitions
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-01-25 10:40:25 +01:00
David Henningsson
af0bf78505 aplay: Fix spelling error
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>
2011-10-12 20:14:13 +02:00
Tim Blechmann
0131ab6a67 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>
2011-06-29 09:53:52 +02:00
Takashi Iwai
36d642f448 aplay: Use standard endian convesions
asm/*.h stuff shouldn't be used directly from the user-space apps.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 14:35:44 +02:00
Takashi Iwai
ce2d64b48a aplay: Add include files for mkdir()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 14:34:19 +02:00
Takashi Iwai
a3ebe640a7 aplay: Avoid recursive signal handling
When abort() is issued in snd_pcm_close() path, it may loop recursively
and crash.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 12:44:17 +02:00
Takashi Iwai
d67a965aec 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>
2011-06-03 12:41:26 +02:00
Jaroslav Kysela
bb865dc10b aplay/arecord: term_c_lflag variable might be unitialized in some cases
The term_c_lflag variable might be unitialized in some cases. Add extra
check to avoid setting of wrong value.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-18 08:23:09 +02:00
Jaroslav Kysela
73c79ebf26 aplay: fix termio settings - return back old c_flag value on exit
- symptom - ssh client password authentication does not work with
  the modified terminal settings

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-15 13:39:14 +02:00
Jaroslav Kysela
3bd6533622 aplay/arecord: Added hardware pause support (press SPACE or Enter)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-15 10:40:21 +02:00
John Sauter
55cd025f18 aplay -- update the man file
Bring the man file up to date, documenting the signals and all the
options, including those added for audio surveilance.

Signed-off-by: John Sauter <John_Sauter@systemeyescomputerstore.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-10 18:58:23 +01:00
John Sauter
3b425f8fb5 aplay -- add features for audio surveilance
Add signal SIGUSR1 to turn over the output file,
--max-file-time to cause the output file to turn over automatically,
and --use-strftime to create output files based on the current time.

Signed-off-by: John Sauter <John_Sauter@systemeyescomputerstore.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-10 18:56:53 +01:00
John Sauter
0895fcdce2 aplay - add option --process-id-file
Write the process ID to a file so other programs can
signal aplay.  When aplay exits, delete the file.

Signed-off-by: John Sauter <John_Sauter@systemeyescomputerstore.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-10 18:41:49 +01:00
Jaroslav Kysela
400e6f440e aplay: Dump PCM state on xrun when verbose mode is active
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-08 15:58:47 +01:00
Jaroslav Kysela
1185611ac1 arecord: fix wrong chunk_size initialization when verbose and mmap flags are set
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-09 11:49:51 +01:00
Arnout Engelen
325462e80a aplay - Show available formats
Report available sample formats in aplay/arecord when currently selected
one doesn't work.

Signed-off-by: Arnout Engelen <alsa2@bzzt.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-02 16:44:06 +01:00
Jaroslav Kysela
658cebdc05 aplay/arecord: improve suspicious buffer detection and add --test-coef parameter
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-09 09:48:27 +02:00
Jaroslav Kysela
57a38debe1 aplay/arecord: remove debug printfs introduced by previous patch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-08 18:15:56 +02:00
Jaroslav Kysela
641556d963 aplay/arecord: fix underrun/overrun time calculation for monotonic clock
Also, add librt check to configure.in.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-08 09:22:16 +02:00
Peter Stokes
9a47cf7b35 Fix wrong direction check in aplay/arecord --list-pcms
I have just discovered a minor logic inversion bug in
aplay/arecord --list-pcms functionality.

Basically, executing "aplay --list-pcms" lists all devices capable of
capture and executing "arecord --list-pcms" lists all devices capable
of playback.

Signed-off-by: Peter Stokes <linux@dadeos.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12 12:29:41 +01:00
Diego E. 'Flameeyes' Pettenò
6232f1c96c Make some static tables and strings constants.
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.

The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:10:02 +01:00
Diego E. 'Flameeyes' Pettenò
ca1ea1e904 Mark static the functions not used outside their unit.
This way the compiler can assume more information about their
interface for optimisation.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:09:56 +01:00
Jaroslav Kysela
46f9fb6873 aplay/arecord: add --test-position test
In some cases (HDA audio) the ring buffer position values returned
from alsa-lib are inaccurate. The added --test-position option will
print suspicious values.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-23 11:13:24 +02:00
Jaroslav Kysela
6bd621177d aplay - show sample arrangement (mmap areas) in verbose more for debugging
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 12:53:28 +02:00
Takashi Iwai
8802e85d41 aplay - Fix a compile warning
aplay.c: In function ‘compute_max_peak’:
aplay.c:1327: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
2008-04-16 14:43:01 +02:00
Takashi Iwai
c58817e8af aplay - Add stereo VU-meter support
Added the support of stereo VU-meter.
Enabled via -Vs option.

The new option, -V, can be used to enable the VU-meter.  Now
VU-meter can be enabled even without -vv.
2008-03-14 14:11:06 +01:00
Pawel MOLL
4bdb0adef1 Support for playing WAV files with "extensible format" header using aplay.
WAV files with more than 2 channels or with more than 16 bits per samples
can be saved with "extensible format" chunk
(see http://msdn2.microsoft.com/en-us/library/ms713496(VS.85).aspx).
For instance, sox, when converting data to 24- or 32-bits per sample format
uses this format, and aplay was unable to play such file. Now the problem
is solved :-)

Signed-off-by: Pawel MOLL <pawel.moll@st.com>
2008-03-06 17:34:21 +01:00
Andrew Paprocki
6f438b9b9a aplay/arecord - Add support for IEEE float 32-bit WAV files
This patch modifies aplay/arecord to support playing/capturing IEEE float
32-bit WAV files. Tested on HDA hardware in both stereo and multi-channel
modes. Added the WAV file constant for Dolby AC-3 S/PDIF passthrough to
formats.h for future use when AC-3 passthrough is better supported.

Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
2008-02-06 14:05:07 +01:00