marcel-licence / esp32_midi_sampler

GNU General Public License v3.0
74 stars 13 forks source link

ES8388 volume #55

Closed krieg-geist closed 3 years ago

krieg-geist commented 3 years ago

Just a question regarding the ES8388 driver implementation, do you find that the output volume is significantly lower using the onboard codec vs an external dac like 5102 or 1334a? I'm using your implementation as a base for porting another project to AudioKit hardware and I've tried changing a few settings but it seems all the relevant output / gain levels are set to maximum in your setup() method anyway.

Anyway, thank you for the excellent project!

marcel-licence commented 3 years ago

Do you use line out with an additional amplifier or do you try to use headphones? There is some float to int conversation which could cause a loss of max volume:

#ifdef SAMPLE_SIZE_16BIT
        sampleDataU[n].ch[0] = int16_t(fr_sample[n] * 16383.0f); /* some bits missing here */
        sampleDataU[n].ch[1] = int16_t(fl_sample[n] * 16383.0f);
#endif
#ifdef SAMPLE_SIZE_32BIT
        sampleDataU[n].ch[0] = int32_t(fr_sample[n] * 1073741823.0f); /* some bits missing here */
        sampleDataU[n].ch[1] = int32_t(fl_sample[n] * 1073741823.0f);
#endif
krieg-geist commented 3 years ago

Thanks for the suggestions, I was using headphones but line in to mixer works a little better. I guess the ES8388 is just not a particularly hot output. I will experiment with different multiplier in the float to int as well since nothing I was putting through it seemed to get close +/-1.0f anyway.

marcel-licence commented 3 years ago

It seems that it is not recommended to use headphones. There could be a way. But actually other users detected that especially the low frequencies are cut away.