mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
SB16: Send (sample count, less 1) to the DSP, not the number of bytes.
This worked fine when we were using 8-bit samples but broke on 16-bit.
This commit is contained in:
parent
781a28f3ed
commit
d63b6e624e
Notes:
sideshowbarker
2024-07-19 13:18:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d63b6e624e6
@ -174,14 +174,19 @@ ssize_t SB16::write(FileDescription&, const u8* data, ssize_t length)
|
||||
dma_start(length);
|
||||
|
||||
u8 command = 0x06;
|
||||
|
||||
// Send 16-bit samples.
|
||||
command |= 0xb0;
|
||||
|
||||
u16 sample_count = length / sizeof(i16);
|
||||
if (mode & (u8)SampleFormat::Stereo)
|
||||
sample_count /= 2;
|
||||
|
||||
sample_count -= 1;
|
||||
|
||||
dsp_write(command);
|
||||
dsp_write(mode);
|
||||
dsp_write((u8)length);
|
||||
dsp_write((u8)(length >> 8));
|
||||
dsp_write((u8)sample_count);
|
||||
dsp_write((u8)(sample_count >> 8));
|
||||
|
||||
enable_irq();
|
||||
wait_for_irq();
|
||||
|
Loading…
Reference in New Issue
Block a user