alsaloop: fix -a option and slave mode processing

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2010-10-06 20:34:03 +02:00
parent 4fe4d22b73
commit 5ad13c4825
3 changed files with 14 additions and 11 deletions

View file

@ -424,9 +424,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
case 'a': case 'a':
if (optarg[0] == 'a') if (optarg[0] == 'a')
arg_slave = SLAVE_TYPE_AUTO; arg_slave = SLAVE_TYPE_AUTO;
else if (strcasecmp(optarg, "off")) else if (strcasecmp(optarg, "on") == 0)
arg_slave = SLAVE_TYPE_ON; arg_slave = SLAVE_TYPE_ON;
else if (strcasecmp(optarg, "on")) else if (strcasecmp(optarg, "off") == 0)
arg_slave = SLAVE_TYPE_OFF; arg_slave = SLAVE_TYPE_OFF;
else else
arg_slave = atoi(optarg); arg_slave = atoi(optarg);

View file

@ -1432,6 +1432,8 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
} }
if (verbose > 9) if (verbose > 9)
snd_output_printf(loop->output, "%s: prevents = 0x%x, crevents = 0x%x\n", loop->id, prevents, crevents); snd_output_printf(loop->output, "%s: prevents = 0x%x, crevents = 0x%x\n", loop->id, prevents, crevents);
if (prevents == 0 && crevents == 0)
goto __pcm_end;
do { do {
ccount = readit(capt); ccount = readit(capt);
buf_add(loop, ccount); buf_add(loop, ccount);
@ -1520,6 +1522,7 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
else else
snd_output_printf(loop->output, "%s: end delay %li\n", capt->id, cdelay); snd_output_printf(loop->output, "%s: end delay %li\n", capt->id, cdelay);
} }
__pcm_end:
if (verbose > 13) { if (verbose > 13) {
getcurtimestamp(&loop->tstamp_end); getcurtimestamp(&loop->tstamp_end);
snd_output_printf(loop->output, "%s: processing time %lius\n", capt->id, timediff(loop->tstamp_end, loop->tstamp_start)); snd_output_printf(loop->output, "%s: processing time %lius\n", capt->id, timediff(loop->tstamp_end, loop->tstamp_start));

View file

@ -28,19 +28,19 @@ EOF
} }
test3() { test3() {
echo "TEST2" echo "TEST3"
cat > $CFGFILE <<EOF cat > $CFGFILE <<EOF
-C hw:1,0,0 -P dmix:0 --tlatency 50000 --thread 0 \ -C hw:1,0,0 -P plug:dmix:0 --tlatency 50000 --thread 0 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \ --mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \ --mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
--mixer "name='PCM Playback Volume'" --mixer "name='PCM Playback Volume'"
-C hw:1,0,1 -P dmix:0 --tlatency 50000 --thread 1 -C hw:1,0,1 -P plug:dmix:0 --tlatency 50000 --thread 1
-C hw:1,0,2 -P dmix:0 --tlatency 50000 --thread 2 -C hw:1,0,2 -P plug:dmix:0 --tlatency 50000 --thread 2
-C hw:1,0,3 -P dmix:0 --tlatency 50000 --thread 3 -C hw:1,0,3 -P plug:dmix:0 --tlatency 50000 --thread 3
-C hw:1,0,4 -P dmix:0 --tlatency 50000 --thread 4 -C hw:1,0,4 -P plug:dmix:0 --tlatency 50000 --thread 4
-C hw:1,0,5 -P dmix:0 --tlatency 50000 --thread 5 -C hw:1,0,5 -P plug:dmix:0 --tlatency 50000 --thread 5
-C hw:1,0,6 -P dmix:0 --tlatency 50000 --thread 6 -C hw:1,0,6 -P plug:dmix:0 --tlatency 50000 --thread 6
-C hw:1,0,7 -P dmix:0 --tlatency 50000 --thread 7 -C hw:1,0,7 -P plug:dmix:0 --tlatency 50000 --thread 7
EOF EOF
$DBG ./alsaloop --config $CFGFILE $DBG ./alsaloop --config $CFGFILE
} }