Commit graph

24 commits

Author SHA1 Message Date
Jaroslav Kysela
c049d48407 namehint: Another fix to properly evaluate hw devices
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-01 14:08:03 +02:00
Jaroslav Kysela
0244370be6 namehint: Fix hw device evaluation (missing last device)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-01 13:31:45 +02:00
Jaroslav Kysela
97d25c0766 namehint: Evaluate more possibilities for hw devices
This tries to fix the issue when logical device indexes does not match the
hardware device indexes (like hdmi -> 0:3, 1:7, 2:8, 3:9).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-20 10:33:32 +02:00
John Lindgren
8dde984237 Memory leak in namehint.c
Get_card_name() can be called more than once on the same list, so it
must free the previous list->cardname before replacing it.

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-21 09:28:18 +02:00
Jaroslav Kysela
407e98b4c3 namehint: list card independent devices only once
Card-independent devices such as "null" or "pulse" should only be
added once, not once for each card.

Signed-off-by: John Lindgren <john.lindgren@tds.net>\
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:44:51 +01:00
Jaroslav Kysela
0fcac21756 namehint: Allow snd_device_name_hint to search for CTL devices.
Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:42:49 +01:00
Jaroslav Kysela
592bd1e98b namehint: add missing list->card initialization
list->card is wrongly assumed to be initialized, but the previous
initialization is within a conditional that is false when only
card-independent devices are found.  (This is the case when searching
for mixers on my system; the end result is that the "pulse" mixer is
listed three times.)

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-03 16:42:44 +01:00
Takashi Iwai
e1c7dd2613 Fix corruption after snd_device_name_hint()
snd_device_name_hint() corrupts the config name space after its call.
This results in the error from the suceeding calls of snd_pcm_open()
after snd_device_name_hint().

The bug is in try_config() in namehint.c; it calls snd_config_delete(res)
but res can be two different objects in the function.  One is the object
obtained via snd_config_search_definition(), and another is the one from
snd_config_search_alias_hooks().  The former is the expanded objects,
thus it should be freed.  But, the latter is a reference, and must not be
freed.

This patch adds the check to free or not.

Reported-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-03 09:02:39 +01:00
Diego E. 'Flameeyes' Pettenò
03388ca6d3 Mark static tables as constant when possible.
This makes it possible to write them to .data.rel.ro or to .rodata if
there is no relocation involved (arrays of character arrays).

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 22:39:38 +01:00
Takashi Iwai
3b2c53c2a6 Fix sort-out of non-existing devices in namehint
get_dev_name() checks wrongly the device_output, and it doesn't check
properly the case when only device is set and device_input and output
are unset.  This resulted in listing of non-existing HDMI device, for
example.  The patch fixes both issues.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-17 17:51:45 +02:00
Takashi Iwai
363b7f8289 Don't show non-existing devices in snd_device_name_hint()
Suppress the non-existing devices in snd_device_name_hint().
2008-03-07 17:01:56 +01:00
Takashi Iwai
e58bd6762f Fix device number assignment in hints
Handle the device number properly if given in hints.
The current code resets the device number to -1 wrongly.
2008-03-07 17:00:45 +01: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
40415cd180 Fix undefined references in namehint.c
Fixed undefined references in namehint.c when not all components are
selected via configure options.
2007-07-03 20:22:21 +02:00
Jaroslav Kysela
afb23f3f58 release 1.0.14rc3
Patch-level: Merged
2007-02-26 09:21:12 +01:00
Jaroslav Kysela
2c02c139f4 remove snd_ctl_iface_conf_name() prototype, namehint doxygen cleanups 2006-12-07 15:29:20 +01:00
Jaroslav Kysela
1ba513f96f add snd_device_name_get_hint() function, make hints private to alsa-lib (void)
We can define more string groups for one hint now. It is quite easy
flexible for future.
2006-11-30 13:41:53 +01:00
Takashi Iwai
10e3360575 Fix device name listing with card = -1
Fixed the device name listing with card = -1, such as
aplay -L.
2006-11-06 17:37:15 +01:00
Jaroslav Kysela
9df5c28f55 namehint changes: longname -> cardname, use get_card_name instead longname 2006-10-27 18:19:48 +02:00
Jaroslav Kysela
03389a444b change iface argument for namehint function to const char *
remove snd_ctl_iface_conf_name function
2006-10-27 13:31:32 +02:00
Jaroslav Kysela
d7916981bf pcm config files cleanups and name hint extension
- remove device 0/subdevice 0 from configuration files (it's default)
- name_hint
  - fixed parsing slaves
  - obtain device numbers directly from 'type hw' configurations to
    avoid poluting of configurations scripts with hint.device lines
2006-10-12 16:27:23 +02:00
Jaroslav Kysela
1300e70573 more name hint interace updates
- add long card name to device description
- create empty PCM plugin to allow right hint description parsing
- reorder devices in alsa.conf
- make namehint more configurable (using default.namehint.showall switch)
- add two levels basic and exteded for hints to default configuration files
- do not show direct device aliases
- removed all known memory leaks
2006-10-12 14:34:23 +02:00
Jaroslav Kysela
faf8aad99a fix two issues in snd_device_name_hint()
- returned wrong error when the namehint section does not exist
- variable underflow for the rawmidi interface
2006-10-11 13:59:42 +02:00
Jaroslav Kysela
13fdc41785 add snd_device_name_hint() function and initial implementation
- add snd_device_name_hint() and snd_device_name_free_hint() functions
- add snd_ctl_iface_conf_name() functions
- do not accept parameters for the plugin definition without @args section
- add defaults.pcm.dmix.card/device and dsnoop.card/device definitions
- add hints for HDA-Intel.conf, pcm/dmix.conf, pcm/dsnoop.conf and alsa.conf
- add test/namehint test utility
- doxygen related cleanups
2006-10-11 13:18:57 +02:00