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

fixup! ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link format #4665

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

plbossart
Copy link
Member

Commit 7f9512a ("ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link format") assumed that the codec_ch_maps is set unconditionally.

This is however not true in the nocodec mode, the codec_ch_maps is not set for the dummy dais.

Note that this fixes
#4655 but on the second playback we still have a DSP panic. It's likely a separate issue likely tied to topology or multi-core handling.

[ 118.660171] snd_sof:sof_widget_setup_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 setup complete
[ 118.660174] snd_sof:sof_ipc4_widget_setup: sof-audio-pci-intel-lnl 0000:00:1f.3: Create widget dai-copier.SSP.NoCodec-0.playback instance 1 - pipe 2 - core 0
[ 118.660176] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx : 0x40010004|0x10056: MOD_INIT_INSTANCE [data size: 344]
[ 118.663559] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[ 118.663565] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump start ]------------
[ 118.663571] sof-audio-pci-intel-lnl 0000:00:1f.3: DSP panic!
[ 118.663573] sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[ 118.663585] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM status: 0x5, ROM error: 0x0
[ 118.663587] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM debug status: 0x0, ROM debug error: 0x0
[ 118.663592] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM feature bit enabled
[ 118.663614] snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-lnl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[ 118.663616] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump end ]------------
[ 118.663619] snd_sof:sof_set_fw_state: sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state change: 7 -> 8
[ 118.663629] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx done : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[ 119.168384] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc timed out for 0x40010004|0x10056
[ 119.168396] sof-audio-pci-intel-lnl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[ 119.168399] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump start ]------------
[ 119.168445] sof-audio-pci-intel-lnl 0000:00:1f.3: Host IPC initiator: 0xc0010004|0x10056|0x0, target: 0x1b0a0000|0x0|0x0, ctl: 0x3
[ 119.168449] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump end ]------------
[ 119.168452] sof-audio-pci-intel-lnl 0000:00:1f.3: IPC timeout
[ 119.168476] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to create module dai-copier.SSP.NoCodec-0.playback
[ 119.168490] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 freed
[ 119.168493] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.2.1 freed
[ 119.168498] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx : 0x12010000|0x0: GLB_DELETE_PIPELINE
[ 119.168605] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12010000|0x0 failed: -19
[ 119.168609] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.2
[ 119.168613] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget mixin.1.1 freed
[ 119.168616] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.1.1 freed
[ 119.168620] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx : 0x12000000|0x0: GLB_DELETE_PIPELINE
[ 119.168622] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12000000|0x0 failed: -19
[ 119.168625] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.1
[ 119.168627] sof-audio-pci-intel-lnl 0000:00:1f.3: Failed to set up connected widgets
[ 119.168634] sof-audio-pci-intel-lnl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 0
[ 119.168637] sof-audio-pci-intel-lnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -110
[ 119.168663] Port0: ASoC: error at __soc_pcm_hw_params on Port0: -110
[ 119.168695] Port0: ASoC: error at dpcm_fe_dai_hw_params on Port0: -110

Commit 7f9512a ("ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link format")
assumed that the codec_ch_maps is set unconditionally.

This is however not true in the nocodec mode, the codec_ch_maps is not
set for the dummy dais.

Note that this fixes
thesofproject#4655 but on the second
playback we still have a DSP panic. It's likely a separate issue
likely tied to topology or multi-core handling.

[  118.660171] snd_sof:sof_widget_setup_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 setup complete
[  118.660174] snd_sof:sof_ipc4_widget_setup: sof-audio-pci-intel-lnl 0000:00:1f.3: Create widget dai-copier.SSP.NoCodec-0.playback instance 1 - pipe 2 - core 0
[  118.660176] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x40010004|0x10056: MOD_INIT_INSTANCE [data size: 344]
[  118.663559] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx      : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[  118.663565] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump start ]------------
[  118.663571] sof-audio-pci-intel-lnl 0000:00:1f.3: DSP panic!
[  118.663573] sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[  118.663585] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM status: 0x5, ROM error: 0x0
[  118.663587] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM debug status: 0x0, ROM debug error: 0x0
[  118.663592] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM feature bit enabled
[  118.663614] snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-lnl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[  118.663616] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump end ]------------
[  118.663619] snd_sof:sof_set_fw_state: sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state change: 7 -> 8
[  118.663629] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx done : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[  119.168384] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc timed out for 0x40010004|0x10056
[  119.168396] sof-audio-pci-intel-lnl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[  119.168399] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump start ]------------
[  119.168445] sof-audio-pci-intel-lnl 0000:00:1f.3: Host IPC initiator: 0xc0010004|0x10056|0x0, target: 0x1b0a0000|0x0|0x0, ctl: 0x3
[  119.168449] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump end ]------------
[  119.168452] sof-audio-pci-intel-lnl 0000:00:1f.3: IPC timeout
[  119.168476] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to create module dai-copier.SSP.NoCodec-0.playback
[  119.168490] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 freed
[  119.168493] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.2.1 freed
[  119.168498] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x12010000|0x0: GLB_DELETE_PIPELINE
[  119.168605] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12010000|0x0 failed: -19
[  119.168609] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.2
[  119.168613] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget mixin.1.1 freed
[  119.168616] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.1.1 freed
[  119.168620] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x12000000|0x0: GLB_DELETE_PIPELINE
[  119.168622] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12000000|0x0 failed: -19
[  119.168625] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.1
[  119.168627] sof-audio-pci-intel-lnl 0000:00:1f.3: Failed to set up connected widgets
[  119.168634] sof-audio-pci-intel-lnl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 0
[  119.168637] sof-audio-pci-intel-lnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -110
[  119.168663]  Port0: ASoC: error at __soc_pcm_hw_params on Port0: -110
[  119.168695]  Port0: ASoC: error at dpcm_fe_dai_hw_params on Port0: -110

Signed-off-by: Pierre-Louis Bossart <[email protected]>
ch_mask |= rtd->dai_link->codec_ch_maps[codec_dai_id].ch_mask;
}
if (ch_mask)
num_channels = hweight_long(ch_mask);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new check really needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't really matter, all this code will have to be redone with the changes from Moritomo-san. See #4632


num_channels = hweight_long(ch_mask);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better convey the logic and line 251 and 257-258 can be dropped, and leave the ch_mask initialized at declaration (line 263 can be dropped)?

if (ch_mask)
	num_channels = hweight_long(ch_mask);
else
	num_channels = params_channels(params);

@keqiaozhang
Copy link
Collaborator

Confirmed that this PR can fix #4655. Inner test ID:33777.
I also reproduced the DSP panic, but not on the second playback or capture.
It happened when checking check-capture-100times.sh, failed on the 94th attempt.

@plbossart plbossart merged commit 7ee6471 into thesofproject:topic/sof-dev Oct 27, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants