Recently I studied tuna audio HAL reference codes, and summarized parameters configuration in the following table: screen status ALSA parameters AF parameters period size period count start threshold avail min write size write threshold buffer size buffer count screen ON 308ms 2 22ms x 2 22ms 22ms 22ms x 4 22ms 28 screen OFF 308ms 2 22ms x 2 308ms 22ms 308ms x 2 22ms 28
According to the codes, the purpose is to simulate 22ms pseudo period size when screen is ON, and use 308ms period size when screen is OFF, right? Then I have one question: Actually ALSA period size is always set to 308ms, so DMA interrupt will always arrive after each 308ms, right? But according to kernel codes, ALSA will always wait with 10s timeout, until DMA interrupt signal it. So how could we simulate 22ms pseudo period size? Need to modify the timeout logic in kernel codes? Thanks a lot. ------------------------------------------------------------------------ kernel/sound/core/pcm_lib.c (wait_for_avail() functin) if (runtime->no_period_wakeup) wait_time = MAX_SCHEDULE_TIMEOUT; else { wait_time = 10; if (runtime->rate) { long t = runtime->period_size * 2 / runtime->rate; wait_time = max(t, wait_time); } wait_time = msecs_to_jiffies(wait_time * 1000); } -------------------------------------------------------------------------- -- -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting --- You received this message because you are subscribed to the Google Groups "android-porting" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.