summaryrefslogtreecommitdiff
path: root/src/timer
Commit message (Collapse)AuthorAgeFilesLines
* timer: remove dead code in _snd_timer_hw_open()Jaroslav Kysela2021-06-021-2/+0
|
* ucm: add LibraryConfig supportJaroslav Kysela2021-04-131-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows to define private alsa-lib's configuration. When the configuration is present, the device values ("PlaybackCTL", "CaptureCTL", "PlaybackMixer", "CaptureMixer", "CapturePCM") are prefixed with '_ucmHEXA.' string where HEXA is replaced by the unique hexadecimal number identifying the opened ucm manager handle. Syntax 4 LibraryConfig.a_label.SubstiConfig { # substituted library configuration like: usr_share_dir "${ConfLibDir}" } LibraryConfig.b_label.Config { # non-substituted library configuration like: usr_share_dir "/usr/share/alsa" } The File counterparts: LibraryConfig.c_label.SubstiFile "/some/path" LibraryConfig.d_label.File "/some/path" Note that for files the contents is substituted on the request, but the file name is always substituted (useful for ${ConfDir} etc.). The private configuration is not saved or preserved. It's life time belongs to the opened ucm manager handle. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* conf: introduce snd_config_get_card() functionJaroslav Kysela2021-02-261-10/+4
| | | | | | | It's helper for the "card" entries parsing. It reduces the code in most of open_hw functions. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* timer: fix sizeof operator mismatch in snd_timer_query_hw_openAlex Henrie2020-12-271-1/+1
| | | | | Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* add support for GCC's LTOJaroslav Kysela2019-04-092-7/+7
|
* core: Proper reference of internal snd_dlopen()Takashi Iwai2018-01-042-2/+2
| | | | | | | | | | snd_dlopen() was recently rewritten to be versioned symbols, and we have to call it with INTERNAL() wrapper from the library itself. Add the proper declaration in the local header and fix the callers appropriately. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* timer: Proper reference of internal versioned symbolsTakashi Iwai2018-01-041-0/+10
| | | | | | | | | | The multiply defined versioned symbols have to be called with INTERNAL() wrapper. Add the missing declarations of versioned timer API functions in the local header, and use them in the callers in PCM. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Change snd_dlopen() function to return the error stringJaroslav Kysela2017-11-272-6/+6
| | | | | | | The dlopen() function might fail also for another reason than a missing file, thus return the error string from dlerror(). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Change FSF address (Franklin Street)Jaroslav Kysela2017-11-146-6/+6
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* conf: Add thread-safe global tree referenceTakashi Iwai2016-05-172-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of open functions in alsa-lib have the call pattern: snd_config_update(); return snd_xxx_open(x, snd_config, ...); This means that the toplevel config gets updated, and passed to a local open function. Although snd_config_update() itself has a pthread mutex to be thread safe, the whole procedure above isn't thread safe. Namely, the global snd_config tree may be deleted and recreated at any time while the open function is being processed. This may lead to a data corruption and crash of the program. For avoiding the corruption, this patch introduces a refcount to config tree object. A few new helper functions are introduced as well: - snd_config_update_ref() does update and take the refcount of the toplevel tree. The obtained config tree has to be freed via snd_config_unref() below. - snd_config_ref() and snd_config_unref() manage the refcount of the config object. The latter eventually deletes the object when all references are gone. Along with these additions, the caller of snd_config_update() and snd_config global tree in alsa-lib are replaced with the new helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Only use F_SETSIG fcntl where it exists.Thomas Klausner2016-03-031-0/+2
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* fix _GNU_SOURCE handling & header inclusionMike Frysinger2015-10-125-28/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The configure script blindly adds -D_GNU_SOURCE to all build settings, even on non-GNU systems. This isn't too much of a big deal (even if it uses the wrong variable -- CFLAGS instead of CPPFLAGS), except that the alsa-lib source itself determines whether to use GNU features when this is defined (such as versionsort). So when we build on non-glibc systems, we get build failures like: src/ucm/parser.c:1268:18: error: 'versionsort' undeclared (first use in this function) #define SORTFUNC versionsort ^ src/ucm/parser.c:1272:54: note: in expansion of macro 'SORTFUNC' err = scandir(filename, &namelist, filename_filter, SORTFUNC); ^ The correct way to add these flags is to use the autoconf helper AC_USE_SYSTEM_EXTENSIONS. Unfortunately, that triggers some more bugs in the alsa build. This macro adds defines to config.h and not directly to CPPFLAGS, so it relies on files correctly including config.h before anything else. A number of alsa files do not do this leading to build failures. The fix there is to shuffle the includes around so that the local ones come first. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Allow hint for ctl, hwdep, timer and seqTakashi Iwai2015-04-302-6/+2
| | | | | | | | | | | 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>
* autotools: update stylePatrick Welche2014-02-261-1/+1
| | | | | | | | | - rename configure.in to configure.ac - replace INCLUDES with AM_CPPFLAGS - modernize AM_INIT_AUTOMAKE invocation Signed-off-by: Patrick Welche <prlw1@cam.ac.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge kernel uapi/sound/asound.h and asequencer.hTakashi Iwai2012-11-261-2/+2
| | | | | | | | | | | | | | | | | | | Instead of keeping modified asound.h and asequencer.h, copy the files in the kernel include/uapi/sound as is, and give some renames for avoiding conflicts with alsa-lib's definitions. Some structs, unions and typedefs in asound.h and asequencer.h are once renamed in local.h before inclusion, then renamed back again. A bonus by this action is that some local codes don't have to refer to sndrv_xxx any longer. However, some codes like src/seq/seq.c need explicit cast because of unavoidable conflicts of struct types. Another significant change is that now snd_pcm_sw_params.period_event field is removed. Instead, try to access the last reserved field internally. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Remove redefinition of _GNU_SOURCE and __USE_GNUTakashi Iwai2009-11-081-1/+0
| | | | | | Now _GNU_SOURCE is already defined globally in configure.in. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Remove old commented-out FD_CLOEXEC codeRémi Denis-Courmont2009-11-081-11/+0
| | | | | Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* timer_query: make ops structure constantClemens Ladisch2009-08-101-1/+1
| | | | | | | | The contents of the snd_timer_query_ops structure are not going to be changed, so we might as well declare is as constant. This change avoids a warning if some ops structure is actually defined as const. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* Make all the remaining ops structure constants.Diego E. 'Flameeyes' Pettenò2008-11-213-3/+3
| | | | | | | This excludes the mixer for now since it requires a change to the public headers. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
* Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela2007-10-156-8/+8
|
* Allow build without libdl and libpthreadTakashi Iwai2007-03-222-2/+0
| | | | | Allow building alsa-lib without libdl and libpthread. Added new options to configure, --with-libdl and --with-pthread.
* Fix error code in timer_query.cTakashi Iwai2007-01-081-0/+1
| | | | Fix the returned error code for the invalid timer definition.
* initialize dl handles where it needs toBenoit Fouet2007-01-082-2/+2
| | | | | | | this trivial patch initializes dl handle in timer.c and timer_query.c where it needs to. Signed-off-by: Benoit Fouet <benoit.fouet@purplelabs.com>
* Fix build of static libraryTakashi Iwai2006-10-271-1/+1
| | | | | | - Add missing pcm_empty entry - Return the array pointer instead of the first array member. Otherwise only the first entry is linked to the binary.
* timer_hw: fix file descriptor leakJaroslav Kysela2006-09-291-1/+1
| | | | See: bug#2465
* Fix missing snd_dlclose() in timer handlersTakashi Iwai2006-04-253-2/+22
| | | | | Call snd_dlclose() properly for the dlopened handlers in timer and timer_query closing functions.
* Suppress warning messages from old timerTakashi Iwai2006-03-141-1/+1
| | | | | Suppress warning messages when the new timer ioctl isn't available (happening when using dmix in the new alsa-lib with older kernels).
* allow changing of device directory pathClemens Ladisch2006-02-272-2/+2
| | | | | | Add configuration options to change the default device path from the default /dev/snd. This is useful for embedded systems that do not want subdirectories in /dev.
* remove superfluous free() checksClemens Ladisch2006-02-272-4/+2
| | | | | free() correctly handles NULL pointers, so we can omit explicit checks for that condition.
* Do not abort in snd_xxx_close() functionsClemens Ladisch2006-02-272-6/+4
| | | | | | Remove several memory leaks by not aborting prematurely from a snd_xxx_close() function when some operation fails. This can happen when a USB device was unplugged.
* direct plugins (dmix) - suspend/resume fixesJaroslav Kysela2005-08-161-0/+5
| | | | | | | - this patch adds support for suspend & result for dmix and other direct plugins - the timer detection / initialization (TREAD support) was redesigned and the check for proper driver version was moved to the timer_hw.c
* timer_hw - Changed TIMER_VERSION_MAX to 2.0.5Jaroslav Kysela2005-08-161-1/+1
|
* Fix compile warnings with gcc-4Takashi Iwai2005-06-282-4/+4
| | | | Fixed compile warnings with gcc-4 about pointer signedness.
* Fix doxygen documentsTakashi Iwai2005-05-243-11/+20
| | | | | Fix the warnings of doxygen parsing. Add some missing documentation.
* Change some timer ioctls due to conflictionTakashi Iwai2005-05-151-3/+25
| | | | | Change values of some timer ioctls to avoid confliction with FIO* ioctls. Use old ioctls if the timer protocol version doesn't match.
* added full async interface to timer APIJaroslav Kysela2005-05-113-0/+55
| | | | | - added snd_async_add_timer_handler and snd_async_handler_get_timer functions - added async command to test/timer.c
* API for device name lists and timer enhancementsJaroslav Kysela2005-05-101-0/+151
| | | | | - new snd_names_list and snd_names_list_free functions - added snd_timer_ginfo related functions to the timer API
* Fedora 4 patch - gcc4 fixesJaroslav Kysela2005-05-061-1/+1
|
* Fix resmgr supportTakashi Iwai2005-02-112-16/+2
| | | | | Call normal open() before trying with res_open_device(). snd_open_device() is defined to do this procedure.
* Add resmgr supportTakashi Iwai2005-01-262-2/+18
| | | | | Added the support for resmgr. A new configure option --with-resmgr is added to enable the resmgr support.
* fixed documents to process properly via doxygen.Takashi Iwai2004-05-242-2/+2
|
* Added early event extension to the timer API - and a fix for the direct pluginsJaroslav Kysela2004-04-061-3/+30
|
* fixes by Art Haas <ahaas@airmail.net>:Takashi Iwai2003-07-251-5/+5
| | | | rewritten with C99 struct initialization style.
* Fixed compilation --with-versioned=noJaroslav Kysela2003-03-112-7/+7
|
* Fixed compilation problemJaroslav Kysela2003-03-051-0/+4
|
* Updated to new timer APIJaroslav Kysela2003-03-045-10/+171
|
* Timer cleanups against the latest APIJaroslav Kysela2003-03-022-2/+11
|
* Timestamp update (struct timeval -> struct timespec).Jaroslav Kysela2003-02-281-1/+1
|
* fixed typo.Takashi Iwai2003-02-071-1/+1
|
* Added snd_timer_async() function.Jaroslav Kysela2003-02-063-9/+68
| | | | More updates to pcm_dmix.c .