Skip to content

Commit 6546743

Browse files
committed
Debug
1 parent 56a79dd commit 6546743

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

virtio-snd.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,12 @@ static void virtio_snd_read_pcm_set_params(
459459
vsnd_props[id].pp.rate = request->rate;
460460
vsnd_props[id].pp.padding = request->padding;
461461

462+
fprintf(stderr, "pcm_set_params rate %d" " period_bytes %" PRIu32 " buffer_bytes %" PRIu32 " channels %" PRIu32 "\n",
463+
pcm_rate_tbl[vsnd_props[id].pp.rate],
464+
vsnd_props[id].pp.period_bytes,
465+
vsnd_props[id].pp.buffer_bytes,
466+
vsnd_props[id].pp.channels);
467+
462468
*plen = 0;
463469
fprintf(stderr, "virtio_snd_read_pcm_set_params\n");
464470
}
@@ -606,11 +612,16 @@ static void __virtio_snd_frame_dequeue(void *out,
606612
/* Copy the frame to output stream */
607613
uint32_t size = props->pp.buffer_bytes;
608614
uint32_t idx = cons_head & mask;
615+
fprintf(stderr, "cons_head %" PRIu32 " cons_next %" PRIu32 " mask %" PRIu32 " idx %" PRIu32 "\n",
616+
cons_head, cons_next, mask, idx);
609617
if (idx + n < size) {
610618
memcpy(out, props->ring.buffer + idx, n);
619+
//out += n;
611620
} else {
612621
memcpy(out, props->ring.buffer + idx, size - idx);
622+
//out += (size - idx);
613623
memcpy(out + (size - idx), props->ring.buffer, n - (size - idx));
624+
//out += (n - (size - idx));
614625
}
615626
VSND_COMPILER_BARRIER;
616627

0 commit comments

Comments
 (0)