Prevent power save from kicking in

Similar to https://github.com/soyersoyer/MiniDexed/pull/5
pull/843/head
probonopd 2 months ago committed by GitHub
parent 9b211c1c01
commit 720fd15819
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      src/minidexed.cpp

@ -1309,6 +1309,15 @@ void CMiniDexed::ProcessSound (void)
arm_fill_q15(0, tmp_int, nFrames*Channels); arm_fill_q15(0, tmp_int, nFrames*Channels);
} }
// Prevent power save
for (uint8_t tg = 0; tg < Channels; tg++)
{
if (tmp_int[(nFrames - 1) * Channels + tg] == 0)
{
tmp_int[(nFrames - 1) * Channels + tg]++;
}
}
if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int)) if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int))
{ {
LOGERR ("Sound data dropped"); LOGERR ("Sound data dropped");
@ -1394,6 +1403,12 @@ void CMiniDexed::ProcessSound (void)
arm_fill_q15(0, tmp_int, nFrames * 2); arm_fill_q15(0, tmp_int, nFrames * 2);
} }
// Prevent power save
if (tmp_int[nFrames * 2 - 1] == 0)
{
tmp_int[nFrames * 2 - 1]++;
}
if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int)) if (m_pSoundDevice->Write (tmp_int, sizeof(tmp_int)) != (int) sizeof(tmp_int))
{ {
LOGERR ("Sound data dropped"); LOGERR ("Sound data dropped");

Loading…
Cancel
Save