int count = samples;
snd_pcm_sframes_t delay = 0;
+// static FILE *debug_fd = 0;
+// if(!debug_fd)
+// {
+// debug_fd = fopen("/tmp/debug.pcm", "w");
+// }
+// fwrite(buffer, size, 1, debug_fd);
+// fflush(debug_fd);
+
+
if(!get_output()) return 0;
if( buffer_position == 0 )
timer->update();
int ret = snd_pcm_avail_update(get_output());
if( ret >= period_size ) {
if( ret > count ) ret = count;
+//FILE *alsa_fp = 0;
+//if( !alsa_fp ) alsa_fp = fopen("/tmp/alsa.raw","w");
+//if( alsa_fp ) fwrite(buffer, sample_size, ret, alsa_fp);
//printf("AudioALSA::snd_pcm_writei start %d\n",count);
ret = snd_pcm_writei(get_output(),buffer,ret);
//printf("AudioALSA::snd_pcm_writei done %d\n", ret);