Prevent PCM510x has a zero-data detect from kicking in (#843)

The PCM510x has a zero-data detect function. When the device detects continuous zero data, it enters a full analog mute condition. The PCM510x counts zero data over 1024LRCKs (21ms @ 48kHz) before setting analog mute. This caused audible artifacts. Hence we are generating an inaudibly small signal to prevent the analog mute from kicking in.

Thanks @soyersoyer
Similar to soyersoyer#5
pull/842/head^2
probonopd 2 days ago committed by GitHub
parent 9b211c1c01
commit 98a31df28d
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);
}
// Prevent PCM510x analog mute from kicking in
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))
{
LOGERR ("Sound data dropped");
@ -1394,6 +1403,12 @@ void CMiniDexed::ProcessSound (void)
arm_fill_q15(0, tmp_int, nFrames * 2);
}
// Prevent PCM510x analog mute from kicking in
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))
{
LOGERR ("Sound data dropped");

Loading…
Cancel
Save