Sound click

Recommended Posts

Good day,


We use NanoPi Neo Core in voice information systems.

We found a problem with the implementation of Dynamic Audio Power Management for Portable Devices in H3.

Our program plays voice files using the standard call of the operating system - "aplay".

Before starting the reproduction of each file the voltage is discharged and restored at the output of the DAC.

This leads to a loud click on the output of the audio system.

Setting pmdown_time = -1 does not save the situation.

Can you help in solving this problem?

 P.S. This problem appeared in version 4 of the kernel.

Share this post

Link to post
Share on other sites
29 minutes ago, guidol said:

where did you put pmdown_time in?


I did only found this information:

Put the following line at the end of /boot/cmdline.txt


at https://support.hifiberry.com/hc/en-us/community/posts/201847631-Disabling-auto-shutdown-output-has-no-effect-anymore

I try this way

echo -1> /sys/devices/platform/soc/1c22c00.codec/cdc/pmdown_time 

It works.
But when the playback is initialized, there is a reset and restoration of voltage at the processor's audio output. We saw this on an oscilloscope.


Share this post

Link to post
Share on other sites

I want to clarify the essence of the problem.
If the audio subsystem is turned off, the output potential is zero potential.
In working condition, a voltage of about 2 volts is set at the output of the audio subsystem, which corresponds to a zero level of the output audio signal.
If you install /sys/devices/platform/soc/1c22c00.codec/cdc/pmdown_time
a value of -1, then after the playback of the file is finished, the output voltage is stored corresponding to the zero level of the output audio signal.
But when playing a new file, the audio subsystem is completely reset.
First, the zero potential is set at the output.
And then the voltage of 2 volts is restored, corresponding to the zero level of the output audio signal.
The duration of such an impulse is short, but a click is clearly audible on the speakers.

Share this post

Link to post
Share on other sites

Did you manage to find solution?

I have the same problem with Orange PI PC, 3.5 output jack.


In the fresh install of Buster server/4.19/2019-07-15, play any wav file with aplay.


There are no problems with sound playback on Xenial 3.4.
There are same problems with latest kernel (5.3)


There are two separate problems:
1) It tooks about 1.5 seconds for analog codec to wake from power down. 
First 1.5 seconds of sound is not played, there is clicking sound instead.
There is a click after 5 seconds of playback (power down).
2) There are noticeable clicks at the start and stop of playback.

(1) can be solved with: 
echo -1> /sys/devices/platform/soc/1c22c00.codec/cdc/pmdown_time
(thanks for sharing it!)


(2) is caused by audio driver which sets PWM output to zero while preparing playback and after playback.
It should let it running ar 50% ratio instead.


The only way to play click-free sounds messages OPI currently is using dmix:
and pushing silent data constantly, like some people did on rapsberry PI
before similar issue was fixed: https://github.com/raspberrypi/linux/issues/128

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.