mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added loopback, some fixes...
This commit is contained in:
parent
19811bb9b4
commit
3d5115b325
3 changed files with 23 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
check_PROGRAMS=control mixer switches pause pcm latency seq playmidi1 timer
|
check_PROGRAMS=control mixer switches pause pcm latency seq playmidi1 timer \
|
||||||
|
loopback
|
||||||
|
|
||||||
control_LDADD=../src/libasound.la
|
control_LDADD=../src/libasound.la
|
||||||
mixer_LDADD=../src/libasound.la
|
mixer_LDADD=../src/libasound.la
|
||||||
|
|
@ -9,9 +10,9 @@ latency_LDADD=../src/libasound.la
|
||||||
seq_LDADD=../src/libasound.la
|
seq_LDADD=../src/libasound.la
|
||||||
playmidi1_LDADD=../src/libasound.la
|
playmidi1_LDADD=../src/libasound.la
|
||||||
timer_LDADD=../src/libasound.la
|
timer_LDADD=../src/libasound.la
|
||||||
|
loopback_LDADD=../src/libasound.la
|
||||||
|
|
||||||
INCLUDES=-I$(top_srcdir)/include
|
INCLUDES=-I$(top_srcdir)/include
|
||||||
CFLAGS=-static -Wall -pipe -g
|
CFLAGS=-static -Wall -pipe -g
|
||||||
|
|
||||||
EXTRA_DIST=seq-decoder.c seq-sender.c midifile.h midifile.c midifile.3
|
EXTRA_DIST=seq-decoder.c seq-sender.c midifile.h midifile.c midifile.3
|
||||||
|
|
||||||
|
|
|
||||||
18
test/loopback.c
Normal file
18
test/loopback.c
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "../include/asoundlib.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
void *handle;
|
||||||
|
|
||||||
|
err = snd_pcm_loopback_open(&handle, 0, 0, SND_PCM_LB_OPEN_PLAYBACK);
|
||||||
|
if (err < 0) {
|
||||||
|
fprintf(stderr, "open error: %s\n", snd_strerror(err));
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
snd_pcm_loopback_close(handle);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -26,6 +26,8 @@ void set_name(void *handle)
|
||||||
snd_seq_client_info_t info;
|
snd_seq_client_info_t info;
|
||||||
|
|
||||||
bzero(&info, sizeof(info));
|
bzero(&info, sizeof(info));
|
||||||
|
info.client = snd_seq_client_id(handle);
|
||||||
|
info.type = USER_CLIENT;
|
||||||
snprintf(info.name, sizeof(info.name), "SeqUtil - %i", getpid());
|
snprintf(info.name, sizeof(info.name), "SeqUtil - %i", getpid());
|
||||||
if ((err = snd_seq_set_client_info(handle, &info)) < 0) {
|
if ((err = snd_seq_set_client_info(handle, &info)) < 0) {
|
||||||
fprintf(stderr, "Set client info error: %s\n", snd_strerror(err));
|
fprintf(stderr, "Set client info error: %s\n", snd_strerror(err));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue