Tympan / Tympan_Library

Arduino/Teensy Library for Tympan Open Source Hearing Aid
MIT License
116 stars 31 forks source link

Sitrep - try every example for compile errors, run errors (Rev F) #77

Open stvhawes opened 1 week ago

stvhawes commented 1 week ago

New to the project, so while familiarising myself with the code I tried every (non-deprecated) example.

The compile-fails especially could be my libraries setup rather than any particular issue. Run errors perhaps because there was a hardware item I should have plugged in...

Compiles and runs and query-favourite

./03-Intermediate/WDRC_FIR_8Band/WDRC_FIR_8Band.ino okay serial monitor in + out ./05-FullSystems/WDRC_8BandFIR_full/WDRC_8BandFIR_full.ino okay serial monitor in and out also tested sweep .. good ./06-AppTutorial/BasicGain_wApp/BasicGain_wApp.ino okay serial monitor out

Compiles and runs, no problemo

./01-Basic/BasicGain/BasicGain.ino okay serial monitor out ./01-Basic/TrebleBoost/TrebleBoost.ino okay serial monitor out CPU Cur/Pk: 0.6%/0.6%, MEM Cur/Pk: 4/6, FreeRAM(B) 499712 ./01-Basic/TrebleBoost_wComp/TrebleBoost_wComp.ino okay serial monitor out printGainStatus: Input PGA = 20.0 dB. Compressor Gain (L/R) = 0.0, 0.0 dB. CPU Cur/Pk: 2.2%/2.3%, MEM Cur/Pk: 4/8, FreeRAM(B) 499712 ./01-Basic/AudioPassThru/AudioPassThru.ino okay serial monitor out ./01-Basic/PrintCPUandMemoryUsage/PrintCPUandMemoryUsage.ino okay serial monitor out CPU Cur/Pk: 0.4%/0.4%, MEM Cur/Pk: 4/6, FreeRAM(B) 499712 ./01-Basic/ChangeSampleRate/ChangeSampleRate.ino okay serial monitor out ./02-Utility/SD_Card/SDWriter_wApp_wMTP/SDWriter_wApp_wMTP.ino okay serial monitor in + out ./02-Utility/SD_Card/SDWavPlayer/SDWavPlayer.ino

Compiles, errors during run

./02-Utility/SD_Card/SDWriter_wApp_wLog/SDWriter_wApp_wLog.ino Setup: SD configured for 2 channels. error: setup: SD begin failed! SdError: 0X17,0X0
./02-Utility/SD_Card/SdPlay_and_SDWrite/SdPlay_and_SDWrite.ino okay serial monitor in + out Received: starting SD Player for PLAY1.WAV... AudioSDPlayer_F32: cannot open SD. AudioSDPlayer_F32: cannot open SD. Received: stopping the playing of any SD files... error: SDWriter: begin failed SdError: 0X17,0X0 ./02-Utility/SD_Card/SDWriter_wApp/SDWriter_wApp.ino okay compile and writes to monitor retest: seemed to crash not responsive; write to SD card ./02-Utility/RenameTympanBT/RenameTympanBT.ino okay serial monitor out

Compile fail

