mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 05:05:43 +01:00
PCM loopback API improved and added back the functionality.
Some mmap() changes for the OSS emulation.
This commit is contained in:
parent
924b1d976a
commit
d162b1026f
1 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/asoundlib.h>
|
#include <sys/asoundlib.h>
|
||||||
#include "aconfig.h"
|
#include "aconfig.h"
|
||||||
|
@ -1224,6 +1225,10 @@ void playback_go(int fd, int loaded, u_long count, int rtype, char *name)
|
||||||
char *buf = audiobuf;
|
char *buf = audiobuf;
|
||||||
while (l > 0) {
|
while (l > 0) {
|
||||||
while ((r = fcn_write(pcm_handle, buf, l)) < 0) {
|
while ((r = fcn_write(pcm_handle, buf, l)) < 0) {
|
||||||
|
if (r == -EAGAIN) {
|
||||||
|
r = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
playback_write_error();
|
playback_write_error();
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1311,6 +1316,8 @@ void capture_go(int fd, int loaded, u_long count, int rtype, char *name)
|
||||||
}
|
}
|
||||||
count -= c;
|
count -= c;
|
||||||
}
|
}
|
||||||
|
if (l == -EAGAIN)
|
||||||
|
l = 0;
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
fprintf(stderr, "read error: %s\n", snd_strerror(l));
|
fprintf(stderr, "read error: %s\n", snd_strerror(l));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
Loading…
Reference in a new issue