Shematic for Teensy 4.1 compatible Pt8211-Kit?

KurtE,
It is already working fine, provided that I specify Serial* under USB Type. Isn't that what you're wanting me to test after removing the FLASHMEM? I need Serial + MIDIx4 for my project, anyway.
Am I trying to fix something that's not broken or trying to break it to see if it fails?

Just read Paul's post. I'll try removing it to test for changes.
:cool:
Q1: Should I initially only test with a solo PT8211_2 pins # 2, 3, & 4, w/o the I2S Quad connections?
Q2: Should I also comment out FLASHMEM from the following, at the top of output_pt8211_2.cpp:
FLASHMEM
void AudioOutputPT8211_2::begin(void)
Q3: Is the problem with the Audio USB Type, instead of Serial*?
 
Last edited:
Q: Should I initially only test with a solo PT8211_2 pins # 2, 3, & 4, w/o the I2S Quad connections?

You should test in whatever way (or ways) you plan to really use it.

Or if you care to contribute, test in every way you can imagine might matter....
 
I'm more than happy to contribute in any way, Paul. What comes around, goes around, right?
But, I'm not understanding what is being asked of me.
As I mentioned in prev msg, my hex audio configuration works fine in all Serial USB Types, provided that there aren't just 2 patchCord connections to the I2S_Quad object. This goes back to boxxofrobots attempting to use the quad I2S object in his sketch, but it would fail unless one connection was on the I2S Quad input.
Then, I provided him with a sketch proving that no I2S objects were needed with a solo PT8211_2 configuration, provided Serial is included as the USB Type. Isn't I2S serial communications? Seems right to me.
AFAIK, both of our problems have already been resolved. So, I don't know what to troubleshoot.
 
Out of the frying pan...

I tried commenting out the reference above in output_pt8211_2.cpp, then I tried removing the i2s2 object in my code that was there just to make ti work. When I recompiled I had the exact same problem as before, it didn't change a thing for me. And now, I have reintroduced that stuff and it STILL has a mute pin2. IOW it seems just trying this change has had some sort of permanent effect on my build, and now I have no sound output at all, not even from usbaudio.
 
Sorry to hear you are out of the frying pan and into the fire.

Might help to see what the code looks like now...
 
And now I have rebuilt the entire build system, and now when I try to compile my working sketches I get an error related to 'BUILTIN_SDCARD' was not declared in this scope. Yeesh.
 
But, I'm not understanding what is being asked of me.

Generally the only thing we really ask on this forum is to show complete code & details to reproduce the problem. I believe we've made quite a lot of progress on this difficult issue because some of the conversation did include complete code. But as we've seen, other details like USB Type do matter. The important point is complete enough info to reproduce problems.

