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>
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>
... 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>
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>
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>
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>
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>
This reverts commit 8aa13eec80.
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).
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>
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>
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>
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>
Use the "mydatadir" name consistently.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>
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>
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>
$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>
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>
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>