@@ -395,18 +395,21 @@ typedef struct {
395
395
if (idx == 0 ) { /* the first descriptor */ \
396
396
const virtio_snd_pcm_xfer_t * request = \
397
397
(virtio_snd_pcm_xfer_t * ) (base + addr ); \
398
+ fprintf (stderr , "sizeof request: %d\n" , sizeof (* request )); \
398
399
stream_id = request -> stream_id ; \
399
400
if (stream_id >= VSND_DEV_CNT_MAX ) { \
400
- fprintf (stderr , "invalid stream_id %" PRIu32 "\n" , \
401
- stream_id ); \
402
401
bad_msg_err = 1 ; \
403
402
} \
404
403
goto early_continue ; \
405
404
} else if (idx == cnt - 1 ) { /* the last descriptor */ \
406
405
virtio_snd_pcm_status_t * response = \
407
406
(virtio_snd_pcm_status_t * ) (base + addr ); \
408
- response -> status = \
409
- bad_msg_err ? VIRTIO_SND_S_BAD_MSG : VIRTIO_SND_S_OK ; \
407
+ response -> status = IIF (WRITE ) \
408
+ (/* Normal error handling */ \
409
+ bad_msg_err ? VIRTIO_SND_S_BAD_MSG : VIRTIO_SND_S_OK \
410
+ , /* Merely inform driver */ \
411
+ VIRTIO_SND_S_OK ); \
412
+ fprintf (stderr , #NAME_SUFFIX "response->status %" PRIu32 "\n" , response -> status );\
410
413
response -> latency_bytes = ret_len ; \
411
414
* plen = sizeof (* response ); \
412
415
goto early_continue ; \
@@ -415,10 +418,6 @@ typedef struct {
415
418
IIF (WRITE ) \
416
419
(/* enqueue frames */ \
417
420
void * payload = (void * ) (base + addr ); \
418
- fprintf (stderr , \
419
- "=== hit " #NAME_SUFFIX " %" PRIu32 \
420
- " bas_msg_err %" PRIu8 "---\n", \
421
- stream_id, bad_msg_err); \
422
421
if (bad_msg_err == 0 ) \
423
422
__virtio_snd_frame_enqueue (payload , len , stream_id ); \
424
423
, /* flush queue */ \
@@ -599,7 +598,6 @@ static void virtio_snd_read_pcm_set_params(
599
598
props -> pp .padding = request -> padding ;
600
599
601
600
* plen = 0 ;
602
- fprintf (stderr , "*** hit set_params id %" PRIu32 "***\n" , id );
603
601
}
604
602
605
603
static void virtio_snd_read_pcm_prepare (const virtio_snd_pcm_hdr_t * query ,
@@ -671,7 +669,7 @@ static void virtio_snd_read_pcm_start(const virtio_snd_pcm_hdr_t *query,
671
669
if (code != VIRTIO_SND_R_PCM_PREPARE && code != VIRTIO_SND_R_PCM_STOP ) {
672
670
fprintf (
673
671
stderr ,
674
- "virtio_snd_read_pcm_start with previous invalide state %#08x\n" ,
672
+ "virtio_snd_read_pcm_start with previous invalide stat %#08x\n" ,
675
673
code );
676
674
return ;
677
675
}
@@ -698,7 +696,7 @@ static void virtio_snd_read_pcm_stop(const virtio_snd_pcm_hdr_t *query,
698
696
uint32_t code = vsnd_props [stream_id ].pp .hdr .hdr .code ;
699
697
if (code != VIRTIO_SND_R_PCM_START ) {
700
698
fprintf (stderr ,
701
- "virtio_snd_read_pcm_stop with previous invalide state %#08x\n" ,
699
+ "virtio_snd_read_pcm_stop with previous invalid state %#08x\n" ,
702
700
code );
703
701
return ;
704
702
}
@@ -728,7 +726,7 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
728
726
if (code != VIRTIO_SND_R_PCM_PREPARE && code != VIRTIO_SND_R_PCM_STOP ) {
729
727
fprintf (
730
728
stderr ,
731
- "virtio_snd_read_pcm_release with previous invalide state %#08x\n" ,
729
+ "virtio_snd_read_pcm_release with previous invalid state %#08x\n" ,
732
730
code );
733
731
return ;
734
732
}
@@ -816,7 +814,6 @@ static int virtio_snd_stream_cb(const void *input,
816
814
PaStreamCallbackFlags status_flags ,
817
815
void * user_data )
818
816
{
819
- fprintf (stderr , "=== hit virtio_snd_stream_cb ===\n" );
820
817
vsnd_stream_sel_t * v_ptr = (vsnd_stream_sel_t * ) user_data ;
821
818
uint32_t id = v_ptr -> stream_id ;
822
819
int channels = vsnd_props [id ].pp .channels ;
0 commit comments