thesofproject / avs-topology-xml

Configuration files for Intel AudioVoiceSpeech (AVS) driver
Apache License 2.0
3 stars 1 forks source link

Revisiting HP G1 13 audio (Chell) - Was Issue 17 #23

Closed paulhart closed 11 months ago

paulhart commented 11 months ago

Hi, I'm (finally) back - I previously created https://github.com/thesofproject/avs-topology-xml/issues/17 but didn't follow through at the time - I relied instead on bluetooth audio.

I've just attempted the (very detailed - thank you) steps indicated in that issue but it doesn't seem to have moved the needle too much (or I'm missing a final step - I'm very much a newbie at these things).

When running alsatlpg I received warnings on both executions - please see alsatplg.log for details of the warnings (there were no warning when running avstlpg). I cloned the main branch of this repo earlier today.

Here are the various files that are requested per the gist posted many moons ago:

Thanks again for helping us to resolve these issues!

crojewsk commented 11 months ago

Hello,

The warnings present alsatplg.log are to be expected - the parser is not aware of what's there "on the other side" - the kernel side. When utilizing dynamic FE approach, the graphs which are part of the topology file, are incomplete. They are completed later on, by the sound driver during sound card enumeration procedure. So, all green there.

From the dmesg it looks like snd_soc_skl driver has been booted rather than snd_soc_avs one. Please check your /etc/modules.d/ and ensure the following is part of a configuration file: options snd_intel_dspcfg dsp_driver=4.

paulhart commented 11 months ago

Wow, that was a simple fix!

I'm now getting sound (yay!) when using headphones but not the internal speakers... either those have blown or something else isn't quite right at the moment. Honestly, the fact that I can get anything to play is a huge win - thank you!

crojewsk-intel commented 11 months ago

Could you post dmesg from speaker-only scenario and a separate one for headphones-only scenario? Make you your /etc/modules.d/ contains:

options snd_hda_core dyndbg==pmf
options snd_hda_codec dyndbg==pmf
options snd_soc_core dyndbg==pmf
options snd_soc_avs dyndbg==pmf
paulhart commented 11 months ago

Please see attached. Filenames indicate whether audio should route through speakers or headphones at boot. dmesg-20231122-speakers.txt dmesg-20231122-headphones.txt

I also notice that there's a "pop" in the headphones just before audio starts playing.

crojewsk-intel commented 11 months ago

Thank you for the logs. There are no errors there, which is good and somewhat bad. If there's a problem, I'd rather see it fail big so it's easier to debug : )

The headphones log contains only boot up sequence and is of no use to us. But the speakers log holds a lot of information. From the lines:

[   20.364252] snd_soc_core:dpcm_be_dai_trigger:  SSP0-Codec: ASoC: trigger BE SSP0-Codec cmd 1
(...)
[   25.573382] snd_soc_core:dpcm_be_dai_trigger:  SSP0-Codec: ASoC: trigger BE SSP0-Codec cmd 0

one can see that we have had speaker working there even if for a brief moment (~5sec). cmd 1 means: START while cmd 0 translated to command STOP. Perhaps it would be easier to understand nature of the problem if we enlist alsa-utils instead of a service. Could you try playing via aplay, e.g.:

aplay -Dhw:<CID>,<DID> -c2 -r48000 -fS24_LE -vv /dev/urandom

Replace <CID> and <DID> with your card ID and the speaker device ID respectively.

paulhart commented 11 months ago

Sound! Had to change the command to use -fS16_LE because of reasons, but it made sound!

[paulhart@lustrous ~]$ aplay -Dhw:4,1 -c2 -r48000 -fS16_LE -vv /dev/urandom
Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Hardware PCM card 4 'avs_ssm4567-adi' device 1 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 24000
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000
  appl_ptr     : 0
  hw_ptr       : 0
##################################################+| 99%^C
Aborted by signal Interrupt...
##################################################+| 99%

Here is the list of devices:

[paulhart@lustrous ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: hdaudioB0D2 [hdaudioB0D2], device 1: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: hdaudioB0D2 [hdaudioB0D2], device 2: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: hdaudioB0D2 [hdaudioB0D2], device 3: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: avsnau8825 [avs_nau8825], device 1: Headset (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: avsssm4567adi [avs_ssm4567-adi], device 1: Built-in Speakers (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
paulhart commented 11 months ago

So, the issue was that the default was set to "Built-in Audio Analog Stereo" rather than "Built-in Audio Speaker". Making that change has resolved the speaker issue.

Thank you!