Skip to content

Commit 5aba464

Browse files
author
Reinhard Panhuber
committed
Add magic checks
1 parent ff2dc0a commit 5aba464

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/class/audio/audio_device.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,16 @@ void audiod_sof (uint8_t rhport, uint32_t frame_count)
21162116
feedback = ((n_cylces - audio->fb_n_cycles_old) << 3) * audio->fb_param_factor_N / audio->fb_param_factor_D; // feeback_param_factor_N has scaling factor of 13 bits, n_cycles 3 and feeback_param_factor_D 1, hence 16.16 precision
21172117
#endif
21182118

2119+
// Buffer count checks ?
2120+
2121+
// Magic checks
2122+
if (feedback > 2949166){ // 45.0007 in 16.16 format
2123+
feedback = 2949166;
2124+
}
2125+
if ( feedback < 2883630) { // 44.0007 in 16.16 format
2126+
feedback = 2883630;
2127+
}
2128+
21192129
tud_audio_n_fb_set(i, feedback);
21202130
audio->fb_n_frames_current = 0;
21212131
audio->fb_n_cycles_old = n_cylces;

0 commit comments

Comments
 (0)