Commit graph

3022 commits

Author SHA1 Message Date
Liam Girdwood
c6df827374 docs: Add UCM link to main doxygen page.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 17:44:10 +02:00
Liam Girdwood
bb92545e06 ucm: docs: Fix doxygen formatting for UCM main page.
Make sure group is defined and lists dipplayed correctly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 17:44:00 +02:00
Liam Girdwood
f66c7cc293 ucm: docs: fix doxygen exclude patch for UCM local header
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 17:43:50 +02:00
David Henningsson
bbe9248e67 surround41/50.conf: Use chmap syntax for better flexibility
In case the hardware only supports a specific channel map,
this change would allow surround41/50 to select the correct
channel map and channel count in this situation.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-18 10:55:17 +02:00
Shengjiu Wang
9ee6ec80b8 PCM: snd_pcm_xxxx_drain() maybe blocked after suspend and resume
After suspend and resume, the alsa driver is stopped. But if alsa-lib run
into snd_pcm_xxxx_drain(), it need to wait avail >= pcm->stop_threshold,
otherwise, it will not exit the loop, so finally it is blocked at poll() of
snd_pcm_wait_nocheck(pcm, -1).
This patch is to add state check after snd_pcm_wait_nocheck(pcm, -1), if
the state is SND_PCM_STATE_SUSPENDED, then return error.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-12 12:39:24 +02:00
Takashi Iwai
2fd098b587 control: Allow cset'ing specific values in the multi-value case
Improve the parser to allow empty elements followed by a comma.
Now amixer works like below for setting only the third element.
  % amixer cset 'IIR1 Band1' ,,200

Reported-and-tested-by: Arun Raghavan <arun@accosted.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-10 11:56:23 +02:00
Takashi Iwai
18ce3ec9ca pcm: Fix snd_pcm_status() for dmix & co
Fetch the timestamp and other status fields by issuing
snd_pcm_status() for the slave PCM.  Also, fill the delay field
properly.  This should fix longstanding PA's complaints.

Reported-by: Dan Hordern <danhordern@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-02 16:47:50 +02:00
Takashi Iwai
a5e5e3cd3c pcm: Don't assert in _snd_pcm_hw_params_internal()
It's no fatal error from sw params, and it's really bad habit to use
assert() and abort the operation as a system library.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-01 13:46:40 +02:00
Christophe Lohr
8551fe2587 test/pcm_min: Fix error messages
Fix the wrongly referred error code for error messages from
snd_pcm_writei() and other calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-01 13:43:36 +02:00
Christophe Lohr
9120f2de86 test/pcm: Fix generated values with float PCM format
The float format should be generated [-1.0..1.0].

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-01 13:42:56 +02:00
Takashi Iwai
67f73b0fab pcm: Remove assert() from snd_pcm_hw_params_slave()
Using assert() for non-fatal error checks is really brain-dead.
These are especially bad, as it hits even in the normal operation with
plugins and some h/w constraints.

Reported-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-21 07:26:39 +02:00
Tanu Kaskinen
b4222f3fdc ucm: allow multiple devices in JackHWMute
One jack may mute multiple devices, so let's make JackHWMute a list of
device names instead of just a single device name.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-18 10:44:24 +02:00
Jie Yang
404951da5e conf/ucm: broadwell-rt286: change to set capture volume and capture device
Set 'Mic Capture Volume' in capture device EnableSequence, to fix
capture no volume by default issue.

Also add JackHWMute Value item to mute onboard dmic while headset
mic is plugged in.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Tested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-18 10:44:14 +02:00
Takashi Iwai
434f2f021f conf: Add hint descriptions to ctl, hwdep, seq and timer devices
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 15:02:04 +02:00
Takashi Iwai
7d9972c6ad Allow hint for ctl, hwdep, timer and seq
Like pcm and rawmidi, each object parser needs to accept the hint
component.  Now a new local function _snd_conf_generic_id() was
introduced to replace each call of "comment" and "type" field checks.

