RPi 5 quad-lane I2S #453
Replies: 5 comments 7 replies
-
It's on my TODO list now. Should be able to test this with a single PCM5102A
by switching the data input to the different GPIOs. Yes, I assume the clock
signals are shared.
|
Beta Was this translation helpful? Give feedback.
-
The quad-lane I2S support is on the develop branch. You can test it using test/sound-controller after applying this small patch:
Enter in the test shell:
CHAN is the channel number (1 .. 8). This will play a sinus tone of the given frequency on the given channel. Enter |
Beta Was this translation helpful? Give feedback.
-
Yes, only the selected channel is affected. I went fore and back now between
channel 1/2 (GPIO21) and channel 3/4 (GPIO23).
|
Beta Was this translation helpful? Give feedback.
-
I have a branch of MiniDexed that supports this now: https://github.com/diyelectromusic/MiniDexed/commits/QuadDAC8Chan/ @rsta2 I wondered if you'd take a look at the changes and see if you think they are correct. One thing I wasn't sure about is the chunksize and number of queue frames. The one I wasn't sure about is https://github.com/diyelectromusic/MiniDexed/blob/main/src/minidexed.cpp#L254 which seems to equate chunk size with number of queue frames... I wondered if this should be GetChunkSize () / 2 here too, and should therefore be updated to be GetChunkSize () / 8 if supporting 8 channels rather than 2. The default chunk size is 256 for RPi > 2, so I've upped that to 1024 for 8-channels. Grateful for any thoughts or comments :) Thanks again, |
Beta Was this translation helpful? Give feedback.
-
@diyelectromusic What I have seen quickly so far looks good.
But the number of allocated frames for the sound queue should be:
chunk_size * 2 / channels
The reason is, that there are two cyclic DMA buffers of chunk size managed by
the hardware sound drivers. When one buffer is filled by the sound rendering
process, the other is sent out by the driver. So there must be twice the buffer
space available in the sound queue, so that the hardware driver can copy half
the queue size into the next DMA buffer in a row, when the previous one has
been sent out and there is still room in the queue for the sound rendering
process to be filled.
The queue size is given in frames. One frame consist of 2 or 8 samples
(== number of hardware channels).
A default chunk size of 1024 for 8 channels should be OK.
Rene
|
Beta Was this translation helpful? Give feedback.
-
Apparently the RPi 5 supports 4 lanes of I2S output. Would it be possible to expand the I2S support from 2 channels to 8?
The hifiberry-dac8x-overlay.dts appears to show how this could work for a quad-PCM5102A configuration.
It appears to share the clock signals, and then have independent data pins, but I must admit that part isn't totally clear to me.
Kevin
Beta Was this translation helpful? Give feedback.
All reactions