version 1.22, 2015/11/25 18:51:08 |
version 1.23, 2016/01/08 16:17:31 |
|
|
if (s->mode & MODE_PLAY) { |
if (s->mode & MODE_PLAY) { |
abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf); |
abuf_rdiscard(&s->mix.buf, s->round * s->mix.bpf); |
} |
} |
s->skip--; |
s->skip--; |
} |
} |
return max - s->skip; |
return max - s->skip; |
} |
} |
|
|
int |
int |
play_filt_resamp(struct slot *s, void *res_in, void *out, int todo) |
play_filt_resamp(struct slot *s, void *res_in, void *out, int todo) |
{ |
{ |
int i, offs, vol, nch; |
int i, offs, vol, nch; |
|
|
return todo; |
return todo; |
} |
} |
|
|
int |
int |
play_filt_dec(struct slot *s, void *in, void *out, int todo) |
play_filt_dec(struct slot *s, void *in, void *out, int todo) |
{ |
{ |
void *tmp; |
void *tmp; |
|
|
} |
} |
} |
} |
|
|
int |
int |
rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo) |
rec_filt_resamp(struct slot *s, void *in, void *res_out, int todo) |
{ |
{ |
int i, vol, offs, nch; |
int i, vol, offs, nch; |
|
|
return todo; |
return todo; |
} |
} |
|
|
int |
int |
rec_filt_enc(struct slot *s, void *in, void *out, int todo) |
rec_filt_enc(struct slot *s, void *in, void *out, int todo) |
{ |
{ |
void *tmp; |
void *tmp; |
|
|
dev_mix_adjvol(d); |
dev_mix_adjvol(d); |
continue; |
continue; |
} |
} |
|
|
/* |
/* |
* check for xruns |
* check for xruns |
*/ |
*/ |
if (((s->mode & MODE_PLAY) && |
if (((s->mode & MODE_PLAY) && |
s->mix.buf.used < s->round * s->mix.bpf) || |
s->mix.buf.used < s->round * s->mix.bpf) || |
((s->mode & MODE_RECMASK) && |
((s->mode & MODE_RECMASK) && |
s->sub.buf.len - s->sub.buf.used < |
s->sub.buf.len - s->sub.buf.used < |
|
|
dev_onmove(struct dev *d, int delta) |
dev_onmove(struct dev *d, int delta) |
{ |
{ |
long long pos; |
long long pos; |
struct slot *s, *snext; |
struct slot *s, *snext; |
|
|
d->delta += delta; |
d->delta += delta; |
|
|
|
|
} |
} |
d->poffs = 0; |
d->poffs = 0; |
|
|
/* |
/* |
* empty cycles don't increment delta, so it's ok to |
* empty cycles don't increment delta, so it's ok to |
* start at 0 |
* start at 0 |
**/ |
**/ |
d->delta = 0; |
d->delta = 0; |
|
|
d->pstate = DEV_RUN; |
d->pstate = DEV_RUN; |
dev_sio_start(d); |
dev_sio_start(d); |
|
|
* start the device if not started |
* start the device if not started |
*/ |
*/ |
dev_wakeup(d); |
dev_wakeup(d); |
|
|
/* |
/* |
* get the current position, the origin is when the first sample |
* get the current position, the origin is when the first sample |
* played and/or recorded |
* played and/or recorded |
|
|
s->sub.encbuf = |
s->sub.encbuf = |
xmalloc(s->round * slot_nch * sizeof(adata_t)); |
xmalloc(s->round * slot_nch * sizeof(adata_t)); |
} |
} |
|
|
/* |
/* |
* N-th recorded block is the N-th played block |
* N-th recorded block is the N-th played block |
*/ |
*/ |
|
|
/* |
/* |
* device may be disconnected, and if so we're called from |
* device may be disconnected, and if so we're called from |
* slot->ops->exit() on a closed device |
* slot->ops->exit() on a closed device |
*/ |
*/ |
if (s->dev->pstate == DEV_CFG) |
if (s->dev->pstate == DEV_CFG) |
return; |
return; |
if (s->tstate == MMC_OFF) |
if (s->tstate == MMC_OFF) |
|
|
log_puts("\n"); |
log_puts("\n"); |
} |
} |
#endif |
#endif |
s->mix.bpf = s->par.bps * |
s->mix.bpf = s->par.bps * |
(s->mix.slot_cmax - s->mix.slot_cmin + 1); |
(s->mix.slot_cmax - s->mix.slot_cmin + 1); |
abuf_init(&s->mix.buf, bufsz * s->mix.bpf); |
abuf_init(&s->mix.buf, bufsz * s->mix.bpf); |
} |
} |
|
|
log_puts("\n"); |
log_puts("\n"); |
} |
} |
#endif |
#endif |
s->sub.bpf = s->par.bps * |
s->sub.bpf = s->par.bps * |
(s->sub.slot_cmax - s->sub.slot_cmin + 1); |
(s->sub.slot_cmax - s->sub.slot_cmin + 1); |
abuf_init(&s->sub.buf, bufsz * s->sub.bpf); |
abuf_init(&s->sub.buf, bufsz * s->sub.bpf); |
} |
} |
|
|
panic(); |
panic(); |
} |
} |
#endif |
#endif |
} |
} |
*ps = s->next; |
*ps = s->next; |
if (s->mode & MODE_RECMASK) { |
if (s->mode & MODE_RECMASK) { |
if (s->sub.encbuf) |
if (s->sub.encbuf) |