Also, the two existing identical functions for pcm and rawmidi are
removed and the new function is used commonly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 14:52:35 +02:00
Takashi Iwai
46d98392d0 namehint: Fix bad free with invalid iface name
Due to the uninitialized field before the error path, passing an
invalid iface argument may result in a bad free() call.  Initialize
the fields properly beforehand.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 14:38:25 +02:00
Takashi Iwai
c8667e3db4 namehint: Fix the listing without device number
The current code of snd_device_name_hint() has a bug when listing up
devices without the device index (e.g. ctl).  Because it assigns the
default device index 0 unconditionally and it has a check at the later
point to filter entries with dev >= 0, it ended up with empty
outputs.

The fix is simply to remove the bogus assignment of dev = 0.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 14:32:49 +02:00
Takashi Iwai
bf98b4e316 namehint: Fix invalid list access in snd_device_name_hint()
snd_device_name_hint() tries to free the allocated list at the error
path via snd_device_name_free_hint().  But snd_device_name_free_hint()
expects a list terminated by NULL while snd_device_name_hint() doesn't
add it.  Adding it may again result in an error and thus isn't
guaranteed to work.  Hence we can't add NULL at the error path.

Instead, now the code always allocates one entry more, and zero-clears
the newly allocated beforehand to guarantee the NULL termination.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 12:26:43 +02:00
Jie Yang
ba6fa7b5a6 conf/ucm: broadwell-rt286: change to use the correct jack kcontrol name
The headset jack has two kctls: "Headphone Jack" and "Mic Jack",
we need switch speaker output according to the former JackControl.
Here correct it.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-28 15:18:35 +02:00
Takashi Iwai
b07de7c26b Sync include/sound/asound.h with 4.1 kernel
This adds the new ABI for timestamp stuff and minor fixes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-21 12:49:29 +02:00
Richard Körber
c39d0834d5 USB-audio: Sound Blaster HD iec958 is on device 1
Creative Sound Blaster X-Fi HD uses device 1 for iec958 output.

Signed-off-by: Richard Körber <dev@shredzone.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-05 21:07:11 +02:00
Tanu Kaskinen
ecb38d2bec ucm: improve jack configuration documentation
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:10 +01:00
Tanu Kaskinen
72aa0f8332 ucm: reformat snd_use_case_get() doc
Doxygen doesn't preserve formatting that relies only on indentation.
This fixes it by using lists more liberally.

There are probably more places to fix than just
snd_use_case_get_list(), but I only have motivation for fixing this
function's documentation formatting (the next patch will add some more
content to the function's documentation).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:04 +01:00
Takashi Iwai
9d649add08 conf/ucm: Add Makefile.am for broadwell-rt286 ucm config
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 11:04:47 +01:00
Bard Liao
3c263716fd conf/ucm: broadwell-rt286: add ucm config
The configure should apply to all Broadwell-rt286 boards from Intel,
like Wilson Beach SDS Ultrabook.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 10:58:52 +01:00
Lu, Han
c56064e135 ucm: document some standard values
add standard value JackDev, JackControl and JackHWMute for speaker
mute control on jack insertion. These values will be applied on
pulseaudio.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 10:58:46 +01:00
Jaroslav Kysela
16c956e598 Release v1.0.29
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2015-02-26 13:34:52 +01:00
Tanu Kaskinen
567c831e69 ucm: fix some variable constness issues
I submitted earlier a patch that made the value parameter of
snd_use_case_get() non-const, but as that changed the public API, the
patch couldn't be accepted. This is the same patch, modifying the
internal code so that there are fewer issues with constness, but the
public API is left alone (a comment was added to the function
documentation, though, so that hopefully nobody else will try to fix
the same unfixable problem).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17 22:16:00 +01:00
Tanu Kaskinen
a102e66440 ucm: fix the logic of choosing the default cdev
If the cdev has not been configured explicitly, use the PlaybackCTL
or CaptureCTL value if one of them is set. If neither are set, or if
both are set to different values, then there's no sensible default, so
executing the sequence should fail. The previous code probably tried
to implement this logic, but it was buggy.

