mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
allow changing of device directory path
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.
This commit is contained in:
parent
3f00bc728b
commit
09f598e57c
9 changed files with 41 additions and 17 deletions
|
|
@ -35,8 +35,8 @@
|
|||
#include "control_local.h"
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
#define SND_FILE_CONTROL "/dev/snd/controlC%i"
|
||||
#define SND_FILE_LOAD "/dev/aloadC%i"
|
||||
#define SND_FILE_CONTROL ALSA_DEVICE_DIRECTORY "controlC%i"
|
||||
#define SND_FILE_LOAD ALOAD_DEVICE_DIRECTORY "aloadC%i"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -47,14 +47,14 @@
|
|||
int snd_card_load(int card)
|
||||
{
|
||||
int open_dev;
|
||||
char control[32];
|
||||
char control[sizeof(SND_FILE_CONTROL) + 10];
|
||||
|
||||
sprintf(control, SND_FILE_CONTROL, card);
|
||||
|
||||
open_dev = snd_open_device(control, O_RDONLY);
|
||||
#ifdef SUPPORT_ALOAD
|
||||
if (open_dev < 0) {
|
||||
char aload[32];
|
||||
char aload[sizeof(SND_FILE_LOAD) + 10];
|
||||
sprintf(aload, SND_FILE_LOAD, card);
|
||||
open_dev = snd_open_device(aload, O_RDONLY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const char *_snd_module_control_hw = "";
|
|||
#endif
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
#define SNDRV_FILE_CONTROL "/dev/snd/controlC%i"
|
||||
#define SNDRV_FILE_CONTROL ALSA_DEVICE_DIRECTORY "controlC%i"
|
||||
#define SNDRV_CTL_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 3)
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -321,7 +321,7 @@ snd_ctl_ops_t snd_ctl_hw_ops = {
|
|||
int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||
{
|
||||
int fd, ver;
|
||||
char filename[32];
|
||||
char filename[sizeof(SNDRV_FILE_CONTROL) + 10];
|
||||
int fmode;
|
||||
snd_ctl_t *ctl;
|
||||
snd_ctl_hw_t *hw;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue