Skip to content

Add second I2S output #16

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DGHC
Copy link

@DGHC DGHC commented Sep 26, 2022

Hi, please forgive me if I've gone about this the wrong way - I've never done a pull request before.

I needed to use the 2nd I2S output with the F32 library, and noticed this hasn't been implemented yet. I've made the changes based on a review of the 1st and 2nd I2S output files in the main Teensy library.

I've tested on a Teensy 4.0 with AudioSynthWaveformSine_F32 as a source and AudioOutputI2S2_F32 as an output and it works. I haven't tested the slave code yet.

Thanks for all your work creating this float library in the first place - it's brilliant.

@boblark
Copy link
Collaborator

boblark commented Sep 28, 2022

Hi - First, thanks for making this library class available. This helps the whole community.
I have no experience with using more than a single L-R output. As I understand this, it is the same as AudioOutputI2S_F32 but using the second I2S hardware port. Is this T4 only? I guess we need to indicate hardware connections on the Design Tool? Also, is your test case in shape that we could include it with the examples? Again, thanks, Bob Larkin

@DGHC
Copy link
Author

DGHC commented Sep 28, 2022

You're very welcome. I'm very far from an expert (Python is my main thing), but it's very nice to be at a point where I can contribute something - I've benefitted greatly from communities like this over the years.

You're right - it is T4 only (as per the 2nd I2S output in the main library). I used the difference between I2S files in the first library as a guide for what needed changing. The second I2S output uses pins 2 (OUT), 3 (LRCLK) and 4 (BCLK).

I don't know how you indicate hardware connections for the Design Tool - happy to help with that if you can point me in the direction of some guidance.

I don't have a test case, but it shouldn't be hard to set that up and push an example. Let me get that together and submit...

@DGHC
Copy link
Author

DGHC commented Sep 28, 2022

OK, just pushed the example. I've seen that I must have committed something to the wrong branch - the commit called 'AudioMerge basic framework - not working yet'. Please ignore that as it's not working (as the name suggests!). If you look at that, you'll see what I'm trying to do, which is transmit 4 channels over I2S stereo, by combining two 16bit samples into a single 32 bit sample, then do that twice and get 4 channels worth of data. I'll have to unpack it the other end, but that fine. You may see I've made a comment in the "Floating-Point Audio Library Extension" thread in the PJRC forum as I'm stuck at the moment - any wisdom is always greatly received!

@boblark
Copy link
Collaborator

boblark commented Sep 28, 2022

Hi Dave - Thanks for the clarification on the usage.

I will take care of the entry for the design tool. It takes a bit of learning, and I have been down that path enough times to make it easier. I will include your pins and the T4.x restriction there. Also some comments on the usage.

The example is good, and again, if you want I can use your INO and put it into the examples directory. As far as the content, one thought is that to better illustrate what is going on, you might add a couple more generators and a regular I2S1 with all four at different frequencies? Or something of that sort.

I will hopefully get a chance tomorrow to look more at the2x16-bit packing. Bob

Oh, also, Github, as best as I can see, does not support running web pages directly. So, I have plenty of room at janbob.com and have put the web page there:
http://www.janbob.com/electron/OpenAudio_Design_Tool/index.html
I have a script that syncs the github info as well as the zip file for offline operation so that I only need to make changes one place. But it means that pull requests on the github version are not needed nor responded to directly.

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