@mjs513 - That's a big fat YES Took the time to make sure all of recent changes were put back to the original. Made the change you provided and it works. GOOD FIX
Def Lepard never sounded better Going let this run overnight...
Curious thought, could this be something that is plaguing MTP_Teensy?
Note: that is why I asked about DMAMEM back in the dart board post...Ideas? Maybe not Darts(Questions)? Maybe
...
I believe you said it works with static buffer instead?
If so have you tried the static buffer using DMAMEM? does it make a difference?
...
Sorry again dart board.
Unfortunately this is not really a fix, but at least it helps localize the issue.@mjs513 - That's a big fat YES Took the time to make sure all of recent changes were put back to the original. Made the change you provided and it works. GOOD FIX
Def Lepard never sounded better Going let this run overnight...
Curious thought, could this be something that is plaguing MTP_Teensy?
static void rx_queue_transfer(int i)
{
NVIC_DISABLE_IRQ(IRQ_USB1);
void *buffer = rx_buffer + i * MTP_RX_SIZE_480;
arm_dcache_delete(buffer, rx_packet_size);
//memset(buffer, )
usb_prepare_transfer(rx_transfer + i, buffer, rx_packet_size, i);
NVIC_DISABLE_IRQ(IRQ_USB1);
usb_receive(MTP_RX_ENDPOINT, rx_transfer + i);
NVIC_ENABLE_IRQ(IRQ_USB1);
}
Note the codecs just use "RAM".
They don't need to know if it is OCRAM, cached or whatever. It's just heap. Dumb RAM without any needed extras. Works with T3.2.
BUT: If the malloc fails or the codecs do not play, the whole heap management failed, because it's broken.
Why is it broken? Because of an cache issue (-> you said it works with cache disabled)
-> Which cache issue?
Well... good question. Normaly, this can happen if something goes wrong with the three core-cache functions.
Either because something (which *should* be 32Byte aligned (DMA)) is not 32Byte aligned , or because the 3 funcs are not called when they should be called.
Or, wrong usage of them. In the §$%& thread about these funcs, I gave examples what can happen to the heap, just by calling them. and showed that they can destroy the heap (and everything else)
Of yourse, a simple buffer-overflow can kill the heap, too.
But if it does not happen without cache, something connected to it must be the reason.
Am I wrong?
C:\Users\kurte\Documents\Arduino\libraries\Arduino-Teensy-Codec-lib\oggparse.cpp:323:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}while(pagehdr->granuleposition == -1 || pagehdr->granuleposition <= granulePos);
^
So there is some sort of conflict somewhere but there are alot of moving pieces here.
If it works differently with cache than without - what reason is there that is not related to the cache?
I actually tested the change and it all the formats worked with the SD Card: https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=199104&viewfull=1#post199104@mjs, i've fixed the codecs-library. should compile now
On T4, it uses IRQ_Reserved1 as secondary interrupt.
#define IRQ_AUDIO IRQ_SOFTWARE // see AudioStream.cpp
#if defined(__IMXRT1052__) && !defined(__IMXRT1062__)
#define IRQ_AUDIOCODEC IRQ_Reserved1
#else
#define IRQ_AUDIOCODEC 55 // use a "reserved" (free) interrupt vector
#endif
#define IRQ_AUDIO IRQ_SOFTWARE // see AudioStream.cpp
#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#define IRQ_AUDIOCODEC IRQ_Reserved1
#else
#define IRQ_AUDIOCODEC 55 // use a "reserved" (free) interrupt vector
#endif
@MJS: Indeed, 55 is the BEE interrupt. Cab produce problems since there is encryption..
The reserved interrupt for T4 came later.
So, that change makes sense.
Can you do a PR, please?
(I can not test it now...)
I guiess i wrote it this way as a reminder, to edit it later, when Reserved1 is defined.. seems I forgot it
Will have to play some more with this today and see if we can isolate...
When you say the would not play... Did the open fail or did they just not produce noise (oops I mean music )
@KurtE - @wwatson - @Frank B
Finally got around to soldering up a Rev C audio shield to test a T3.6 with the changes and codecs:
1. SD Cards reads and plays all files without a problem except FLA files still produce no sound even though seems like it should be playing.
2. USB audio files on a jump drive all play without any issue. The issue I had with MP3s or AAC files playing are not seen on the T3.6. FLA files - still no joy.