./02-Utility/DetectExtMic/DetectExtMic.ino DetectExtMic:21: error: 'audio_settings' was not declared in this scope 21 | Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F | ^~~~~~ Multiple libraries were found for "SD.h" Used: /Rosie/Hawesy/arduino-1.8.19/hardware/teensy/avr/libraries/SD Not used: /Rosie/Hawesy/arduino-1.8.19/libraries/SD 'audio_settings' was not declared in this scope
./02-Utility/SoundLevelMeter/SoundLevelMeter.ino SoundLevelMeter:32: error: 'i2s_in' was not declared in this scope 32 | AudioConnection_F32 patchCord1(i2s_in, 0, freqWeight1, 0); //connect the Left input to frequency weighting | ^~ SoundLevelMeter:34: error: 'i2s_in' was not declared in this scope 34 | AudioConnection_F32 patchCord3(i2s_in, 0, i2s_out, 0); //echo the original signal to the left output | ^~ Multiple libraries were found for "SD.h" Used: /Rosie/Hawesy/arduino-1.8.19/hardware/teensy/avr/libraries/SD Not used: /Rosie/Hawesy/arduino-1.8.19/libraries/SD 'i2s_in' was not declared in this scope ./03-Intermediate/WDRC_SingleBand/WDRC_SingleBand.ino WDRC_SingleBand:23: error: 'audio_settings' was not declared in this scope 23 | Tympan myTympan(TympanRev::F, audio_settings); //do TympanRev::D or E or F | ^~~~~~ Multiple libraries were found for "SD.h" Used: /Rosie/Hawesy/arduino-1.8.19/hardware/teensy/avr/libraries/SD Not used: /Rosie/Hawesy/arduino-1.8.19/libraries/SD 'audio_settings' was not declared in this scope
./04-FrequencyDomain/FormantShifter_FD/FormantShifter_FD.ino nope FormantShifter_FD:49: error: 'audioHardware' was not declared in this scope 49 | SerialManager serialManager(audioHardware); | ^~~~~ FormantShifter_FD: In function 'void switchToPCBMics()': FormantShifter_FD:50: error: 'audioHardware' was not declared in this scope 50 | #define mySerial audioHardware //audioHardware is a printable stream! | ^~~~~
./04-FrequencyDomain/PitchShifter_FD/PitchShifter_FD.ino nope pitchShifter_FD: In function 'void switchToPCBMics()': PitchShifter_FD:114: error: 'audioHardware' was not declared in this scope 114 | audioHardware.inputSelect(TYMPAN_INPUT_ON_BOARD_MIC); // use the microphone jack - defaults to mic bias OFF | ^~~~~ PitchShifter_FD: In function 'void switchToLineInOnMicJack()': PitchShifter_FD:119: error: 'audioHardware' was not declared in this scope 119 | audioHardware.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); // use the microphone jack - defaults to mic bias OFF ./04-FrequencyDomain/FrequencyShifter_FD/FrequencyShifter_FD.ino nope FrequencyShifter_FD:59: error: 'audioHardware' was not declared in this scope 59 | SerialManager serialManager(audioHardware); | ^~~~~ ./04-FrequencyDomain/LowpassFilter_FD/LowpassFilter_FD.ino nope In file included from /Stephen/tympan-repo/libraries/Tympan_Library/examples/04-FrequencyDomain/LowpassFilter_FD/LowpassFilter_FD.ino:18: /Stephen/tympan-repo/libraries/Tympan_Library/examples/04-FrequencyDomain/LowpassFilter_FD/AudioEffectLowpass_FD_F32.h: In member function 'virtual void AudioEffectLowpass_FD_F32::update()': AudioEffectLowpass_FD_F32.h:99: error: no matching function for call to 'IFFT_Overlapped_F32::execute(float32_t&)' 99 | audio_block_f32_t out_audio_block = myIFFT.execute(complex_2N_buffer); //out_block is pre-allocated in here. ./05-FullSystems/WDRC_8BandFIR_Stereo_wApp/WDRC_8BandFIR_Stereo_wApp.ino nope WDRC_8BandFIR_Stereo_wApp:66: error: 'serialManager' was not declared in this scope; did you mean 'SerialManager'? 66 | State myState(&audio_settings, &myTympan, &serialManager); //keeping one's state is useful for the App's GUI | ^~~~~ | SerialManager WDRC_8BandFIR_Stereo_wApp: In function 'void setupSerialManager()': WDRC_8BandFIR_Stereo_wApp:107: error: 'serialManager' was not declared in this scope; did you mean 'SerialManager'? 107 | serialManager.add_UI_element(&myState);
./05-FullSystems/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp.ino compile errors but did seekec to upload and run... Compile errors .. In file included from /Stephen/tympan-repo/libraries/Tympan_Library/examples/05-FullSystems/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp.ino:67: /Stephen/tympan-repo/libraries/Tympan_Library/examples/05-FullSystems/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp/BTNRH_PresetManager_UI.h: In member function 'virtual int BTNRH_Preset::interpolateSettingsGivenFrequencies(const BTNRH_Preset&, int, float*)': BTNRH_PresetManager_UI.h:43: warning: unused variable 'old_n_crossover' 43 | int old_n_crossover = old_n_chan-1; | ^~~~~~~ In file included from /Stephen/tympan-repo/libraries/Tympan_Library/examples/05-FullSystems/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp.ino:67: /Stephen/tympan-repo/libraries/Tympan_Library/examples/05-FullSystems/WDRC_NBand_Stereo_Earpiece_Prescrip_wApp/BTNRH_PresetManager_UI.h: In member function 'virtual bool BTNRH_StereoPresetManager_UI::processCharacterTriple(char, char, char)': BTNRH_PresetManager_UI.h:554: warning: comparison of constant '0' with boolean expression is always false 554 | delay(10); if (flag_fail < 0) { setIncrementChannelsMessage("Failed"); } else { setIncrementChannelsMessage("Complete");} Running eg... BTNRH_WDRC: Preset_SD_Base: beginSD_wRetry: WARNING : cannot open SD. sd.begin(SD_CONFIG) = 0 : Trying again... BTNRH_WDRC: Preset_SD_Base: beginSD_wRetry: WARNING : cannot open SD. sd.begin(SD_CONFIG) = 0 : FAILED all attempts. Returning w..

