Hi All,
I am seeing an issue with TDM data slot mapping in my Audio system.
in my System the IMX8 is transferring the data to Audio Card over SAI interface.
the Audio card has 8-TDM lines and 2-slots per TDM line.
i am seeing different TDM line allocation and TDM slots for the same channel when the number of channels programmed in alsa is different
when i have a 4-channel design , i set the number of channels to alsa to 4 through alsa API. In this case the TDM line number and TDM slot number are allocated like the following.
Audio Card Channel | TDM Line Number | TDM Slot Number |
0 | 0 | 0 |
1 | 1 | 0 |
2 | 0 | 1 |
3 | 1 | 1 |
In case of 16-channel design . i set the number of channels to alsa to 16 through alsa API. In this case the TDM line number and TDM slot number are allocated like the following .
Audio Card Channel | TDM Line Number | TDM Slot Number |
0 | 0 | 0 |
1 | 1 | 0 |
2 | 2 | 0 |
3 | 3 | 0 |
4 | 4 | 0 |
5 | 5 | 0 |
6 | 6 | 0 |
7 | 7 | 0 |
8 | 0 | 1 |
9 | 1 | 1 |
10 | 2 | 1 |
11 | 3 | 1 |
12 | 4 | 1 |
13 | 5 | 1 |
14 | 6 | 1 |
15 | 7 | 1 |
As you can see The TDM line Allocation for channels are different in different scenarios.
in 4-channel design
channel 2 is allocated to TDM line 0 and TDM slot-1
in 16-channel design
Channel 2 is allocated to TDM line 2 and TDM slot-0
this discrepancy is causing a problem when i dynamically change the number of channels in alsa.
i want to see the SAI driver allocation like this
CPU Card Channel | TDM Line Number | TDM Slot Number |
0 | 0 | 0 |
1 | 0 | 1 |
2 | 1 | 0 |
3 | 1 | 1 |
4 | 2 | 0 |
5 | 2 | 1 |
6 | 3 | 0 |
7 | 3 | 1 |
8 | 4 | 0 |
9 | 4 | 1 |
10 | 5 | 0 |
11 | 5 | 1 |
12 | 6 | 0 |
13 | 6 | 1 |
14 | 7 | 0 |
15 | 7 | 1 |
Could you someone suggest me how to get this allocation in the fsl_sai.c driver ?