Fixes for PCM loopback..

This commit is contained in:
Jaroslav Kysela 1999-08-20 20:16:46 +00:00
parent 3555271122
commit b38a572356
2 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ ssize_t snd_pcm_read(snd_pcm_t *handle, void *buffer, size_t size);
extern "C" { extern "C" {
#endif #endif
int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int mode); int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int subchn, int mode);
int snd_pcm_loopback_close(snd_pcm_loopback_t *handle); int snd_pcm_loopback_close(snd_pcm_loopback_t *handle);
int snd_pcm_loopback_file_descriptor(snd_pcm_loopback_t *handle); int snd_pcm_loopback_file_descriptor(snd_pcm_loopback_t *handle);
int snd_pcm_loopback_block_mode(snd_pcm_loopback_t *handle, int enable); int snd_pcm_loopback_block_mode(snd_pcm_loopback_t *handle, int enable);

View file

@ -28,7 +28,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "asoundlib.h" #include "asoundlib.h"
#define SND_FILE_PCM_LB "/proc/asound/%i/pcm%i%s" #define SND_FILE_PCM_LB "/proc/asound/%i/pcmloopD%iS%i%s"
#define SND_PCM_LB_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 ) #define SND_PCM_LB_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
struct snd_pcm_loopback { struct snd_pcm_loopback {
@ -37,7 +37,7 @@ struct snd_pcm_loopback {
int fd; int fd;
} ; } ;
int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int mode) int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int subchn, int mode)
{ {
int fd, ver; int fd, ver;
char filename[32]; char filename[32];
@ -47,8 +47,8 @@ int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int
if (card < 0 || card >= SND_CARDS) if (card < 0 || card >= SND_CARDS)
return -EINVAL; return -EINVAL;
sprintf(filename, SND_FILE_PCM_LB, card, device, sprintf(filename, SND_FILE_PCM_LB, card, device, subchn,
mode == SND_PCM_LB_OPEN_CAPTURE ? "r" : "p"); mode == SND_PCM_LB_OPEN_CAPTURE ? "c" : "p");
if ((fd = open(filename, mode)) < 0) { if ((fd = open(filename, mode)) < 0) {
snd_card_load(card); snd_card_load(card);
if ((fd = open(filename, mode)) < 0) if ((fd = open(filename, mode)) < 0)