If I could ask another thing, it would be to please give 1.57-beta2 a try when it's published (should be a matter of days, might even happen this evening). I know "beta" sounds scary. But it's really not a big deal. You can always just run the Arduino installer again (assuming you're using Windows) and then the Teensyduino 1.56 installer again. Arduino's installer deletes the old copy, so running them both gives you a fresh install, without deleting your settings and saved programs.

You can also try 1.57-beta2 in a way where it's fully isolated from your other install. On Windows & Linux, the Arduino IDE has a "portable" mode you can turn on by creating a folder within the Arduino software (on Windows, you would unzip the non-admin ZIP file, instead of running the EXE installer). Then use the Teensyduino installer on the place you extracted the ZIP and added the portable folder. The portable version creates a completely self-contained copy of Arduino+Teensyduino which doesn't share settings. You can also install on a virtual machine or another completely separate real computer.
 
@boxxofrobots
Sorry to hear that you're still having probs. I just ran the attached sketch, with both Audio and Serial + Midix4 USB configurations and it works fine on ver 1.56. Unfortunately, I'm not in a position to test beta software on $1K laser projectors.
As a reminder, your previous post in msg #63 indicated that you were wired for pins # 7, 20, & 21. Have you changed back to pins 2, 3,& 4?
:cool:
 

Attachments

  • PT8211_test2.zip
    554 bytes · Views: 24
@ Paul,
Okay, here's the deal. I'm only a novice code-head, already struggling to make my code work on $1,000 laser projectors, with very sensitive $400 galvos that could easily be damaged, just from clipping. So, I'm already on very thin ice. Furthermore, you guys are into troubleshooting stuff that's way over my head. As you've seen in my previous posts, I don't always arrive at the correct conclusions, so my feedback needs to be taken with a few grains of salt and skepticism. Sorry for being such a useless dim-wit.

I'm very happy to help test beta software, if you don't mind replacing broken equipment, just as I would need to do if something goes awry. That puts a different perspective on it doesn't it?
Please allow me rephrase that. If I screwed something up, while testing beta, who or what am I most likely to blame?

I'm not providing code for folks to troubleshoot, because my code is working fine and I don't want to waste anyone's time on a wild goose chase.

@boxxofrobots is the one having the problems. I'm only here to help him out, if I can.
I hope you understand.
BR
 
Last edited:
post in msg #63 indicated that you were wired for pins # 7, 20, & 21

Nonono, I didn't rewire the board. It's just that it was working with the other i2s port defined, which means those pins are busy doing other things and not available for other uses even though I don't really need them.

This whole problem really comes down to the unavailability of DACs that are proven in this environment. If I could get the SGTL5000 so I could put it on my mainboard, all would be cool. But there's simply no room for the audio board sandwich as it is in a product for production, and the 8211 fits in there perfectly. Hopefully the new beta will have better results, I'm jus stuck now until then as, after trying the fix involving the output_pt8211_2.c, now a sketch that was working seems to have magically broken no matter what I do to undo the patch. Still trying.
 
So, my attachment didn't work, either? There's nothing in it telling the T4 that the SGTL5000's even exists, so it should also work on your solo config.
Didn't you back up the output_pt8211_2.cpp, prior to editing? I noticed that there were 2 very similar lines with FLASHMEM preceding them. One was near the top, but nt the correct one. The one to be edited was much farther down in the file. I don't see how editing it out would have caused permanent damage. But, what do I know?
If it's any consolation, I spent all last evening troubleshooting a code error from the day before. Now, Winblows keeps reconfiguring my USB ports on the hub, so I've been losing connectivity all morning, unless I reconnect USB devices. Aargh!
But, it's all getting easier with practice.
:rolleyes:
 
now I'm really puzzled

Thise sketch ran before I tried manually editing that c file. Since then I have removed the arduino environment completely from my system, rebuilt it with teensyduino 1.57b1, and it now does this weird loop where it goes offline from the monitor intermittently and doesn't seem to really do anything at all.

Is this helping or nagging? I don't want to nag, and I am tying to help.

Thanks
 

Attachments

  • knobbynew.zip
    64.1 KB · Views: 23
  • buildfiles.zip
    1.4 MB · Views: 19
Just soldered up a PT8211 (T3.x version) wired to a T4.0 and the sketches in post #35 (@Paul) and post #85 (@TheHermit) both are working with the FLASHMEM commented out as mentioned earlier using TD1.57-beta1.

Code:
USB Type        Works  Sketch
Serial            OK     #35
Serial            OK     #85
Serial+Midi16     OK     #35
Serial+Midi16     OK     #85
 
Last edited:
Thise sketch ran before I tried manually editing that c file. Since then I have removed the arduino environment completely from my system, rebuilt it with teensyduino 1.57b1, and it now does this weird loop where it goes offline from the monitor intermittently and doesn't seem to really do anything at all.

Is this helping or nagging? I don't want to nag, and I am tying to help.

Thanks

Okay, let's eliminate as many variables as possible by testing your installation with the most simple sketch possible, like the one I sent to you. With that, you can test different USB settings to determine which ones are working for you. Then, you'll have a foundation to build upon.
BTW, that code problem I mentioned from last night produces no output from the pt8211, as well. But, I know that it's me, because previous versions of that sketch (prior to messing with 2D arrays) work fine. Do you keep regular backups of working sketches to fall back on in times like these?
 
@mjs513,
Thanks for going above and beyond to help with @boxxofrobots' issue. It's also comforting to know that the removal of FLASHMEM is working fine in the beta. Your test results are similar to those I posted in msg #64, indicating that I'm not having any problems.
It's helpful folks like you that make our goals achievable.
:cool:
 
@mjs513,
Thanks for going above and beyond to help with @boxxofrobots' issue. It's also comforting to know that the removal of FLASHMEM is working fine in the beta. Your test results are similar to those I posted in msg #64, indicating that I'm not having any problems.
It's helpful folks like you that make our goals achievable.
:cool:

Thanks. I am not an audiophile so out of my realm here but I just did another test:
If I go back to the sketch in Post #29:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=1341,274
AudioOutputI2S       i2s1;      //xy=1709,230
AudioOutputPT8211_2      pt8211_2_1;     //xy=1726,313
AudioConnection          patchCord3(waveform1, 0, i2s1, 0);
AudioConnection          patchCord4(waveform1, 0, i2s1, 1);
AudioConnection          patchCord5(waveform1, 0, pt8211_2_1, 0);
AudioConnection          patchCord6(waveform1, 0, pt8211_2_1, 1);
// GUItool: end automatically generated code


void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0.99);
}

