I figured out the problem.
I had to change the function SAI_TransferReceiveLoopEDMA() a little, called it SAI_TransferReceiveLoopEDMASetuped().
If someone encounters a similar problem, I am attaching a file with the source code of the modified function and its application.