Commit 6b8430f4 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

OSS device core,Documentation,ALSA Core,ALSA<-OSS emulation
ALSA<-OSS sequencer,ALSA Minor Numbers
Rusty Russell <rusty@rustcorp.com.au>:
- added MODULE_ALIAS for sound services.
  clean up the document.
  modified by Takashi Iwai <tiwai@suse.de>
parent 7f28e6b5
......@@ -1153,160 +1153,49 @@ When the kernel is configured without ISA-PnP support, isapnp option
will be not built in.
modprobe/kmod support
=====================
The modprobe program must know which modules are used for the
device major numbers.
Native ALSA devices have got default number 116. Thus a line like
'alias char-major-116 snd' must be added to /etc/modules.conf. If you have
compiled the ALSA driver with the OSS/Free emulation code, then you
will need to add lines as explained below:
Module Autoloading Support
==========================
The ALSA driver uses soundcore multiplexer for 2.2+ kernels and OSS compatible
devices. You should add line like 'alias char-major-14 soundcore'.
The ALSA drivers can be loaded automatically on demand by defining
module aliases. The string 'snd-card-%1' is requested for ALSA native
devices where %i is soundcard number from zero to seven.
Example with OSS/Free emulation turned on:
To auto-load an ALSA driver for OSS services, define the string
'sound-slot-%i' where %i means the slot number for OSS, which
corresponds to the card index of ALSA. Usually, define this
as the the same card module.
----- /etc/modules.conf
An example configuration for a single emu10k1 card is like below:
----- /etc/modprobe.conf
alias snd-card-0 snd-emu10k1
alias sound-slot-0 snd-emu10k1
----- /etc/modprobe.conf
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore
The available number of auto-loaded soundcards depends on the module
option "cards_limit" of snd module. As default it's set to 1.
To enable the auto-loading of multiple cards, specify the number of
soundcards in that option.
----- /etc/modules.conf
When multiple cards are available, it'd better to specify the index
number for each card via module option, too, so that the order of
cards is kept consistent.
After the main multiplexer is loaded, its code requests top-level soundcard
module. String 'snd-card-%i' is requested for native devices where %i is
soundcard number from zero to seven. String 'sound-slot-%i' is requested
for native devices where %i is slot number (for ALSA owner this means soundcard
number).
----- /etc/modules.conf
An example configuration for two soundcards is like below:
----- /etc/modprobe.conf
# ALSA portion
options snd cards_limit=2
alias snd-card-0 snd-interwave
alias snd-card-1 snd-ens1371
options snd-interwave index=0
options snd-ens1371 index=1
# OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
----- /etc/modules.conf
We are finished at this point with the configuration for ALSA native devices,
but you may also need autoloading for ALSA's add-on OSS/Free emulation
modules. At this time only one module does not depend on any others, thus
must be loaded separately - snd-pcm-oss. String 'sound-service-%i-%i'
is requested for OSS/Free service where first %i means slot number
(e.g. card number) and second %i means service number.
alias sound-slot-0 snd-interwave
alias sound-slot-1 snd-ens1371
----- /etc/moprobe.conf
----- /etc/modules.conf
# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
# OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
----- /etc/modules.conf
A complete example for Gravis UltraSound PnP soundcard:
----- /etc/modules.conf
# ISA PnP support (don't use IRQs 9,10,11,12,13)
options isapnp isapnp_reserve_irq=9,10,11,12,13
# ALSA native device support
alias char-major-116 snd
options snd major=116 cards_limit=1
alias snd-card-0 snd-interwave
options snd-interwave index=0 id="GusPnP"
# OSS/Free setup
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
-----
A complete example if you want to use more soundcards in one machine
(the configuration below is for Sound Blaster 16 and Gravis UltraSound Classic):
----- /etc/modules.conf
# ISA PnP support (don't use IRQs 9,10,11,12,13)
# it's only an example to reserve some IRQs for another hardware
options isapnp isapnp_reserve_irq=9,10,11,12,13
# ALSA native device support
alias char-major-116 snd
options snd major=116 cards_limit=2
alias snd-card-0 snd-gusclassic
alias snd-card-1 snd-sb16
options snd-gusclassic index=0 id="Gus" \
port=0x220 irq=5 dma1=6 dma2=7
options snd-sb16 index=1 id="SB16"
# OSS/Free setup
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
-----
A complete example, two Gravis UltraSound Classic soundcards are installed
in the system:
----- /etc/modules.conf
# ALSA native device support
alias char-major-116 snd
options snd major=116 cards_limit=2
alias snd-card-0 snd-gusclassic
alias snd-card-1 snd-gusclassic
options snd-gusclassic index=0,1 id="Gus1","Gus2" \
port=0x220,0x240 irq=5,7 dma1=1,5 dma2=3,6
# OSS/Free setup
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
-----
If you want to autoclean your modules, you should put below line to your
/etc/crontab:
*/10 * * * * root /sbin/modprobe -rs snd-card-0 snd-card-1; /sbin/rmmod -as
You may also want to extend the soundcard list to follow your requirements.
In this example, the interwave card is always loaded as the first card
(index 0) and ens1371 as the second (index 1).
ALSA PCM devices to OSS devices mapping
......
......@@ -81,6 +81,9 @@
#define SNDRV_OSS_DEVICE_TYPE_SNDSTAT 5
#define SNDRV_OSS_DEVICE_TYPE_MUSIC 6
#define MODULE_ALIAS_SNDRV_MINOR(type) \
MODULE_ALIAS("sound-service-?-" __stringify(type))
#endif
#endif /* __SOUND_MINORS_H */
......@@ -33,6 +33,7 @@
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Mixer OSS emulation for ALSA.");
MODULE_LICENSE("GPL");
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MIXER);
static int snd_mixer_oss_open(struct inode *inode, struct file *file)
{
......
......@@ -56,6 +56,8 @@ MODULE_PARM_SYNTAX(adsp_map, "default:1,skill:advanced");
MODULE_PARM(nonblock_open, "i");
MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
MODULE_PARM_SYNTAX(nonblock_open, "default:0,skill:advanced");
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM);
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM1);
extern int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long arg);
static int snd_pcm_oss_get_rate(snd_pcm_oss_file_t *pcm_oss_file);
......
......@@ -35,6 +35,9 @@ MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("OSS-compatible sequencer module");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
/* Takashi says this is really only for sound-service-0-, but this is OK. */
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER);
MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC);
#ifdef SNDRV_SEQ_OSS_DEBUG
MODULE_PARM(seq_oss_debug, "i");
......
......@@ -57,6 +57,8 @@ MODULE_PARM(device_mode, "i");
MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
MODULE_PARM_SYNTAX(device_mode, "default:0666,base:8");
#endif
// MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
MODULE_ALIAS("char-major-" __stringify(CONFIG_SND_MAJOR));
/* this one holds the actual max. card number currently available.
* as default, it's identical with cards_limit option. when more
......
......@@ -547,6 +547,8 @@ EXPORT_SYMBOL(mod_firmware_load);
MODULE_DESCRIPTION("Core sound module");
MODULE_AUTHOR("Alan Cox");
MODULE_LICENSE("GPL");
// MODULE_ALIAS_CHARDEV_MAJOR(SOUND_MAJOR);
MODULE_ALIAS("char-major-" __stringify(SOUND_MAJOR));
static void __exit cleanup_soundcore(void)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment