/* This function waits until it is possible to write a full sound buffer */
static void
ALSA_WaitDevice(_THIS)
{
    /* We're in blocking mode, so there's nothing to do here */
    //deprintf( "ALSA_WaitDevice(%08X.%08X)\n", SHW64(this));

    sys_event_t event;
    s32 ret = sysEventQueueReceive( _snd_queue, &event, 20 * 1000);
    //deprintf( "sysEventQueueReceive: %08X\n", ret);
}
Beispiel #2
0
void playOneBlock(audioPortConfig *config)
{
	f32 *buf;
	s32 ret = 0;
	sys_event_t event;
	u64 current_block = *(u64*)((u64)config->readIndex);
	f32 *dataStart = (f32*)((u64)config->audioDataStart);
	u32 audio_block_index = (current_block + 1)%config->numBlocks;

	ret = sysEventQueueReceive(snd_queue,&event,20*1000);

	buf = dataStart + config->channelCount*AUDIO_BLOCK_SAMPLES*audio_block_index;
	fillBuffer(buf);
}