Also use more descriptive variable names than "cdev1" and "cdev2".

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17 22:15:53 +01:00
Tanu Kaskinen
1dd239b781 ucm: fix incorrect error code sign
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17 22:15:44 +01:00
Tanu Kaskinen
4f045ac81e .gitignore: add test-driver
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-16 20:59:24 +01:00
Tanu Kaskinen
a540bb3f89 ucm: fix variable mixup
I assume the intention was to use cdev1 for PlaybackCTL and cdev2 for
CaptureCTL, but cdev1 was being used for both and cdev2 was not used
for anything.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-11 12:27:54 +01:00
Takashi Sakamoto
4e398ddfcf control: complement comment for subscribe API
When minus value is given as a parameter, the API returns whether
the caller has already subscribed or not.

This commit adds a comment about this so as better documentation.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-09 16:35:27 +01:00
Alexander E. Patrakov
56499c30b7 conf: add support for USB AudioSport Quattro (tm)
This patch resulted from discussion with redlion_ on #alsa IRC channel
on Freenode. 4-channel playback now works. 4-channel capture works too,
but not simultaneously with playback (hardware limitation).

Alsa-info before the fix:
http://www.alsa-project.org/db/?f=a3673622074b88a1abf4ccc6e7f37d0b5b72f34a

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-01 10:01:54 +01:00
Takashi Iwai
dbb7eca655 Remove unused hostname resolution in shm plugins and aserver
PCM and control shm plugins and aserver have some codes to resolve the
host address and check whether it's a local host although the given
address is never used.  In addition, the code contains gethostbyname()
that is known to be obsoleted.  So, let's get rid of all these unused
codes.

The host configuration item is still accepted (but just ignored) for
keeping the compatibility.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28 16:23:06 +01:00
Lu, Han
6ea14c3624 ucm: add binary configure file parse
with cset command, UCM set kcontrol parameters directly:
    cset "name='<KCONTROL_NAME>' 1<,2,3,...>"
This patch enables UCM to set kcontrol with parameters from
configure file:
    cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>"
where "cset-bin-file" is a newly added keyword alongside of "cset",
to indicate cset with binary data in file.
The binary data in file is parameter for audio DSPs, and it's just
passed by UCM/ALSA as raw data. The data type of parameter elements
must be byte, and the count must matches driver definition.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-23 17:21:27 +01:00
Tomeu Vizoso
3b5fac6d10 conf/ucm: GoogleNyan: Add configuration
Taken from the ChromeOS sources, this configuration should apply to all
Nyan boards from Google, so far HP Chromebook 14 (nyan-blaze) and Acer
Chromebook 13 (nyan-big).

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19 10:02:46 +01:00
Matthieu Crapet
187ba1d8cd autotools: fix ucm partial build
When --disable-ucm configure option is specified,
don't install related include file.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-14 16:07:55 +01:00
Lu, Han
f47480af37 control: enable octal and hexadecimal parse
Use zero-base for strtol(), so get_integer() and get_integer64()
can parse decimal, octal and hexadecimal data from input string.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-14 12:15:33 +01:00
Anssi Hannula
b2ed0aa9f2 pcm: fix buffer overflow in snd_pcm_chmap_print()
The size argument is wrong for one of the snprintf() calls in
snd_pcm_chmap_print(), allowing an overflow to happen (the user-provided
buffer may be written data up to 2x its actual size).

Seen in an user report here: http://trac.kodi.tv/ticket/15641

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-31 10:02:20 +01:00
Takashi Sakamoto
93b0e9ca85 hwdep: add OXFW driver support
Linux 3.19 newly support this driver. By hardware dependent interface,
userspace applications can get hardware information, lock/unlock kernel
streaming and receive lock status event.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-10 11:56:03 +01:00
Tim Cussins
a649c4b1a0 pcm: Fix assorted tstamp_type bugs/omissions.
Just a couple of quick fixes related to tstamp_type.

- snd_pcm_sw_params(): copy tstamp_type field
- snd_pcm_tstamp_type_name(): fix argument type
- snd_pcm_dump_sw_setup(): fix dumping of tstamp_type field

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-25 16:34:22 +01:00
Takashi Iwai
72c8b07b2a ucm: Fix uninitialized err in snd_use_case_set()
The compiler warns like:
  main.c:1664:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]

and actually there are slight code paths that slip.
This patch adds the proper initializations to 0 to return the success
code in these code paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:32:23 +01:00
Takashi Iwai
b779f6f432 mixer: Fix unused parameter warnings
mixer_simple.h:35:64: warning: unused parameter 'mixer' [-Wunused-parameter]
 static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
                                                                ^
mixer_simple.h:36:40: warning: unused parameter 'options' [-Wunused-parameter]
         struct snd_mixer_selem_regopt *options,
                                        ^
mixer_simple.h:37:29: warning: unused parameter 'classp' [-Wunused-parameter]
         snd_mixer_class_t **classp)
                             ^

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:22:01 +01:00
Takashi Iwai
c0a708180f mixer: Fix inclusion of config.h
config.h wasn't read or read too late in some files in src/mixer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:20:48 +01:00
Jussi Laako
b14c49ab3d pcm: Fix DSD sample format endianess and add big-endian format
This patch adds big-endian DSD sample format and fixes return value of DSD
formats for snd_pcm_format_little_endian().

Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:11:05 +01:00
David Henningsson
984db83aa1 USB-audio: Add five more cards to IEC958 blacklist
These devices do not have any IEC958 outputs, so prevent them from
being opened.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-17 13:58:15 +01:00
Takashi Iwai
1eecc3a548 dlmisc: Remove unused label
Fix a compile warning
  dlmisc.c:329:2: warning: label 'unlock' defined but not used [-Wunused-label]

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-16 09:43:39 +01:00
John Spencer
11fdac949b snd_dlsym: only do versioning checks if built --with-versioning
a combination of some of the following garbage collecting LD/CFLAGS
-Os -g0 -fdata-sections -ffunction-sections -s -Wl,--gc-sections
-fno-unwind-tables -fno-asynchronous-unwind-tables
causes the symbol versioning marker symbols to be removed from BSS
since they're otherwise unreferenced. this causes dlsym failing to
find them which results in runtime breakage:

$ alsamixer
ALSA lib dlmisc.c:142:(snd_dlsym_verify) unable to verify version for symbol snd_config_hook_load
ALSA lib conf.c:3328:(snd_config_hooks_call) symbol snd_config_hook_load is not defined inside (null)
ALSA lib conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
cannot open mixer: No such device or address

correct DSO:
$ objdump -T libasound.so.2.strip | grep _snd_config_hook_load_dlsym_config_hook_001
001196bc g    DO .bss   00000001 _snd_config_hook_load_dlsym_config_hook_001

incorrect DSO:
$ objdump -T libs/libasound.so.2 | grep _snd_config_hook_load_dlsym_config_hook_001
00000000 g    DO *ABS*  00000001 _snd_config_hook_load_dlsym_config_hook_001

since alsa was built with --without-versioning, doing those versioning
checks at all is unnecessary and harmful and thus now disabled in this case.

Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-16 09:41:17 +01:00
Takashi Iwai
5a066cb884 pcm: dmix: Don't ignore SND_TIMER_EVENT_MSTOP
When a slave PCM gets an error like XRUN, it stops and notifies with
SND_TIMER_EVENT_MSTOP event.  But the current code filters out this
type and eventually hang due to the empty timer queue.  The fix is to
just add this event type to the filter bit mask.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-06 12:12:02 +01:00