Commit graph

56 commits

Author SHA1 Message Date
Jaroslav Kysela
c051036e17 Change snd_dlopen() function to return the error string
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>
2017-11-27 21:48:20 +01:00
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Takashi Iwai
c9a0d7d601 conf: Add thread-safe global tree reference
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>
2016-05-17 15:51:20 +02:00
Mike Frysinger
99dc70f023 fix _GNU_SOURCE handling & header inclusion
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>
2015-10-12 10:36:15 +02:00
Jaroslav Kysela
d25e281230 Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Takashi Iwai
70e4ec9d08 Allow build without libdl and libpthread
Allow building alsa-lib without libdl and libpthread.
Added new options to configure, --with-libdl and --with-pthread.
2007-03-22 00:48:18 +01:00
Benoit Fouet
31910617f2 initialize dl handles where it needs to
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>
2007-01-08 15:07:02 +01:00
Takashi Iwai
b9c53dd962 Fix missing snd_dlclose() in timer handlers
Call snd_dlclose() properly for the dlopened handlers in timer
and timer_query closing functions.
2006-04-25 17:26:16 +02:00
Clemens Ladisch
4433248bf3 remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
2006-02-27 09:58:32 +00:00
Clemens Ladisch
45850439b3 Do not abort in snd_xxx_close() functions
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.
2006-02-27 09:54:57 +00:00
Takashi Iwai
7a89e3bbca Fix compile warnings with gcc-4
Fixed compile warnings with gcc-4 about pointer signedness.
2005-06-28 10:24:44 +00:00
Takashi Iwai
087184b0f9 Fix doxygen documents
Fix the warnings of doxygen parsing.
Add some missing documentation.
2005-05-24 14:14:28 +00:00
Jaroslav Kysela
8ec3e4ea6c added full async interface to timer API
- added snd_async_add_timer_handler and snd_async_handler_get_timer functions
- added async command to test/timer.c
2005-05-11 12:18:51 +00:00
Jaroslav Kysela
412fb54e0d Fedora 4 patch - gcc4 fixes 2005-05-06 14:09:17 +00:00
Takashi Iwai
c11a1fc9be fixed documents to process properly via doxygen. 2004-05-24 14:57:47 +00:00
Jaroslav Kysela
64a39728a2 Added early event extension to the timer API - and a fix for the direct plugins 2004-04-06 17:29:25 +00:00
Jaroslav Kysela
fea03e9eba Fixed compilation --with-versioned=no 2003-03-11 18:51:32 +00:00
Jaroslav Kysela
9c084c4ba6 Updated to new timer API 2003-03-04 20:01:06 +00:00
Jaroslav Kysela
cf9e518d51 Timestamp update (struct timeval -> struct timespec). 2003-02-28 17:23:28 +00:00
Takashi Iwai
dcf5fc4db5 fixed typo. 2003-02-07 11:41:32 +00:00
Jaroslav Kysela
757785fece Added snd_timer_async() function.
More updates to pcm_dmix.c .
2003-02-06 19:15:53 +00:00
Jaroslav Kysela
098932ce57 Added POLLNVAL to poll->events 2002-11-30 09:47:20 +00:00
Jaroslav Kysela
2ca5ace9cb More documentation changes (rawmidi, timer) 2002-02-11 18:11:16 +00:00
Jaroslav Kysela
3e3df2d32b Updated GNU GPL license (address).
Changed GNU LGPL licence from 2.0 to 2.1.
2001-12-30 09:22:54 +00:00
Jaroslav Kysela
f422fb9a78 Added missing variable initialization in open_conf() functions (hwdep, timer); Uros 2001-12-27 20:55:53 +00:00
Jaroslav Kysela
ddb7209e9a Added snd_*_poll_descriptors_revents functions. 2001-11-30 17:36:45 +00:00
Jaroslav Kysela
c33c5760ab Added snd_*_open_lconf functions.
Some minor changes in config interface documentation.
2001-11-24 17:47:01 +00:00
Jaroslav Kysela
c39882f602 Configuration:
- changed snd_config_get_id function to follow semantic of other get functions
  - added snd_config_test_id
  - added runtime pointer type (not persistent)
    - added snd_config_make_pointer, snd_config_set_pointer, snd_config_get_pointer
  - added type/contents checking for callback functions
    - changed 'void *private_data' to 'snd_config_t *private_data'
  - renamed card_strtype functions to card_driver