Deprecated

./08-Earpieces/Deprecated/WDRC_XBand_PrescripSave_wApp/WDRC_XBand_PrescripSave_wApp.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/ChangeBaudrate/ChangeBaudrate.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/BC127LibraryTest/BC127LibraryTest.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/BasicGain_wApp_BLEdebug/BasicGain_wApp_BLEdebug.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/BluetoothAudio_PassThru/BluetoothAudio_PassThru.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/EchoBLE/EchoBLE.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/BC127Terminal/BC127Terminal.ino Deprecated ./02-Utility/Bluetooth/Deprecated (RevD, RevE)/BLELibraryTest/BLELibraryTest.ino Deprecated ./05-FullSystems/Deprecated/WDRC_8BandFreqWarpFIR/WDRC_8BandFreqWarpFIR.ino Deprecated ./05-FullSystems/Deprecated/WDRC_3BandIIR_wAFC/WDRC_3BandIIR_wAFC.ino Deprecated ./05-FullSystems/Deprecated/WDRC_8BandIIR_wAFC/WDRC_8BandIIR_wAFC.ino Deprecated

stvhawes commented 1 week ago

I don't think there's any urgency since there are awesome working examples.

I'll try my hand at some fixes. Some are probably already fixed (tests were on 12 June main-branch), and if not then very likely to be addressed before I get to them.

chipaudette commented 1 week ago

Hi! Thanks for this work!

Most of your errors are caused by running an example setup for using an SD card in your Tympan, but you must not have an SD card. If you used an SD card, more than half your errors would go away.

Also, you got an error on the example for renaming the Bluetooth module. As the comments in the code say, and as your own comment say, this example only works for older versions of the Tympan. It is not indebted for use with Rev F.

You also got a bunch of errors on the Deprecated examples. These are not expected to work. Instead of calling them "deprecated", I probably should have called them "soon to be deleted".

Finally, there are all of the other errors that you found. These are more troubling and surprising to me. Prior to the release of Rev F, I recompiled all of the Tympan examples myself and they all worked at that time. I'll go back and try to recompile them myself in the next couple days.

What tool chain were you using to compile and test all of these? You didn't do them all manually like I did, did you? You must have done the testing in some automated manner? Did you set up a continuous integration system? I'm very curious!

Chip

stvhawes commented 5 days ago

:) manual. Felt like a good way to sense the scale and breadth of the library, while looking for a few favourite examples to focus on.

Also, I didn't expect you would have been able to watch all the examples on every update. Automation would be nice but not easy when there's the specific hardware (and past versions of the hardware). Benefit to audiologists would the key purpose of the library rather than software complexity..

I have yet to fix anything .. but I did make a fork and try out the PR pathway.

stvhawes commented 3 days ago

Yep, sourcing a microSD did fix the runtime issues, and really brought my Tympan on!

Meanwhile I've run through the compile-issues and worked out a proposed fix for each. I've tested as best I can but might have misunderstood the purpose and capabilities of an example (so incomplete fix).

Pull request: https://github.com/Tympan/Tympan_Library/pull/78

stvhawes commented 3 days ago

@chipaudette (or other maintainer!) please can you review the PR #78.

If you decide to copy some or any fixes over to another branch and merge from there I won't be offended. If I should click to merge through (if I have permissions) then please instruct.

chipaudette commented 3 hours ago

Nice Pull Request! Thanks so much for the fixes!