AdaFruit Audio Library doesn't support Metro M4 Airlift?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jluros
 
Posts: 3
Joined: Thu May 13, 2021 1:24 pm

AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by jluros »

I'm trying to get the Adafruit audio library working with my Metro M4 Express Airlift Lite. In two examples I've tried, WavFilePlayer and sketch_jun13a, I'm getting the same error:

Code: Select all

Audio_-_Adafruit_Fork/input_adcs.cpp:161:2: error: #error The Adafruit audio library is compatible with M4 parts only
  161 | #error The Adafruit audio library is compatible with M4 parts only


Beginning on Line 122 in input_adcs.cpp, the compiler goes through if/elif/else statements to detect the board variant (_VARIANT_ITSYBITSY_M4_, _VARIANT_FEATHER_M4_, etc.), and gets to the end without matching any of the supported boards.

I think the board variant for the Metro M4 Express Airlift Lite is "ADAFRUIT_METRO_M4_AIRLIFT_LITE", but the compiler obviously doesn't think that _VARIANT_METRO_M4 on line 138-143 is true, otherwise the following would be called and the error "The Adafruit audio library is compatible with M4 parts only" on line 161 wouldn't get triggered:

Code: Select all

#elif defined(_VARIANT_METRO_M4_)
   switch (pin1)
   {
      case PIN_A4: ADC1Channel = ADC_Channel0; break;
      case PIN_A5: ADC1Channel = ADC_Channel1; break;
   } 
Any help would be greatly appreciated.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by dastels »

Right. It's not a Metro M4. You should add the Metro M4 Airlift variant to the conditional and, assuming it works (I don't see why it wouldn't), submit a pull request.

Dave

User avatar
jluros
 
Posts: 3
Joined: Thu May 13, 2021 1:24 pm

Re: AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by jluros »

Ok, so I think I got it working (at least, I got a sine wave playing out of A0). I added:

Code: Select all

#elif defined(_VARIANT_METRO_M4_WIFI_)
   switch (pin1)
   {
      case PIN_A4: ADC1Channel = ADC_Channel0; break;
      case PIN_A5: ADC1Channel = ADC_Channel1; break;
   }
to input_adcs.cpp

I still don't totally understand how to access the DAC output programmatically and output a wav file to A0. I know it's wired right, because it works in CircuitPython, but I want to figure out how to do it in C.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by dastels »

Good stuff!

Dave

User avatar
jluros
 
Posts: 3
Joined: Thu May 13, 2021 1:24 pm

Re: AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by jluros »

I still haven't been able to get a WAV file to play on A0 using C code (Arduino IDE). Do you know if the Adafruit fork of the Teensy Audio library supports the Metro M4 Express (SAMD51) platform?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: AdaFruit Audio Library doesn't support Metro M4 Airlift?

Post by dastels »

It works on the NeoTrellis M4 (https://learn.adafruit.com/synthesizer-design-tool) so I expect it would work on the Metro M4 Airlift.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”