Skip to content

Commit 6324151

Browse files
backtaildobrite
authored andcommitted
fixe codec driver issue and increase audio buffer
1 parent a8a3964 commit 6324151

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/audio.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use num_enum::IntoPrimitive;
2222

2323
// Process samples at 1000 Hz
2424
// With a circular buffer(*2) in stereo (*2)
25-
pub const BLOCK_SIZE_MAX: usize = 512;
25+
pub const BLOCK_SIZE_MAX: usize = 1024;
2626
pub const DMA_BUFFER_SIZE: usize = BLOCK_SIZE_MAX * 2 * 2;
2727

2828
pub type DmaBuffer = [u32; DMA_BUFFER_SIZE];
@@ -66,7 +66,7 @@ type DmaOutputStream = dma::Transfer<
6666
type StereoIteratorHandle = fn(StereoIterator, &mut Output);
6767

6868
#[derive(Debug, Copy, Clone, PartialEq)]
69-
struct S24(i32);
69+
pub struct S24(i32);
7070

7171
impl From<i32> for S24 {
7272
fn from(x: i32) -> S24 {
@@ -463,11 +463,11 @@ const REGISTER_CONFIG: &[(Register, u8)] = &[
463463
(Register::ROUT1V, 0x00),
464464
// set analog and digital routing
465465
(Register::APANA, 0x12),
466-
(Register::APDIGI, 0x01),
466+
(Register::APDIGI, 0x00),
467467
// configure power management
468468
(Register::PWR, 0x42),
469469
// configure digital format
470-
(Register::IFACE, 0x0A),
470+
(Register::IFACE, 0b1001),
471471
// set samplerate
472472
(Register::SRATE, 0x00),
473473
(Register::ACTIVE, 0x00),

0 commit comments

Comments
 (0)