Commit graph

1219 commits

Author SHA1 Message Date
Julian Scheel
2607d8deee 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>
2014-05-07 10:55:51 +02:00
Karl Bongers
0d46081679 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>
2014-05-07 08:51:00 +02:00
Erik Ackermann
b7ed45a015 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>
2014-02-26 16:15:54 +01:00
Erik Ackermann
3b1ee6b325 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>
2014-02-26 08:13:59 +01: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
Dave Reisner
ef0e588c76 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>
2014-01-13 11:30:43 +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
Jaroslav Kysela
f4be3f88b6 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>
2013-12-29 20:06:53 +01:00
Takashi Iwai
5dfc232a9d alsactl: monitor all cards as default
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 14:27:30 +01:00
Takashi Iwai
bb3293c76e 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>
2013-11-26 13:59:19 +01:00
Takashi Iwai
d2d9b6fc8d 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>
2013-11-26 11:45:34 +01:00
Ivailo Monev
7d0c2801b3 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>
2013-11-17 10:03:49 +01:00
Mike Frysinger
54a459a884 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>
2013-11-14 08:51:55 +01:00
Mike Frysinger
df875c6e8f 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>
2013-11-14 08:51:37 +01:00
Anssi Hannula
58752c3ae3 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>
2013-11-12 09:10:37 +01:00
Anssi Hannula
5b0c6da0d8 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>
2013-11-12 09:10:26 +01:00
Anssi Hannula
a1992044d5 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>
2013-11-12 09:09:48 +01:00
John Spencer
0616d87fba 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>
2013-11-08 14:57:06 +01:00
Anssi Hannula
f1e991e813 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>
2013-10-02 17:36:02 +02:00
Anssi Hannula
180283e230 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>
2013-10-01 12:23:45 +02:00
Jaroslav Kysela
87bcda4b8a alsaloop: add -z,--syslog option to use syslog for errors
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-09-16 14:14:41 +02: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
Jaroslav Kysela
8f57464190 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>
2013-07-23 14:57:05 +02:00
Jaroslav Kysela
dda4392cd5 alsactl: alsa-state.service - fix typo (rkill -> kill)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-07-19 14:36:52 +02:00
Jaroslav Kysela
2e1718a728 Release v1.0.27.2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-07-09 17:28:37 +02:00
David Henningsson
7ac9508c4e 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>
2013-06-14 14:05:23 +02:00
David Henningsson
9fe90a020c 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>
2013-06-14 13:38:23 +02:00
Jaroslav Kysela
c80a38dbf5 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>
2013-05-28 08:43:30 +02:00
Jaroslav Kysela
d61924fd24 amixer: Fix the hctl elem search bug
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-27 16:40:26 +02:00
Jaroslav Kysela
c0f70a0b8e alsactl: return back the udevrules_DATA rule for 90-alsa-restore.rules
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-27 09:26:39 +02:00
Gabriel M. Beddingfield
121df36949 alsactl init: ca0106 file was omitted
The file alsactl/init/00main includes the line:

CARDINFO{driver}=="CA0106", INCLUDE="ca0106", GOTO="init_end"

However, the file alsactl/init/ca0106 is not making it into the
release tarballs (nor to user installations).

This patch adds the ca0106 file to the build.

Signed-off-by: Gabriel M. Beddingfield <gabrbedd@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-27 09:09:14 +02:00
Jordi Mallach
2f2576518c Require alsa-lib 1.0.27.
Both aplay and speaker-test use the new snd_pcm_abort() function, which was
introduced in alsa-lib 1.0.27.

Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-23 14:51:25 +02:00
Jaroslav Kysela
5bdfa4c73d Release v1.0.27.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-21 10:48:28 +02:00
Jaroslav Kysela
4485590096 alsactl: remove 90-alsa-restore.rules from the tar ball
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-05-21 10:27:25 +02:00
Jordi Mallach
50ce9adb8a Add AM_MAINTAINER_MODE([enable]) to configure.in.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:38:31 +02:00
Jordi Mallach
f2f5f7a7d3 Fix a build failure due to a misused format string.
This fixes builds with -Werror=format-security.

Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:38:25 +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
Doug Goldstein
888275e66c alsactl: sprintf to snprintf prevent buffer overflow
sprintf() is a bit dangerous unless you explicitly know your type size
and want to keep it in sync always. Its safer to just use snprintf() and
ensure your string doesn't overflow and is NULL terminated.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-06 10:55:07 +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
95788fea25 alsactl: Fix the string size for the lock file contents
The string length is 10 characters + LF + '\0' = 12 characters.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-15 14:44:13 +02:00
Takashi Iwai
3616b1fe3c alsactl: Fix a typo in systemd alsa-restore.service
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-15 11:21:13 +02:00
Jaroslav Kysela
3e95cb814c Release v1.0.27
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-11 13:43:06 +02:00
Jaroslav Kysela
c3a31afe14 alsactl: add --with-alsactl-daemonswitch=FILE to the global configure.in
It may be useful to have the file location configurable.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-10 11:08:47 +02:00
Jaroslav Kysela
8b34bf25c0 alsactl: revert back old systemd static units with the /etc/alsa/state-daemon.conf switch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-10 10:29:19 +02:00
Jaroslav Kysela
611249ae26 alsactl: add --nice and --sched-idle options
The state management can run at low priority, add --nice and --sched-idle
options to set the scheduler.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-10 09:42:40 +02:00
Jaroslav Kysela
e2eab09c1d amixer: Use the alsa-lib functions for id print and parse and value parse
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-09 18:38:58 +02:00
Jaroslav Kysela
9cb5e5bee7 alsactl: daemon mode - remove disconnected cards
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-09 18:10:22 +02:00
Jaroslav Kysela
e05b903b1f alsactl: move systemd config to the daemon mode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 14:51:39 +02:00
Jaroslav Kysela
46cb355d4f speaker-test: change the interrupt handling logic to follow aplay/arecord
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 13:57:51 +02:00