;;
esac
+dnl Check for resmgr support...
+AC_MSG_CHECKING(for resmgr support)
+AC_ARG_WITH(resmgr,
+ [ --with-resmgr support resmgr (optional)],
+ resmgr="$withval", resmgr="no")
+AC_MSG_RESULT($resmgr)
+if test "$resmgr" = "yes"; then
+ AC_CHECK_LIB(resmgr, rsm_open_device,,
+ AC_ERROR([Cannot find libresmgr]))
+ AC_DEFINE(SUPPORT_RESMGR, "1", [Support resmgr with alsa-lib])
+fi
+
dnl Make a symlink for inclusion of alsa/xxx.h
if test ! -L include/alsa ; then
echo "Making a symlink include/alsa"
#include <fcntl.h>
#include <sys/ioctl.h>
#include "control_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef DOC_HIDDEN
#define SND_FILE_CONTROL "/dev/snd/controlC%i"
sprintf(control, SND_FILE_CONTROL, card);
- if ((open_dev=open(control, O_RDONLY)) < 0) {
+#ifdef SUPPORT_RESMGR
+ open_dev = rsm_open_device(control, O_RDONLY);
+#else
+ open_dev = open(control, O_RDONLY);
+#endif
+ if (open_dev < 0) {
char aload[32];
sprintf(aload, SND_FILE_LOAD, card);
+#ifdef SUPPORT_RESMGR
+ open_dev = rsm_open_device(aload, O_RDONLY);
+#else
open_dev = open(aload, O_RDONLY);
+#endif
}
if (open_dev >= 0) {
close (open_dev);
#include <fcntl.h>
#include <sys/ioctl.h>
#include "control_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
fmode |= O_NONBLOCK;
if (mode & SND_CTL_ASYNC)
fmode |= O_ASYNC;
- if ((fd = open(filename, fmode)) < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
snd_card_load(card);
- if ((fd = open(filename, O_RDWR)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0)
return -errno;
}
#if 0
#include <fcntl.h>
#include <sys/ioctl.h>
#include "hwdep_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
if (card < 0 || card >= 32)
return -EINVAL;
sprintf(filename, SNDRV_FILE_HWDEP, card, device);
- if ((fd = open(filename, mode)) < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, mode);
+#else
+ fd = open(filename, mode);
+#endif
+ if (fd < 0) {
snd_card_load(card);
- if ((fd = open(filename, mode)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, mode);
+#else
+ fd = open(filename, mode);
+#endif
+ if (fd < 0)
return -errno;
}
#if 0
#include <sys/shm.h>
#include "pcm_local.h"
#include "../control/control_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
//#define DEBUG_RW /* use to debug readi/writei/readn/writen */
//#define DEBUG_MMAP /* debug mmap_commit */
fmode |= O_NONBLOCK;
if (mode & SND_PCM_ASYNC)
fmode |= O_ASYNC;
- if ((fd = open(filename, fmode)) < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
ret = -errno;
SYSMSG("open %s failed", filename);
goto _err;
#include <sys/ioctl.h>
#include "../control/control_local.h"
#include "rawmidi_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
assert(!(mode & ~(SND_RAWMIDI_APPEND|SND_RAWMIDI_NONBLOCK|SND_RAWMIDI_SYNC)));
- if ((fd = open(filename, fmode)) < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
snd_card_load(card);
- if ((fd = open(filename, fmode)) < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
snd_ctl_close(ctl);
SYSERR("open %s failed", filename);
return -errno;
#include <fcntl.h>
#include <sys/ioctl.h>
#include "seq_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
{
int fd, ver, client, fmode, ret;
- char filename[32];
+ const char *filename;
snd_seq_t *seq;
snd_seq_hw_t *hw;
if (mode & SND_SEQ_NONBLOCK)
fmode |= O_NONBLOCK;
- sprintf(filename, SNDRV_FILE_SEQ);
- if ((fd = open(filename, fmode)) < 0) {
- close(open(SNDRV_FILE_ALOADSEQ, O_RDWR));
- if ((fd = open(filename, fmode)) < 0) {
+ filename = SNDRV_FILE_SEQ;
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
+#ifdef SUPPORT_RESMGR
+ fd = open(SNDRV_FILE_ALOADSEQ, O_RDWR);
+#else
+ fd = open(SNDRV_FILE_ALOADSEQ, fmode);
+#endif
+ if (fd >= 0)
+ close(fd);
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(filename, fmode);
+#else
+ fd = open(filename, fmode);
+#endif
+ if (fd < 0) {
SYSERR("open %s failed", filename);
return -errno;
}
#include <fcntl.h>
#include <sys/ioctl.h>
#include "timer_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
tmode = O_RDONLY;
if (mode & SND_TIMER_OPEN_NONBLOCK)
tmode |= O_NONBLOCK;
- if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(SNDRV_FILE_TIMER, tmode);
+#else
+ fd = open(SNDRV_FILE_TIMER, tmode);
+#endif
+ if (fd < 0)
return -errno;
#if 0
/*
#include <fcntl.h>
#include <sys/ioctl.h>
#include "timer_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
tmode = O_RDONLY;
if (mode & SND_TIMER_OPEN_NONBLOCK)
tmode |= O_NONBLOCK;
- if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(SNDRV_FILE_TIMER, tmode);
+#else
+ fd = open(SNDRV_FILE_TIMER, tmode);
+#endif
+ if (fd < 0)
return -errno;
if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) {
close(fd);