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

ASoC: SOF: ipc4-topology: Add deep buffer size to the debug message #4544

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

yongzhi1
Copy link

When deep buffer is used, print the dma size for debug.

dev_dbg(sdev->dev, "copier %s, IPC size is %d, deep buffer size %u", swidget->widget->name,
ipc_size, copier_data->gtw_cfg.dma_buffer_size);
else
dev_dbg(sdev->dev, "copier %s, IPC size is %d", swidget->widget->name, ipc_size);
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO, we can always print the dma buffer size.

Copy link
Author

Choose a reason for hiding this comment

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

Ack, I was inquired several times about how to tell the current deep buff size when experimenting different DEEPBUFFER_FW_DMA_MS.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the deepbuffer is only affecting swidget->id == snd_soc_dapm_aif_in, in other copiers and w/o DB the buffer size is 2ms worth of bytes.
The question is: what is important? The buffer size in bytes or the length in time? A printing around 1729 if deep_buffer_dma_ms is set might be enough?
Or print only for the host copiers unconditionally?

Copy link
Author

Choose a reason for hiding this comment

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

deep_buffer_dma_ms is more clear as an indicator, is the following acceptable?

unconditionally for snd_soc_dapm_aif_in:

[   93.872063] sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.1.playback, deep_buffer_dma_ms 0, dma_buffer_size 384

When deepbuf is used:

[  156.859504] sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.31.playback, deep_buffer_dma_ms 10, dma_buffer_size 1920

@yongzhi1
Copy link
Author

V2:

  • Add debug print at snd_soc_dapm_aif_in.

max((u32)SOF_IPC4_MIN_DMA_BUFFER_SIZE, deep_buffer_dma_ms) *
copier_data->base_config.ibs;
dev_dbg(sdev->dev, "copier %s, deep_buffer_dma_ms %u, dma_buffer_size %u",
swidget->widget->name, deep_buffer_dma_ms,
Copy link
Member

Choose a reason for hiding this comment

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

I would use the max((u32)SOF_IPC4_MIN_DMA_BUFFER_SIZE, deep_buffer_dma_ms) otherwise the log could be questionable with values that don't really make sense with regular ms to byte conversions.

Copy link
Author

Choose a reason for hiding this comment

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

Ack, let me update in next version, thanks for the review!!

@yongzhi1
Copy link
Author

yongzhi1 commented Aug 25, 2023

V3:

Print max((u32)SOF_IPC4_MIN_DMA_BUFFER_SIZE, deep_buffer_dma_ms) instead of deep_buffer_dma_ms:

[  217.885281] sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.1.playback, deep_buffer_dma_ms 2, dma_buffer_size 384
...
[  225.685691] sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.31.playback, deep_buffer_dma_ms 10, dma_buffer_size 1920

I am OK to print the buffer info conditionally for (deep_buffer_dma_ms > 0) case only if above looks bit verbose/confusing.

plbossart
plbossart previously approved these changes Aug 25, 2023
Print deep_buffer_dma_ms and dma_buffer_size for debug purpose.

Signed-off-by: Yong Zhi <[email protected]>
@ujfalusi ujfalusi merged commit e327169 into thesofproject:topic/sof-dev Aug 30, 2023
9 checks passed
@yongzhi1 yongzhi1 deleted the deepbuf-dma-size branch August 30, 2023 14:43
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