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
drivers: dma: intel-adsp-hda: Correct DGCS:SCS bit for 32bit sample size #63784
drivers: dma: intel-adsp-hda: Correct DGCS:SCS bit for 32bit sample size #63784
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent find @ujfalusi !
This fixes SOF bug tracked as thesofproject/sof#8236
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense.
@ujfalusi I have silly question. The last normal playback is still 16bit, why it results garbled audio? Or does chain DMA uses 16bit container, and normal playback use 32bit container with 16bit valid? |
Yes, that is correct: |
Changes since v1:
|
50b473e
a3cb662
to
50b473e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The host side is fine, the link has a change that's not very clear @ujfalusi
drivers/dma/dma_intel_adsp_hda.c
Outdated
*DGCS(cfg->base, cfg->regblock_size, channel) |= DGCS_SCS; | ||
} else { | ||
*DGCS(cfg->base, cfg->regblock_size, channel) &= ~DGCS_SCS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one changes the behavior if res != 0, is this intentional @ujfalusi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I have missed that, sorry I will update as soon as I can.
drivers/dma/dma_intel_adsp_hda.c
Outdated
*DGCS(cfg->base, cfg->regblock_size, channel) |= DGCS_SCS; | ||
} else { | ||
*DGCS(cfg->base, cfg->regblock_size, channel) &= ~DGCS_SCS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, change with res!=0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed the ret != 0 drop that @plbossart found while looking at this on my phone screen. This does need fixing before this should be merged, so marked -1
59600b2
50b473e
to
59600b2
Compare
Changes since v2:
|
One more try, sorry, I missed something else |
59600b2
to
b9a3498
Compare
Changes since v3:
|
b9a3498
to
d37c057
Compare
If the channel was used for 16bit in the once, subsequent 32bit sample size audio will be broken since the SCS bit remains set. Example sequence with SOF: normal audio playback with 16bit ChainDMA audio playback with 16bit normal audio playback with 16bit The last playback results garbled audio. Introduce intel_adsp_hda_set_sample_container_size() helper function to handle the SCS bit and use it in the driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Changes since v4:
|
*DGCS(base, regblock_size, sid) |= DGCS_SCS; | ||
} else { | ||
*DGCS(base, regblock_size, sid) &= ~DGCS_SCS; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need braces for the if/else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 yes, this is actually required in Zephyr
If the channel was used for 16bit in the once, subsequent 32bit sample size audio will be broken since the SCS bit remains set.
Example sequence with SOF:
normal audio playback with 16bit
ChainDMA audio playback with 16bit
normal audio playback with 16bit
The last playback results garbled audio.
Introduce intel_adsp_hda_set_sample_container_size() helper function to handle the SCS bit and use it in the driver.