@@ -387,27 +387,20 @@ typedef struct {
387
387
const virtio_snd_pcm_xfer_t * request = \
388
388
(virtio_snd_pcm_xfer_t * ) (base + addr ); \
389
389
stream_id = request -> stream_id ; \
390
- fprintf (stderr , "get stream %" PRIu32 " request\n" , \
391
- stream_id ); \
392
390
goto early_continue ; \
393
391
} else if (idx == cnt - 1 ) { /* the last descriptor */ \
394
392
virtio_snd_pcm_status_t * response = \
395
393
(virtio_snd_pcm_status_t * ) (base + addr ); \
396
- response -> status = VIRTIO_SND_S_OK ; \
394
+ response -> status = VIRTIO_SND_S_OK ; \
397
395
response -> latency_bytes = ret_len ; \
398
396
* plen = sizeof (* response ); \
399
397
goto early_continue ; \
400
398
} \
401
399
\
402
400
if (WRITE ) { \
403
401
void * payload = (void * ) (base + addr ); \
404
- fprintf (stderr , "ready to write to stream %" PRIu32 "\n" , \
405
- stream_id ); \
406
402
__virtio_snd_frame_enqueue (payload , len , stream_id ); \
407
403
} \
408
- if (!WRITE ) { \
409
- fprintf (stderr , "flush\n" ); \
410
- } \
411
404
ret_len += len ; \
412
405
\
413
406
early_continue : \
@@ -670,7 +663,6 @@ static void virtio_snd_read_pcm_start(const virtio_snd_pcm_hdr_t *query,
670
663
return ;
671
664
}
672
665
673
- fprintf (stderr , "*** pcm_start end***\n" );
674
666
* plen = 0 ;
675
667
}
676
668
@@ -698,15 +690,13 @@ static void virtio_snd_read_pcm_stop(const virtio_snd_pcm_hdr_t *query,
698
690
return ;
699
691
}
700
692
701
- fprintf (stderr , "*** pcm_stop end***\n" );
702
693
* plen = 0 ;
703
694
}
704
695
705
696
static void virtio_snd_read_pcm_release (const virtio_snd_pcm_hdr_t * query ,
706
697
uint32_t * plen ,
707
698
virtio_snd_state_t * vsnd )
708
699
{
709
- fprintf (stderr , "*** pcm_release start ***\n" );
710
700
const virtio_snd_pcm_hdr_t * request = query ;
711
701
uint32_t stream_id = request -> stream_id ;
712
702
virtio_snd_prop_t * props = & vsnd_props [stream_id ];
@@ -734,7 +724,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
734
724
vsnd_buf_queue_node_t * tmp = NULL ;
735
725
vsnd_buf_queue_node_t * node ;
736
726
if (!list_empty (& props -> buf_queue_head )) {
737
- fprintf (stderr , "tearing down leftovers\n" );
738
727
list_for_each_entry_safe (node , tmp , & props -> buf_queue_head , q ) {
739
728
list_del (& node -> q );
740
729
free (node );
@@ -747,9 +736,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
747
736
printf ("PortAudio error: %s\n" , Pa_GetErrorText (err ));
748
737
}
749
738
750
-
751
-
752
- /* TODO: flush TX/RX queue */
753
739
/* virtio-v1.3-csd01, 5.14.6.6.5.1,
754
740
* Device Requirements: Stream Release
755
741
*
@@ -761,7 +747,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
761
747
virtio_queue_notify_handler (vsnd , 2 , virtio_snd_tx_desc_flush_handler );
762
748
763
749
* plen = 0 ;
764
- fprintf (stderr , "*** pcm_release end ***\n" );
765
750
}
766
751
767
752
static void __virtio_snd_frame_dequeue (void * out ,
@@ -770,11 +755,9 @@ static void __virtio_snd_frame_dequeue(void *out,
770
755
{
771
756
virtio_snd_prop_t * props = & vsnd_props [stream_id ];
772
757
773
- fprintf (stderr , "deque before lock\n" );
774
758
pthread_mutex_lock (& props -> lock .lock );
775
759
while (props -> lock .buf_ev_notity < 1 )
776
760
pthread_cond_wait (& props -> lock .readable , & props -> lock .lock );
777
- fprintf (stderr , "deque stream %" PRIu32 " in critical\n" , stream_id );
778
761
779
762
/* Get the PCM frames from queue */
780
763
uint32_t written_bytes = 0 ;
@@ -909,11 +892,9 @@ static void __virtio_snd_frame_enqueue(void *payload,
909
892
{
910
893
virtio_snd_prop_t * props = & vsnd_props [stream_id ];
911
894
912
- fprintf (stderr , "enque before lock\n" );
913
895
pthread_mutex_lock (& props -> lock .lock );
914
896
while (props -> lock .buf_ev_notity > 0 )
915
897
pthread_cond_wait (& props -> lock .writable , & props -> lock .lock );
916
- fprintf (stderr , "enque stream %" PRIu32 " in critical \n" , stream_id );
917
898
918
899
/* Add a PCM frame to queue */
919
900
/* As stated in Linux Kernel mailing list [1], we keep the pointer
@@ -1210,7 +1191,7 @@ bool virtio_snd_init(virtio_snd_state_t *vsnd)
1210
1191
{
1211
1192
if (vsnd_dev_cnt >= VSND_DEV_CNT_MAX ) {
1212
1193
fprintf (stderr ,
1213
- "Exceeded the number of virtio-snd devices that can be "
1194
+ "Exceed the number of virtio-snd devices that can be "
1214
1195
"allocated.\n" );
1215
1196
return false;
1216
1197
}
0 commit comments