Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loud click on startup #29

Closed
apmcpherson opened this issue Jul 15, 2016 · 4 comments
Closed

Loud click on startup #29

apmcpherson opened this issue Jul 15, 2016 · 4 comments

Comments

@apmcpherson
Copy link
Contributor

This has been around since the beginning, but it would be nice to squelch it. When you start a program, there's a loud click at the audio outputs. It is related to the codec, not the speaker amps. I think it could be silenced through a different order and timing of I2C initialisation.

@TheTechnobear
Copy link
Contributor

yeah, this makes you jump if you have bela connected to a mixer, which then goes to your monitors :)
(there seems to be a much softer one when the patch stops too, you can hear it best, if you use a silent patch like 'scope')

@giuliomoro
Copy link
Contributor

diff --git a/core/I2c_Codec.cpp b/core/I2c_Codec.cpp
index 70197ed..f22b9a2 100644
--- a/core/I2c_Codec.cpp
+++ b/core/I2c_Codec.cpp
@@ -117,6 +117,7 @@ int I2c_Codec::startAudio(int dual_rate)
        if(writeRegister(0x66, 0x02))   // Clock generation control register: use MCLK, PLL N = 2
                return 1;

+       usleep(10000);
        if(writeRegister(0x33, 0x0D))   // HPLOUT output level control: output level = 0dB, not muted, powered up
                return 1;
        if(writeRegister(0x41, 0x0D))   // HPROUT output level control: output level = 0dB, not muted, powered up

This would get rid of MOST of the click at startup. There is still a quieter tick after the usleep, which seems to be the same that you get when a silent patch stops.

@apmcpherson
Copy link
Contributor Author

A quiet tick is much better than a loud pop! I'm not sure there's much that can be done about that either -- e.g. Mac laptops do the same thing when audio is turned on or off. The only alternative might be to leave the headphone amp powered up all the time, regardless of whether a program is running, but that might have other drawbacks.

@giuliomoro
Copy link
Contributor

I tried to set the headphone level to 0 and mute the DAC before powering up the HPamp, but it makes no difference: that small click is still there.

If someone wants to get rid of this, then they probably also want to use the line output instead of the headphone output.
Not sure what it sounds like from the line output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants