mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Fixes for PCM loopback..
This commit is contained in:
parent
3555271122
commit
b38a572356
2 changed files with 5 additions and 5 deletions
|
|
@ -49,7 +49,7 @@ ssize_t snd_pcm_read(snd_pcm_t *handle, void *buffer, size_t size);
|
|||
extern "C" {
|
||||
#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_file_descriptor(snd_pcm_loopback_t *handle);
|
||||
int snd_pcm_loopback_block_mode(snd_pcm_loopback_t *handle, int enable);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <sys/ioctl.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 )
|
||||
|
||||
struct snd_pcm_loopback {
|
||||
|
|
@ -37,7 +37,7 @@ struct snd_pcm_loopback {
|
|||
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;
|
||||
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)
|
||||
return -EINVAL;
|
||||
sprintf(filename, SND_FILE_PCM_LB, card, device,
|
||||
mode == SND_PCM_LB_OPEN_CAPTURE ? "r" : "p");
|
||||
sprintf(filename, SND_FILE_PCM_LB, card, device, subchn,
|
||||
mode == SND_PCM_LB_OPEN_CAPTURE ? "c" : "p");
|
||||
if ((fd = open(filename, mode)) < 0) {
|
||||
snd_card_load(card);
|
||||
if ((fd = open(filename, mode)) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue