Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Audio applications error

  1. #1
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134

    Audio applications error

    Hi all,
    I've recently installed Arduino 1.8.15 with Teensyduino 1.54; using T4.1@600MHz, when I try to compile an audio application (I also checked standard examples like WavFilePlayer, SamplePlayer, and others) I get this error:

    Code:
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.h:31:0,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:27:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In member function 'float AudioStream::processorUsage()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:111:142: error: 'F_CPU_ACTUAL' was not declared in this scope
     #define CYCLE_COUNTER_APPROX_PERCENT(n) (((float)((uint32_t)(n) * 6400u) * (float)(AUDIO_SAMPLE_RATE_EXACT / AUDIO_BLOCK_SAMPLES)) / (float)(F_CPU_ACTUAL))
                                                                                                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:145:38: note: in expansion of macro 'CYCLE_COUNTER_APPROX_PERCENT'
      float processorUsage(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles); }
                                          ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In member function 'float AudioStream::processorUsageMax()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:111:142: error: 'F_CPU_ACTUAL' was not declared in this scope
     #define CYCLE_COUNTER_APPROX_PERCENT(n) (((float)((uint32_t)(n) * 6400u) * (float)(AUDIO_SAMPLE_RATE_EXACT / AUDIO_BLOCK_SAMPLES)) / (float)(F_CPU_ACTUAL))
                                                                                                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:146:41: note: in expansion of macro 'CYCLE_COUNTER_APPROX_PERCENT'
      float processorUsageMax(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles_max); }
                                             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In static member function 'static void AudioStream::update_all()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:165:50: error: 'IRQ_SOFTWARE' was not declared in this scope
      static void update_all(void) { NVIC_SET_PENDING(IRQ_SOFTWARE); }
                                                      ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:165:62: error: 'NVIC_SET_PENDING' was not declared in this scope
      static void update_all(void) { NVIC_SET_PENDING(IRQ_SOFTWARE); }
                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp: In member function 'void AudioSynthSimpleDrum::noteOn()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:35:17: error: '__disable_irq' was not declared in this scope
       __disable_irq();
                     ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:42:16: error: '__enable_irq' was not declared in this scope
       __enable_irq();
                    ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp: In member function 'void AudioSynthSimpleDrum::secondMix(float)':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:60:17: error: '__disable_irq' was not declared in this scope
       __disable_irq();
                     ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:63:16: error: '__enable_irq' was not declared in this scope
       __enable_irq();
    Has anyone encountered this problem?
    Thanks in advance
    Last edited by Sandro; 08-01-2021 at 11:05 AM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,064
    Looks like a corrupted install.

    Try the simplest thing first. Reboot your PC, in case any lingering process is holding a lock on certain files. (optional) Temporarily disable Windows Defender and other anti-virus software. Then run the installer again, before you run Arduino or do other stuff with your PC. Don't forget to turn anti-virus back on.

    Hopefully a fresh reinstall will magically cure the problem.

  3. #3
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134
    Hi Paul, I tried many times installing and testing, always disabling Windows Defender's features; I also uninstalled my G-Data firewall-antivirus, updated Windows.. Unfortunately I didn't get any positive result,.. always the same error:

    Code:
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.h:31:0,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:27:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In member function 'float AudioStream::processorUsage()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:111:142: error: 'F_CPU_ACTUAL' was not declared in this scope
     #define CYCLE_COUNTER_APPROX_PERCENT(n) (((float)((uint32_t)(n) * 6400u) * (float)(AUDIO_SAMPLE_RATE_EXACT / AUDIO_BLOCK_SAMPLES)) / (float)(F_CPU_ACTUAL))
                                                                                                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:145:38: note: in expansion of macro 'CYCLE_COUNTER_APPROX_PERCENT'
      float processorUsage(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles); }
                                          ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In member function 'float AudioStream::processorUsageMax()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:111:142: error: 'F_CPU_ACTUAL' was not declared in this scope
     #define CYCLE_COUNTER_APPROX_PERCENT(n) (((float)((uint32_t)(n) * 6400u) * (float)(AUDIO_SAMPLE_RATE_EXACT / AUDIO_BLOCK_SAMPLES)) / (float)(F_CPU_ACTUAL))
                                                                                                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:146:41: note: in expansion of macro 'CYCLE_COUNTER_APPROX_PERCENT'
      float processorUsageMax(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles_max); }
                                             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h: In static member function 'static void AudioStream::update_all()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:165:50: error: 'IRQ_SOFTWARE' was not declared in this scope
      static void update_all(void) { NVIC_SET_PENDING(IRQ_SOFTWARE); }
                                                      ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:165:62: error: 'NVIC_SET_PENDING' was not declared in this scope
      static void update_all(void) { NVIC_SET_PENDING(IRQ_SOFTWARE); }
                                                                  ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp: In member function 'void AudioSynthSimpleDrum::noteOn()':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:35:17: error: '__disable_irq' was not declared in this scope
       __disable_irq();
                     ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:42:16: error: '__enable_irq' was not declared in this scope
       __enable_irq();
                    ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp: In member function 'void AudioSynthSimpleDrum::secondMix(float)':
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:60:17: error: '__disable_irq' was not declared in this scope
       __disable_irq();
                     ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio\synth_simple_drum.cpp:63:16: error: '__enable_irq' was not declared in this scope
       __enable_irq();
                    ^

  4. #4
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,293
    Still a corrupted install.
    Try to delete everything.. reboot. Install Arduino and Teensyduino.

    Really, it is just defective.

  5. #5
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134
    **problem solved**
    After an attempt (not resolutive) of deleting all files and registry records ("Arduino" and "Teensy" keywords), I solved the problem with a Windows 10 re-installation. Thank you Paul and Frank!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •