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

HDMI output only works on single channel on Up2 #226

Closed
plbossart opened this issue Oct 30, 2018 · 24 comments
Closed

HDMI output only works on single channel on Up2 #226

plbossart opened this issue Oct 30, 2018 · 24 comments
Assignees
Labels
APL Applies to ApolloLake platform bug Something isn't working P1 Blocker bugs or important features

Comments

@plbossart
Copy link
Member

When trying the latest kernel code (topic/sof-dev) along with sof/soft master, I only get sound on a single channel.

The mixer configuration is this (need to use pin6-port0 with cvt2)
amixer -Dhw:0 cset numid=28 1

and command line
speaker-test -Dhw:0,1 -c2 -r48000 -t sine

Adding as a kernel bug for now until it's sorted out.

@plbossart plbossart added bug Something isn't working APL Applies to ApolloLake platform labels Oct 30, 2018
@keyonjie
Copy link

this should be PGA default value issue, the volume of Left channel is set to 0 by default wrongly.

@plbossart
Copy link
Member Author

@keyonjie what do you mean? Is this a known topology issue? or a driver issue?

@cujomalainey
Copy link
Member

I noticed this in chrome is as well. I assumed it was a ucm issue

@ranj063
Copy link
Collaborator

ranj063 commented Oct 31, 2018

@cujomalainey do you still have this issue on chrome? I ran into this issue earlier but couldnt reproduce it after I used the updated ucm

@cujomalainey
Copy link
Member

I'll try and reproduce it if I have time tomorrow, I usually trigger it when I'm building the 4.18 kernel

@keyonjie
Copy link

@keyonjie what do you mean? Is this a known topology issue? or a driver issue?

I believe there is bug here, on Yorp, ucm file may hide this bug.

@plbossart
Copy link
Member Author

@mengdonglin can you please assign someone to look into this and check on the validation side? Looks like a blocking P1 to me?

@cujomalainey
Copy link
Member

@ranj063 I am unable to reproduce it currently as my patch doesn't appear to be working anymore and therefore I am getting no devices populated. It will take me some time to debug.

@mengdonglin mengdonglin added the P1 Blocker bugs or important features label Nov 2, 2018
@markyang
Copy link

markyang commented Nov 2, 2018

Summary:
This issue cannot be reproduced using the mixer configuration as follows:
pin5-port0 : cvt2
pin6-port0 : cvt3
pin7-port0 : cvt4

Test Steps:

  1. aplay -Dhw:0,2 -r 48000 -c 2 -f s16_le -i -vv ~/Music/18_WAV_48000Hz_stereo_16bit.wav

Test env:
sof master: 43da169
sof tool: 937032f
kernel sof-dev: a5ddc3d
tplg: sof-apl-pcm512x.tplg-937032f

@juimonen
Copy link

juimonen commented Nov 2, 2018

I can't play to HDMI: aplay: set_params:1363: Unable to install hw params:
Even though I try to set the pins with alsamixer (?)
kernel: a5ddc3d
sof: 43da169
tplg: sof-apl-pcm512x.tplg

@plbossart
Copy link
Member Author

plbossart commented Nov 6, 2018

I think it's a topology issue, all the HDAudio streams have the left channel muted:

numid=21,iface=MIXER,name='PGA1.0 Master Playback Volume 1'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=32,step=0
  : values=32,32
  | dBscale-min=-64.00dB,step=2.00dB,mute=1
root@ubilinux4:~# amixer -Dhw:0 cset numid=22
numid=22,iface=MIXER,name='PGA2.0 Master Playback Volume 2'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=32,step=0
  : values=0,32
  | dBscale-min=-64.00dB,step=2.00dB,mute=1
root@ubilinux4:~# amixer -Dhw:0 cset numid=23
numid=23,iface=MIXER,name='PGA3.0 Master Playback Volume 3'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=32,step=0
  : values=0,32
  | dBscale-min=-64.00dB,step=2.00dB,mute=1
root@ubilinux4:~# amixer -Dhw:0 cset numid=24
numid=24,iface=MIXER,name='PGA4.0 Master Playback Volume 4'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=32,step=0
  : values=0,32
  | dBscale-min=-64.00dB,step=2.00dB,mute=1

I absolutely didn't make this selection so it's coming from the topology or the driver. @ranj063 does this ring a bell?

@mengdonglin
Copy link
Collaborator

mengdonglin commented Nov 7, 2018

@plbossart the platform topology m4 file doesn't set the initial mixer settings for the PGA: https://github.com/thesofproject/soft/blob/master/topology/sof-apl-pcm512x.m4

And it's strange this only happens to HDMI streams, since the HDA DAI configuration m4 also doesn't set the initial value, please see: https://github.com/thesofproject/soft/blob/master/topology/m4/hda.m4

So maybe from driver side?
I tried to use the open discussion https://github.com/orgs/thesofproject/teams/sof-developers/discussions/1 to see if someone can share some tips.

@plbossart
Copy link
Member Author

@ranj063 do you happen to know the mixer defaults are defined for PGA values? I just don't get how in multiple cases the max is selected - expect for the left channel.

@juimonen
Copy link

juimonen commented Nov 7, 2018

@mengdonglin I think this is not only HDMI, I've seen this with basic codec path also and I think @plbossart reported it previously in some other issue. I'm not sure do I get it with updating the kernel, sof or the whole image... (because once you set it, alsa remembers it). I can try to hunt this down, if @ranj063 doesn't immediately know the problem spot, but it will take me some time as I have to trace the control creation path in kernel.

@lgirdwood
Copy link
Member

@juimonen also check that pusleaudio is not doping anything daft. Best to rename /usr/bin/pulseaudio to another name, delete old alsa state file then reboot to rule out userspace.

@juimonen
Copy link

juimonen commented Nov 8, 2018

@lgirdwood yep, it is not pulseaudio. This can be reproduced by renaming also alsactl. I was trying to disable it "nicely" by fiddling with systemd, but this is the easiest way. So with "first boot" all our pga volumes
are indeed 0 on the left channel (and right channel is max).

@juimonen
Copy link

juimonen commented Nov 8, 2018

actually I see this in firmware log:
0 2 unknown 74888.697917 4.166667 volume.c:387 value 0
0 2 unknown 74890.989583 2.291667 volume.c:388 value 0
0 2 unknown 74893.333333 2.343750 volume.c:387 value 1
0 2 unknown 74895.625000 2.291667 volume.c:388 value 65536

So channel 0 -> 0 volume and channel 1 -> max

@lgirdwood
Copy link
Member

@juimonen ok, looks like bug in volume.c

@juimonen
Copy link

juimonen commented Nov 8, 2018

yep, this is the set before get:

0 2 unknown 73280.885417 2.864583 volume.c:320 value 0
0 2 unknown 73283.645833 2.760417 volume.c:321 value 0
0 2 unknown 73286.562500 2.916667 volume.c:320 value 0
0 2 unknown 73289.114583 2.552083 volume.c:321 value 0

so same channel 0 is set twice to 0. channel 1 is left untouched so it has max.

@juimonen
Copy link

juimonen commented Nov 8, 2018

and that means it is coming from kernel side with ipc ... so someone is setting it to 0 but with empty data-> as a consequence only other channel is set. And that means that default pga value is max (which is correct).

@juimonen
Copy link

juimonen commented Nov 8, 2018

and it seams it is the restore of controls that sets the value incorrectly.
sorry for dumping the debug status every minute, will stop now.

@juimonen
Copy link

juimonen commented Nov 8, 2018

#258

@plbossart
Copy link
Member Author

@juimonen it's ok to share your findings live, it helps the rest of the team follow what might be happening. Thanks for looking into this!

@plbossart
Copy link
Member Author

closed with PR258

aiChaoSONG pushed a commit to aiChaoSONG/linux that referenced this issue May 6, 2021
Add RUST_LIB_SRC make argument for nix builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APL Applies to ApolloLake platform bug Something isn't working P1 Blocker bugs or important features
Projects
None yet
Development

No branches or pull requests

8 participants