chipaudette / OpenAudio_ArduinoLibrary

Arduino Library for OpenAudio Hacking
124 stars 32 forks source link

Compiler Warnings using Arduino IDE 2.3.2 #25

Open Greg-R opened 3 weeks ago

Greg-R commented 3 weeks ago

These are not show stoppers, but they are annoying. Compiler output below. Can any of these be resolved?

Thank you, Greg

/home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/output_spdif3_f32.cpp: In member function 'void AudioOutputSPDIF3_F32::begin()': /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/output_spdif3_f32.cpp:77:15: warning: 'void memset(void, int, size_t)' clearing an object of type 'class audio_block_f32_t' with no trivial copy-assignment; use value-initialization instead [-Wclass-memaccess] 77 | memset(&block_silent, 0, sizeof(block_silent)); | ~~^~~~~~~~~~~~ In file included from /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/output_spdif3_f32.h:27, from /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/output_spdif3_f32.cpp:28: /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/AudioStream_F32.h:34:7: note: 'class audio_block_f32_t' declared here 34 | class audio_block_f32_t { | ^~~~~ /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/utility/BTNRH_rfft.cpp: In function 'int BTNRH_FFT::bitrev(int, int)': /home/raven/Arduino/libraries/OpenAudio_ArduinoLibrary/utility/BTNRH_rfft.cpp:31:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 31 | register int jj; | ^~ Opening Teensy Loader... Memory Usage on Teensy 4.1: FLASH: code:211732, data:123428, headers:8896 free for files:7782408 RAM1: variables:146240, code:191368, padding:5240 free for local variables:181440 RAM2: variables:354496 free for malloc/new:169792

boblark commented 3 weeks ago

I will take these on. The "reg" doesn't apply and the spdif needs to only zero the data, I think. I cannot test the spdif, so after I change the zeroing, maybe somebody could test the functionality. Bob

Greg-R commented 3 weeks ago

I had to look up SPIDIF at Wikipedia. I checked my media devices and no SPIDIF.

I'm pretty sure I have 2 spare Teensies. So if it's a really important test, it should be theoretically possible to fire audio from one Teensy to another using that interface.

JayShoe commented 2 weeks ago

SPDIF is also similar to optical/toslink. It is not the same as ADAT because ADAT has 8 channels and SPDIF has 2. I mention this since it sounds like you are just now learning about SPDIF. 

Firing one Teensy into the other is a great way to test it for sure. Get ADAT working and you are a hero.

Greg-R commented 2 weeks ago

Searching around at Amazon, I found this:

https://www.amazon.com/PROZOR-Digital-Converter-Optical-Toslink/dp/B00KNNSKV0

The project I am working on is the T41 "Software Defined Transceiver". So it seems possible to add the SPDIF to my audio chain, and drive the Amazon device with the SPDIF output, ultimately getting analog audio to the headphones or speaker. This looks like a great way to test the SPDIF output class, and it gives me an alternative way to get audio out of the radio.

boblark commented 2 weeks ago

Thanks, guys. I think it is a simple enough fix to be OK without hardware testing (I hate to say that, as it always ...). We just need to zero the data with something like

for(int i=0; i<block_silent.length; i++) block_silent.data[i] = 0.0f;

and get rid of the memset call.

I will try this, but it will be a couple of days. Bob