Commit 34bd1747 authored by claes's avatar claes

Timer removed in ALSA

parent 5bf259ee
......@@ -460,6 +460,7 @@ void XttAudio::audio_write( void *data)
printf( "Write idx: %d totsize: %d size: %d\n", audio->write_buffer_idx, audio->write_buffer_size, size);
snd_pcm_prepare( audio->ALSA_handle);
for (;;) {
rc = snd_pcm_writei( audio->ALSA_handle, &audio->write_buffer[audio->write_buffer_idx],
size/2);
if (rc == -EPIPE) {
......@@ -483,8 +484,10 @@ void XttAudio::audio_write( void *data)
audio->write_buffer_idx += size;
if ( audio->write_buffer_idx < audio->write_buffer_size) {
// Submit next write
#if 0
int time = 1000 * size/2 / srate;
audio->timerid->add( time, audio_write, audio);
#endif
}
else {
// Free buffer
......@@ -500,6 +503,9 @@ void XttAudio::audio_write( void *data)
audio->beep( &aref);
}
snd_pcm_drain( audio->ALSA_handle);
break;
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment