Skip to content

ASoC: SOF: Use high-priority workqueue for PCM period elapsed#5781

Open
poloo5582 wants to merge 1 commit into
thesofproject:topic/sof-devfrom
poloo5582:priority
Open

ASoC: SOF: Use high-priority workqueue for PCM period elapsed#5781
poloo5582 wants to merge 1 commit into
thesofproject:topic/sof-devfrom
poloo5582:priority

Conversation

@poloo5582
Copy link
Copy Markdown

The snd_sof_pcm_period_elapsed function currently schedules work on the system-wide workqueue. This can lead to potential delays or jitter in audio processing if the system workqueue is busy with other tasks.

To improve real-time performance and ensure timely processing of PCM periods, create a dedicated high-priority, unbound workqueue ("sof_pcm_wq") specifically for this purpose.

Update the period elapsed handling to queue work onto this new workqueue, while maintaining a fallback to the system workqueue if the dedicated one is not initialized.

The snd_sof_pcm_period_elapsed function currently schedules work on the
system-wide workqueue. This can lead to potential delays or jitter in
audio processing if the system workqueue is busy with other tasks.

To improve real-time performance and ensure timely processing of PCM
periods, create a dedicated high-priority, unbound workqueue
("sof_pcm_wq") specifically for this purpose.

Update the period elapsed handling to queue work onto this new
workqueue, while maintaining a fallback to the system workqueue if the
dedicated one is not initialized.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@google.com>
Comment thread sound/soc/sof/core.c
mutex_init(&sdev->dsp_fw_boot_mutex);

/* Create high-priority workqueue for PCM period elapsed work */
sdev->pcm_period_wq = alloc_workqueue("sof_pcm_wq", WQ_HIGHPRI | WQ_UNBOUND, 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you describe how this can happen?
If the system workqueue is that much congested then how can anything work?

We use threaded irq as well and that is also using system queue afaik, I'm not sure how this helps.

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.

2 participants