Only left channel can play sound in the "Video" APP

We use es8316 as board sound card.
I asked a question before ,and it works fine now.

But I find a question:
when I use command to play music ,left and right channel all normal:

aplay -D hw:es8316tegra,0 1.wav

when I play music in the “Video” or other APP in the desktop,
only Left channel can play sound.

what is the matter with it?

Hi,

Have a few questions.

  1. Are you playing the same file through Video app and aplay?

  2. Are you make same mixer settings in both the cases?

Also, provide o/p of following commands when playback is going on via app and via aplay

cat /proc/asound/card1/pcm0c/sub0/hw_params
cat /proc/asound/card1/pcm0c/sub0/sw_params

Do attach the wav fie for inspecting

Thanks

Here is the music file

Yes, the same file.

I didn’t have “mixer change” operation when I try both test.

When playback is going on via app and via aplay ,Both two command result are “closed”.

Hi,

Apologies, there was a typo earlier. Require o/p of below comands

cat /proc/asound/card1/pcm0p/sub0/hw_params
cat /proc/asound/card1/pcm0p/sub0/sw_params

I didn’t have “mixer change” operation when I try both test.

Oh you mean mixer settings are part of 00-tegra.conf?
If so, during aplay and app playback, share o/p of amixer -c 1 contents

Thanks

Hi, atalambedu,

yes,I have config the mixer in the tergra.config
00-tegra.conf (6.3 KB)

when I paly music with aplay:

root@tegra-ubuntu:/home/linux/Music#                                           s
access: RW_INTERLEAVEDe/linux/Music# cat /proc/asound/card1/pcm0p/sub0/hw_params 
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 2048
buffer_size: 8192                                                              s
tstamp_mode: NONE:/home/linux/Music# cat /proc/asound/card1/pcm0p/sub0/sw_params 
period_step: 1
avail_min: 2048
start_threshold: 8192
stop_threshold: 8192
silence_threshold: 0
silence_size: 0
boundary: 4611686018427387904

when I play music with video:

access: MMAP_INTERLEAVEDlinux/Music# cat /proc/asound/card1/pcm0p/sub0/hw_params 
format: S16_LE
subformat: STD
channels: 1
rate: 44100 (44100/1)
period_size: 8192
buffer_size: 16384                                                             s
tstamp_mode: ENABLEhome/linux/Music# cat /proc/asound/card1/pcm0p/sub0/sw_params 
period_step: 1
avail_min: 14621
start_threshold: 18446744073709551615
stop_threshold: 4611686018427387904
silence_threshold: 0
silence_size: 0
boundary: 4611686018427387904

I found the parameters are different between both.
And here is my result of command.
settings.txt (293.1 KB)

amixer -c 1 contents > contents.txt

Hi,

Thanks for the data. I see that the waveform is stereo

Looks like the app is asking for mono playback which is why the drivers are set for mono playback as indicated by the hw_params. Could you try playback with some other app like youtube so that we can rule out if its an app specific issue

Thanks

I try “Chromlum Web Browser” APP and play music online,
but only Left channel can play sound.

linux@tegra-ubuntu:~/Music$ cat /proc/asound/card1/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 1
rate: 44100 (44100/1)
period_size: 8192
buffer_size: 16384
linux@tegra-ubuntu:~/Music$ 
linux@tegra-ubuntu:~/Music$ cat /proc/asound/card1/pcm0p/sub0/sw_params
tstamp_mode: ENABLE
period_step: 1
avail_min: 15802
start_threshold: 18446744073709551615
stop_threshold: 4611686018427387904
silence_threshold: 0
silence_size: 0
boundary: 4611686018427387904

Hi,

Looks like some userspace config is forcing the playback to be mono and that needs to be corrected.

Could you share /etc/pulse/default.pa at your end and output of pacmd list-sinks.

You could remap the sink to behave as stereo instead of mono by playing with pulseaudio config.
PulseAudio/Examples - ArchWiki has the pulse audio to config the playback to be mono in place of stereo while you want stereo instead of mono. Please explore the reference to come up with desired setting and see if this helps

Thanks

Thank you for reply, this is my default.pa
default.pa (5.2 KB)

L will try it soon.

Hi,
can u give me some suggestion?
I have try something told by this link but it seems not effective.

Hi,

Please note that userspace level support does not come under our scope as its generic to all ubuntu systems and not specifc to Jetson. However, I will see if i can offer any suggestion.

Could you share the remapping change the you tried in pulse audio config and also o/p of command “pacmd list-sinks”

Thanks

Hi,
when I run commadn “pacmd list-sinks” :

root@tegra-ubuntu:~# pacmd list-sinks
No PulseAudio daemon running, or not running as session daemon.

What’s more , I use L4T 32.7.3 SDK, and rootfs is nvidia sample system,
I didin’t change anything , have your other clients encountered the same situation?

Hi,

So looks like pulseaudio is not being used at all. Not sure what is causing the issue. Issue is not at kernel level as aplay is fine, it understands the wav header and initiates stereo playback. So issue is above kernel level and I expect it to be some userspace setting.

While you explore the usersapce issue, I could help provide a workaround. Use below commands as a WAR to get stereo playback and see if it helps

amixer -c 1 cset name="I2S<i> Playback Mono To Stereo" "Copy"
amixer -c 1 cset name="I2S<i> Playback Audio Channels" 2

Replace <i> with relevant number used

Thanks

Hi, atalabedu,
I try these command,

amixer -c es8316tegra cset name="I2S5 Playback Mono To Stereo" "Copy"
amixer -c es8316tegra cset name="I2S5 Playback Audio Channels" 2

but failed

amixer: Cannot find the given element from control hw:1

HI,

Are you using JP 4.x version then you may have to use below instead. Above info was for JP 5.x version

amixer -c 1 cset name="I2S<i> Playback Mono To Stereo Conv" "COPY"
amixer -c 1 cset name="I2S<i> Channels" 2

Reference: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3271/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.19.2.html#wwpID0E0UHB0HA

Thanks

Hi,
I’m using JP 4.6.3.

And this command failed again with the same error:

amixer -c es8316tegra cset name="I2S5 Playback Mono To Stereo Conv" "COPY"

This command ok

root@tegra-ubuntu:/# amixer -c es8316tegra cset name="I2S5 Channels" 2
numid=922,iface=MIXER,name='I2S5 Channels'
  ; type=INTEGER,access=rw------,values=1,min=0,max=16,step=0
  : values=2

But only left channel can play sound.

Hi,

Apologies as I dont have older setup (JP 4.x). I referred the documentation for the possible values for mixer settings. In documentation, the values seem to be case insensitive

Try amixer -c es8316tegra cset name=“I2S5 Playback Mono To Stereo Conv” “Copy” instead.

If this does not help, please share o/p of amixer -c 1 contents

Thanks

Hi,atalambedu,
I check my contents and find this:

numid=925,iface=MIXER,name='I2S5 Capture mono to stereo conv'
numid=924,iface=MIXER,name='I2S5 Capture stereo to mono conv'
numid=927,iface=MIXER,name='I2S5 Playback mono to stereo conv'
numid=926,iface=MIXER,name='I2S5 Playback stereo to mono conv'

So I try this and two channel can play sound at the same time now.

root@tegra-ubuntu:/#amixer -c es8316tegra cset name="I2S5 Playback mono to stereo conv" "COPY"
numid=927,iface=MIXER,name='I2S5 Playback mono to stereo conv'
  ; type=ENUMERATED,access=rw------,values=1,items=3
  ; Item #0 'None'
  ; Item #1 'ZERO'
  ; Item #2 'COPY'
  : values=2
root@tegra-ubuntu:/#

Thank for you help!

Let me know if no other issues on this post.

Thanks

There is no other issues on this post.
Extremely thank you!