@@ -387,27 +387,20 @@ typedef struct {
387387 const virtio_snd_pcm_xfer_t * request = \
388388 (virtio_snd_pcm_xfer_t * ) (base + addr ); \
389389 stream_id = request -> stream_id ; \
390- fprintf (stderr , "get stream %" PRIu32 " request\n" , \
391- stream_id ); \
392390 goto early_continue ; \
393391 } else if (idx == cnt - 1 ) { /* the last descriptor */ \
394392 virtio_snd_pcm_status_t * response = \
395393 (virtio_snd_pcm_status_t * ) (base + addr ); \
396- response -> status = VIRTIO_SND_S_OK ; \
394+ response -> status = VIRTIO_SND_S_OK ; \
397395 response -> latency_bytes = ret_len ; \
398396 * plen = sizeof (* response ); \
399397 goto early_continue ; \
400398 } \
401399 \
402400 if (WRITE ) { \
403401 void * payload = (void * ) (base + addr ); \
404- fprintf (stderr , "ready to write to stream %" PRIu32 "\n" , \
405- stream_id ); \
406402 __virtio_snd_frame_enqueue (payload , len , stream_id ); \
407403 } \
408- if (!WRITE ) { \
409- fprintf (stderr , "flush\n" ); \
410- } \
411404 ret_len += len ; \
412405 \
413406 early_continue : \
@@ -670,7 +663,6 @@ static void virtio_snd_read_pcm_start(const virtio_snd_pcm_hdr_t *query,
670663 return ;
671664 }
672665
673- fprintf (stderr , "*** pcm_start end***\n" );
674666 * plen = 0 ;
675667}
676668
@@ -698,15 +690,13 @@ static void virtio_snd_read_pcm_stop(const virtio_snd_pcm_hdr_t *query,
698690 return ;
699691 }
700692
701- fprintf (stderr , "*** pcm_stop end***\n" );
702693 * plen = 0 ;
703694}
704695
705696static void virtio_snd_read_pcm_release (const virtio_snd_pcm_hdr_t * query ,
706697 uint32_t * plen ,
707698 virtio_snd_state_t * vsnd )
708699{
709- fprintf (stderr , "*** pcm_release start ***\n" );
710700 const virtio_snd_pcm_hdr_t * request = query ;
711701 uint32_t stream_id = request -> stream_id ;
712702 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,
734724 vsnd_buf_queue_node_t * tmp = NULL ;
735725 vsnd_buf_queue_node_t * node ;
736726 if (!list_empty (& props -> buf_queue_head )) {
737- fprintf (stderr , "tearing down leftovers\n" );
738727 list_for_each_entry_safe (node , tmp , & props -> buf_queue_head , q ) {
739728 list_del (& node -> q );
740729 free (node );
@@ -747,9 +736,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
747736 printf ("PortAudio error: %s\n" , Pa_GetErrorText (err ));
748737 }
749738
750-
751-
752- /* TODO: flush TX/RX queue */
753739 /* virtio-v1.3-csd01, 5.14.6.6.5.1,
754740 * Device Requirements: Stream Release
755741 *
@@ -761,7 +747,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
761747 virtio_queue_notify_handler (vsnd , 2 , virtio_snd_tx_desc_flush_handler );
762748
763749 * plen = 0 ;
764- fprintf (stderr , "*** pcm_release end ***\n" );
765750}
766751
767752static void __virtio_snd_frame_dequeue (void * out ,
@@ -770,11 +755,9 @@ static void __virtio_snd_frame_dequeue(void *out,
770755{
771756 virtio_snd_prop_t * props = & vsnd_props [stream_id ];
772757
773- fprintf (stderr , "deque before lock\n" );
774758 pthread_mutex_lock (& props -> lock .lock );
775759 while (props -> lock .buf_ev_notity < 1 )
776760 pthread_cond_wait (& props -> lock .readable , & props -> lock .lock );
777- fprintf (stderr , "deque stream %" PRIu32 " in critical\n" , stream_id );
778761
779762 /* Get the PCM frames from queue */
780763 uint32_t written_bytes = 0 ;
@@ -909,11 +892,9 @@ static void __virtio_snd_frame_enqueue(void *payload,
909892{
910893 virtio_snd_prop_t * props = & vsnd_props [stream_id ];
911894
912- fprintf (stderr , "enque before lock\n" );
913895 pthread_mutex_lock (& props -> lock .lock );
914896 while (props -> lock .buf_ev_notity > 0 )
915897 pthread_cond_wait (& props -> lock .writable , & props -> lock .lock );
916- fprintf (stderr , "enque stream %" PRIu32 " in critical \n" , stream_id );
917898
918899 /* Add a PCM frame to queue */
919900 /* 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)
12101191{
12111192 if (vsnd_dev_cnt >= VSND_DEV_CNT_MAX ) {
12121193 fprintf (stderr ,
1213- "Exceeded the number of virtio-snd devices that can be "
1194+ "Exceed the number of virtio-snd devices that can be "
12141195 "allocated.\n" );
12151196 return false;
12161197 }
0 commit comments