Skip to content

Conversation

@lhenry-realtek
Copy link
Contributor

These commits aim to fix some fifo and waveform issues in the TDM driver when streaming data.

A separate PR for testing will be created, there are some important issues to address

Switch to using Left Justified WS/FS/LRCLK
Because 8CH is used there will be 2 DMA buffers combined to produce final requested bytes
So half the size of each buffer should be requested.

Also, FIFO is reset upon each transfer completion to avoid stale bytes in the FIFO that may be copied into DMA buffer
@lhenry-realtek
Copy link
Contributor Author

See #6969 for testing the waveform

Example output

=======================================================================================
ff6f ff9a 705b ffff fee1 feaf e081 ffff
ff70 ff57 f040 ffff ffff ffff ffff ffff
ff70 ff57 f040 ffff ffff ffff ffff ffff
ff6e 7f5e f023 ffff ffff ffff ffff ffff
ff6c 7f80 703b ffff ffff ffff ffff ffff
ff6a ff94 f04b ffff ffff ffff ffff ffff
ff68 7f94 f053 ffff ffff ffff ffff ffff
ff67 ff89 7049 ffff ffff ffff ffff ffff
=======================================================================================
ff69 7f7f 703a ffff fed1 fef6 e063 ffff
ff68 ff7b 7031 ffff ffff ffff ffff ffff
ff68 ff7b 7031 ffff ffff ffff ffff ffff
ff65 ff90 703c ffff ffff ffff ffff ffff
ff65 7f8d 703e ffff ffff ffff ffff ffff
ff64 ff87 7042 ffff ffff ffff ffff ffff
ff68 7f80 f03c ffff ffff ffff ffff ffff
ff6c ff7d f032 ffff ffff ffff ffff ffff
=======================================================================================
ff6d 7f7c 702f ffff fed9 ff03 e079 ffff
ff6c ff81 f03c ffff ffff ffff ffff ffff
ff6c ff81 f03c ffff ffff ffff ffff ffff
ff65 7f9a 703f ffff ffff ffff ffff ffff
ff61 7fa1 7047 ffff ffff ffff ffff ffff
ff64 7f9a f042 ffff ffff ffff ffff ffff
ff69 7f8b 703d ffff ffff ffff ffff ffff
ff6e ff7d 7034 ffff ffff ffff ffff ffff
=======================================================================================
ff71 ff77 f026 ffff fdbf fde9 c07f ffff
ff6f ff7a 701f ffff ffff ffff ffff ffff
ff6f ff7a 701f ffff ffff ffff ffff ffff
ff4f 7f9b 700f ffff ffff ffff ffff ffff
ff50 7f98 7019 ffff ffff ffff ffff ffff
ff5b 7f8a f037 ffff ffff ffff ffff ffff
ff64 ff7f 7044 ffff ffff ffff ffff ffff
ff6e ff7d f033 ffff ffff ffff ffff ffff
=======================================================================================

@lhenry-realtek
Copy link
Contributor Author

TODO:

  1. Ensure WS / BCLK / MCLK are continuous as long as sensor is active
  2. WS / BCLK / MCLK stopped only when sensor is stopped
  3. Check buffer with waveform capture, buffer can be overwritten currently

@allen-kim-sec
Copy link

@lhenry-realtek The entire schedule is up to the end of October. Therefore, BSP development must be completed by October 10th.

WCLK is kept active for entire TDM operation, it will be stopped only when I2S_PAUSE is called
@allen-kim-sec
Copy link

@lhenry-realtek How about validation tdm data ? Is DMA operation still abnormal?

@allen-kim-sec
Copy link

if .data_format = SP_DF_LEFT , ais25ba should be configed as like this.

  • TDM_CTRL_REG (0x2e) as 0x02
    . delayed : 0
    . data_valid : 0 ( Sampling timing is at the rise edge of BCLK because generate signal start at the falling edge )

Copy link

@allen-kim-sec allen-kim-sec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay only for BSP.

if .data_format = SP_DF_LEFT , ais25ba should be configed as like this.
TDM_CTRL_REG (0x2e) as 0x02
. delayed : 0
. data_valid : 0 ( Sampling timing is at the rise edge of BCLK because generate signal start at the falling edge )

@allen-kim-sec allen-kim-sec merged commit 8cda29e into Samsung:TDM Sep 26, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants