mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
Kernel: Allow setting AC'97 sample rate during playback
The Qemu AC'97 device stops its PCM channel's DMA engine when it is running and the sample rate is changed. We now make sure the DMA engine is restarted after changing the sample rate, allowing you to e.g. run `asctl set r 22050` during `aplay` playback.
This commit is contained in:
parent
e2891e9aa4
commit
8bf0e04c16
1 changed files with 4 additions and 0 deletions
|
@ -145,6 +145,10 @@ ErrorOr<void> AC97::set_pcm_output_sample_rate(u32 sample_rate)
|
|||
|
||||
dbgln("AC97 @ {}: PCM front DAC rate set to {} Hz", pci_address(), m_sample_rate);
|
||||
|
||||
// Setting the sample rate stops a running DMA engine, so restart it
|
||||
if (m_pcm_out_channel.dma_running())
|
||||
m_pcm_out_channel.start_dma();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue