Aplay soft at beginning of wav file

I am trying to use the Jetson Nano’s audio through HDMI. I tried this with aplay and gstreamer, but the first part of the wav file is soft and it kinda stumbles into playing the wav file. I’ve attached the wav file

I don’t believe the issue is the wav file because it works fine on VLC Media Player on my Windows 10 laptop. It would appear to be some sort of initializing thing, because if I play the audio file again immediately, the audio plays perfectly. But then, if I wait a few seconds, the audio will be soft for the first few milliseconds.

Currently in my application, I avoid this by playing a silent wav file a little bit prior. I don’t think it’s important but I am using aplay with the call system("aplay audio/silence.wav 2> /dev/null &");. The problem still occurs if I use aplay on the command line. This is happening on two Nano setups for me.

Hello!

I have tried this with the latest L4T/Jetpack release and I was able to play the file fine from the command line using aplay. I did not observe any softness or volume differences between the start and end of the clip. Please can you try the latest release and see if the problem persists.

If the problem does persists, do you have different monitor or HDMI device that you can try to rule out the possibility it is a problem with the device connected?

Regards
Jon

So the second setup I tested is using a different monitor with a different HDMI cable. The problem also occurs in the Sound settings menu with the Test Sound option. The monitor I have with me right now has an AUX output, so I tested it with two headphones which also show me the problem.

Both of the setups are using nvidia-l4t-core 32.4.4-20201016124427. I will upgrade them to 32.4.5 and test again once the apt repository is updated.

Hi @jonathanh

I I upgraded the Jetpack version to R32.5.0-20210115145440 and I still see the issue.

Hello!

I have tried to reproduce this, but so far I have not seen any issues. I have used two different Nano and two different displays (one AOC monitor with built-in speakers and an LG TV). Are your monitors the same brand/model?

Here are some videos of what I observe on my Nano …



Regards,
Jon

The monitors are different. This link to google photos has 6 videos to show it. The first few videos are of a cheap portable monitor (no brand) we got that has a built in speaker. (The portable monitor was not able to use “Front Left”.) The other videos are on a completely different setup (different HDMI, monitor, nano, sd card, etc.) on a BenQ monitor which has a built in speaker. The sound comes out nicer, but the problem is still there.

I actually forgot to mention too that the videos on the portable monitor are still on R32.4. The ones on the BenQ monitor are R32.5.

Hi @jonathanh,

Anything else I can add to pinpoint where this problem is? No worries, if we can’t find a solution. It’s not extremely important to us.

Hello!

Apologies for the delay, I have been checking with the audio team to see what else we can try. Could you try …

  1. Adjusting period size and period count with --period_size=1024 --buffer-size=4096 option for aplay. By default it takes huge buffer size(~24k frame size)
  2. Adjusting start-delay of playback with --start-delay=500 (microsecond) to aplay arg.
  3. Try executing the following …
$ echo on | sudo tee /sys/bus/hdaudio/devices/hdaudioC0D3/power/control

Let us know if any of these make a difference.

Regards,
Jon

Thanks for getting back to me. Unfortunately, it doesn’t seem that those options are improving it. I also tried a mixture of them, but I observed no difference.

Hello!

Thanks for testing. Any chance you have a normal TV with built-in speakers that you can try with?

Jon

I tried two TVs and another monitor. The TVs are both SONY. The first one would be silent on the first call to aplay, have the issue discussed above on the second aplay, and then play properly at the third aplay. The second functioned similarly, but didn’t have as much of the silent issue. For both TVs, I tried using an external speaker system and the built-in speakers. The AGON monitor was the best, but still had the issue discussed above. It wasn’t nearly as frequent though.

I noticed a new thing on my Windows 10 laptop. While the file works fine on VLC Media Player, it consistently has the issue on the default player, Groove Music. But it does work fine on Windows Media Player.