Skip to content

Commit 846ee11

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
bcm2835-i2s: Reduce the TX DREQ threshold
TX FIFO overrun is thought to be the cause of channel swapping, so reducing the DREQ threshold seems reasonable and appears to be effective. See: raspberrypi#1417 Signed-off-by: Phil Elwell <[email protected]>
1 parent 224a465 commit 846ee11

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

sound/soc/bcm/bcm2835-i2s.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,22 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream,
555555

556556
/* Setup the DMA parameters */
557557
regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG,
558-
BCM2835_I2S_RXTHR(1)
559-
| BCM2835_I2S_TXTHR(1)
560-
| BCM2835_I2S_DMAEN, 0xffffffff);
558+
BCM2835_I2S_RXTHR(3)
559+
| BCM2835_I2S_TXTHR(3)
560+
| BCM2835_I2S_DMAEN,
561+
BCM2835_I2S_RXTHR(1)
562+
| BCM2835_I2S_TXTHR(1)
563+
| BCM2835_I2S_DMAEN);
561564

562565
regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_DREQ_A_REG,
563-
BCM2835_I2S_TX_PANIC(0x10)
564-
| BCM2835_I2S_RX_PANIC(0x30)
565-
| BCM2835_I2S_TX(0x30)
566-
| BCM2835_I2S_RX(0x20), 0xffffffff);
566+
BCM2835_I2S_TX_PANIC(0x7f)
567+
| BCM2835_I2S_RX_PANIC(0x7f)
568+
| BCM2835_I2S_TX(0x7f)
569+
| BCM2835_I2S_RX(0x7f),
570+
BCM2835_I2S_TX_PANIC(0x10)
571+
| BCM2835_I2S_RX_PANIC(0x30)
572+
| BCM2835_I2S_TX(0x20)
573+
| BCM2835_I2S_RX(0x20));
567574

568575
/* Clear FIFOs */
569576
bcm2835_i2s_clear_fifos(dev, true, true);

0 commit comments

Comments
 (0)