Control:
  - fixed passing parameters to snd_ctl_async
Async handlers:
  - added public snd_async_handler_get_signo function
Documentation:
  - moved all documentation to source files
2001-11-19 08:14:21 +00:00
Jaroslav Kysela
27472b56a6 Changes for static build. 2001-10-24 14:14:11 +00:00
Jaroslav Kysela
4e92e7a28c Fixed some typos for timer interface. 2001-08-28 13:41:03 +00:00
Jaroslav Kysela
b45c08611c Added symbol versioning for dlsym-callbacks.
Removed snd_config_refer_load from confmisc.c and pcm.c.
2001-08-15 12:12:16 +00:00
Jaroslav Kysela
f22f8388ad Fixed broken initialization 2001-08-08 18:52:25 +00:00
Jaroslav Kysela
0d9a5d0e59 More documentation updates. 2001-07-18 12:17:11 +00:00
Jaroslav Kysela
24945eca0c Added encapsulation for timer interface 2001-07-16 13:33:55 +00:00
Jaroslav Kysela
bf858b7312 Updated timer interface to follow new uniform configuration style. 2001-07-16 11:15:28 +00:00
Abramo Bagnara
5b50ec848a Lot of cleanings with the help of gcc3 2001-03-29 17:50:28 +00:00
Abramo Bagnara
7893ea238d Added mode argument to open functions where it was missing. First part of CTL documentation 2001-03-26 12:45:48 +00:00
Abramo Bagnara
191d03501e Changed descriptors_count 2001-02-18 18:32:30 +00:00
Jaroslav Kysela
cc956312b3 Changed behaviour of poll_descriptors function (returns the filled count of fds).
Added poll_descriptors_count functions.
Added snd_mixer_elem_count function.
2001-02-14 12:15:03 +00:00
Abramo Bagnara
460660d4b4 More generic support for poll descriptors 2001-02-12 23:51:49 +00:00
Abramo Bagnara
8f0cb26fdf Control API encapsulation. Better names for kernel API. Simpler PCM hw_params API. Added missing const. 2001-02-06 23:48:10 +00:00
Abramo Bagnara
de19407578 Removed card type from devices info. Added card number to devices info. Completed encapsulation of PCM API. Removed snd_pcm_card(). All copy functions now have the form copy(dst, src). 2001-01-31 17:26:56 +00:00
Abramo Bagnara
70809b1835 First step toward encapsulation 2001-01-29 14:27:53 +00:00
Jaroslav Kysela
35cb79860d Changes and cleanups for the timer API.
The device lists use the next device syntax now.
2000-11-30 19:17:55 +00:00
Jaroslav Kysela
41bb7068f2 Merged pcmfinal branch. 2000-11-20 20:10:46 +00:00
Jaroslav Kysela
6962a9d6ce Merged pcmplug branch. 2000-09-24 09:57:26 +00:00
Jaroslav Kysela
1cd6778173 Merged pcm2 branch. 2000-05-08 18:53:38 +00:00
Jaroslav Kysela
986c1500d2 Another API cleanups.
Added setup functions for rawmidi and timer interfaces.
2000-04-18 15:20:12 +00:00
Jaroslav Kysela
1149f06429 Protocol version number changed to 2.0.0. 2000-04-18 11:25:05 +00:00
Jaroslav Kysela
e4572ec719 Reset all protocol versions to 1.0.0. 1999-12-16 14:14:16 +00:00