void loop() {
}
This is now working with Serial+Midix16 but not with Serial+MIDIx16+Audio nor DUAL_SERIAL or RAWHID. However if is remove using i2S1 it works.

Theres seems to be some thing else going on as well since specifing I2S1 and PT8211_2_1 is causing the some type of issue now. Think @PaulStoffregen needs to take a look cause now I am confused.
 
Hey mjs513,
Since you are where you are, with a pt8211 al connected, and being so helpful, I have a little reward for you. I sneaked an Easter egg inside the sketch of msg # 59, just for the amusement of folks with x/y scopes, which I assume you're testing with. But, no one noticed.
Enjoy
:cool:
 
Well, I tried the sketch in 85 and it works with the change made to the cpp file. But throw in usb audio and it don't.
 
Well, I tried the sketch in 85 and it works with the change made to the cpp file. But throw in usb audio and it don't.

Assuming you mean USB Type: Audio? I am getting sound from my speaker with using audio by itself as a USB Type.

Not testing with a scope - using a simple a speaker attached to the PT8211 board per the picture. When it doesn't work I get NO sound what so ever.
 
Wondering to self. If these warnings are causing the issues:
Code:
F:\arduino-1.8.19\hardware\teensy\avr\libraries\Audio\output_pwm.cpp: In static member function 'static void AudioOutputPWM::isr()':
F:\arduino-1.8.19\hardware\teensy\avr\libraries\Audio\output_pwm.cpp:370:29: warning: invalid conversion from 'volatile audio_block_t* {aka volatile audio_block_struct*}' to 'audio_block_t* {aka audio_block_struct*}' [-fpermissive]
   AudioStream::release(block);
                             ^
In file included from F:\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/usb_audio.h:63:0,
                 from F:\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/WProgram.h:60,
                 from C:\Users\Merli\AppData\Local\Temp\arduino_build_922032\pch\Arduino.h:6:
F:\arduino-1.8.19\hardware\teensy\avr\cores\teensy4/AudioStream.h:154:14: note:   initializing argument 1 of 'static void AudioStream::release(audio_block_t*)'
  static void release(audio_block_t * block);
              ^
F:\arduino-1.8.19\hardware\teensy\avr\libraries\Audio\output_pwm.cpp: In member function 'virtual void AudioOutputPWM::update()':
F:\arduino-1.8.19\hardware\teensy\avr\libraries\Audio\output_pwm.cpp:402:12: warning: invalid conversion from 'volatile audio_block_t* {aka volatile audio_block_struct*}' to 'audio_block_t* {aka audio_block_struct*}' [-fpermissive]
  old_block = block ;
            ^
F:\arduino-1.8.19\hardware\teensy\avr\cores\teensy4\AudioStream.cpp: In member function 'int AudioConnection::connect(AudioStream&, unsigned char, AudioStream&, unsigned char)':
 
Okay, back in msg #64, I demonstrated that, with boxxofrobots' configuration of using Quad I2S with pt8211_2, it would always fail if there were either no patch chords or only 2 patch chords, regardless of which two.
Then, later I found that I2S objects will only break the pt8211_2. Seems like there's a need for connections to nowhere, before DIN on pin #2 becomes active. That was my point in sharing the (rotating figure 8) sketch you tested, w/o I2S objects.
 
Code:
invalid conversion from 'volatile audio_block_t* {aka volatile audio_block_struct*}' to 'audio_block_t* {aka audio_block_struct*}' [-fpermissive]
  old_block = block ;
Sure smells like a mem allocation error to me.
"When it doesn't work I get NO sound what so ever."
I get burn marks on my walls lol.
 
It looks to me as though the pt8211_2 object simply enables pins 2, 3, & 4 for serial I2S signals. So, isn't it logical that the USB should be set to one of the Serial communications modes to interface with the pt8211-2's inputs, regardless of whether audio is being output from it's back end?
Are you receiving the *pwm errors, because USB is set to Audio, which might be PWM, instead of I2S DIN?
USB Audio.... as in PWM audio being sent to the PC via USB, instead of via DIN to an I2S object?
If that were the case, I can't imagine how challenging it would be to enable both simultaneously. Are you sure that this isn't a 'feature' instead of a bug?
 
Last edited:
Back
Top