Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 8 channel I2S mono audio output on RPi 5 #657

Merged
merged 5 commits into from
Jun 29, 2024

Conversation

diyelectromusic
Copy link
Collaborator

Support for 8 channel mono audio output - one per Tone Generator - on a Raspberry Pi 5 only. This uses the four I2S lanes of the Raspberry Pi and can be configuring by adding
QuadDAC8Chan=1
to minidexed.ini.

It will be off by default.

Note: if enabled, then pan and effects are ignored and each TG will just have a direct output to one of the four stereo outputs as follows:
TG 0 = I2S module 1 L
TG 1 = I2S module 1 R
TG 2 = I2S module 2 L
...
TG 8 = I2S module 4 R

I2S modules will share LCK/BCK but the four DIN lines will need to be connected to GPIO 21, 23, 25, 27.

Requires the latest circle develop branch.

See discussions here: #655 and rsta2/circle#453

This should support the HiFiBerry DAC8X board (untested) or four GY-PCM5102 modules (tested) as described here: https://diyelectromusic.wordpress.com/2024/05/27/rpi-5-quad-stereo-sound-with-pcm5102a/

As always, this needs testing with more normal configurations to make sure nothing has been broken with sound output across all Pi versions with I2S.

Post reply below if you test it and with what configuration :)

Kevin

@diyelectromusic
Copy link
Collaborator Author

Build for testing here:
MiniDexed_2024-05-28-ad61b48

@probonopd
Copy link
Owner

probonopd commented May 30, 2024

Wow, that's quite the advanced configuration. Way over my head, as this practically requires a 8-channel mixer or 8-channel audio interface, but I guess it's great for people working in a "real studio" 👍

What is the technical reason that this is only an option for RPi 5?

Edit: Found the answer in #655 (reply in thread)

Only the Pi 5 supports four I2S lanes via the new RP1 chip, so no, this is not possible on the Pi 4 in hardware (there might be software workarounds for another virtual I2S interface, but that is a major piece of bespoke work so really not worth the effort).

Should mention that in a source code comment and in the documentation.

Since I have no way to test, simply let me know when you think it should be merged. Thanks!

@diyelectromusic
Copy link
Collaborator Author

Yes, I haven't made the RPi 5 thing explicit in comments as it could be argued its the same as we don't write out the specification for other Pi hardware features in code (we don't explicitly talk about how only the Pi 1 is not multicore for example, or the Zero has no PWM interface by default, etc). I'd hope that anyone rebuilding the source and messing around with features down at the driver level like this would know the capabilities of the device they are building for :)

I'll make sure our wiki talks about it properly though.

In terms of testing, I need some people to test their own "normal" configurations to make sure the audio channels are correct and if someone could actually test it on a dac8x when they finally turn up that would be great!

I haven't done it yet, but I'll do my usual testing on the range of Pis I have at some point.

Kevin

@diyelectromusic
Copy link
Collaborator Author

OK, so I've tested with my own normal configurations for Pi V1, Pi Zero, Pi 3A+ and Pi 4 and all seems ok to me.

Kevin

@probonopd
Copy link
Owner

Let's get this merged before main deviates too much.

@diyelectromusic
Copy link
Collaborator Author

If you fancy merging this in at some point, I might start to look more closely at the polyphony/TG questions :)

Kevin

@probonopd
Copy link
Owner

Hi @diyelectromusic, currently I have no way of testing this, but if you are confident that this doesn't break anything and doesn't complicate the code too much then I'd merge it as-is.

@diyelectromusic
Copy link
Collaborator Author

Well I'd say if you test it with your own (non-quad) configuration as a double check and find its fine that confirms my findings and we'd be good to go.

But as I say, I've tried it with all the other configs/Pis I have access to and I think it's fine.

Kevin

@probonopd probonopd merged commit 98b5274 into probonopd:main Jun 29, 2024
1 check passed
@probonopd
Copy link
Owner

Thanks @diyelectromusic.

I'll make sure our wiki talks about it properly though.

Please go ahead. Thank you!

@diyelectromusic
Copy link
Collaborator Author

Option now added to the wiki.

@probonopd
Copy link
Owner

Maybe you'd also like to link to https://diyelectromusic.com/2024/06/09/minidexed-quad-dac-pcb-design/ if you like.

@diyelectromusic
Copy link
Collaborator Author

I've linked to the previous post as it was informational. I (as a rule) try not to link to actual project pages from our official documentation :)

@diyelectromusic diyelectromusic deleted the QuadDAC8Chan branch July 10, 2024 18:43
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