Popping sound at start and end of audio clip using headphone jack

Whenever I play any audio clip (.MP3) with the output to the headphone jack there is an audible pop heard when the playback begins and when it ends.
My setup is simple. I have a new aml-s905x-cc 2gb, I have installed Raspbian lite from the Libre site, and I installed mpg321. I do not have a monitor nor keyboard attached. Everything else about the machine is in its default state. Executing ‘mpg321 blah.mp3’ results in the popping sound at the start and end of playback. Evey MP3 file I’ve tried produces the same result.
I suspect when the audio device is initiated and closed it produces that audible pop. Is there any workaround for this?
I am new to libre and pi computers but I am a software engineer so I can dive into whatever you advise. Any help would be greatly appreciated.

There’s a GPIO handling mute on Le Potato. The pop is probably because the mute is turning off the DAC and the ground is incorrect.

Thank you for the response. How do I resolve this? Is there an adapter I can get for the headphone jack or something I can do with the GPIO pins or ground etc.?

Thanks in advance.

Please see: Libre Computer Board Composite Video Pinout

You can purchase the adapter from here: CVBS Adapter for AML-S905X-CC-V1.0A and ALL-H3-CC-H5-V1.0A/V1.1A. – LoveRPi

There’s a MUTE GPIO on the schematic to turn on and off the amplifier. You can manually toggle it to see if that affects the popping noise.

Thanks for the link. I have ordered a couple adapters. I’ll try those when they arrive.
In the meanwhile, I wanted to try the MUTE GPIO but I’m a bit stuck. If I’m reading the schematics (s905x_6l_170707_v1_0.pdf) right for the S905X, the MUTE is on GPIOH_5 described on the last page of the schematic. However, in the document describing the headers (AML-S905X-CC-V1.0A Headers) there is no mention of GPIOH_5. Is there a PIN or Jumper corresponding to GPIOH_5 or do I need to toggle it via code?

GPIO_H5 controls the amplifier. You need to modify it in code.

Hi, I just started using le potato expressly for an audio application and have run into this popping issue with the headphone output. The link here for an adapter is dead, but I’d rather deal with this issue via code, if possible. I’d like to revive this thread because I think this is a major problem that should not happen at all. How, specifically, can it be fixed?

There was a mistake. No adapter is needed.

The amplifier needs to be muted before turning it on and off. We will take a look in a bit.

1 Like

I ran into a similar problem in an Android app I was developing some time ago and the solution was using a short volume ramp from zero at beginning up to set volume and back to zero at the end. Something like 30-50 ms, if I remember correctly.

There’s the GPIOH_5 for mute control on Le Potato: Libre Computer Board Hardware Schematics Links

This should be hooked up to mute-gpios in the device tree for the DAC but it might not be.

1 Like

schematics is over my head, frankly. I’m a code guy. Are you saying this is something that will have to be handled in firmware, or is it something that can be set from linux at runtime?

Please track this GitHub issue: AML-S905X-CC DAC Output Clicks · Issue #19 · libre-computer-project/libretech-u-boot · GitHub

1 Like