-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick note for testers with ESP12 #1
Comments
@ErichHeinemann |
Hi guys. I just wanted to say that I am following your changes but just swamped with other things for a bit. I'll be happy to jump on this once those free up! Thx! |
Hi all, my proble, - I cannot rebuild it. No ESP12 and I have renamed all my Classes because of to many issues ... . I believe the problem is in the Output. I had changed my code in the AudioOutput.h/.cpp and had added or changed a Mute-Function. I have added my last code which has an added "Sample" in front of the "Audio". Check this here: https://github.com/ErichHeinemann/hman-stomper/blob/master/AdditionalLibs/ESP32SampleAudio/SampleAudioOutputI2Sesp32.cpp Some new functions are implemented there: which probably only works with the real DAC. I have not implemented a corresponding function in the NoDAC-Class. Excuse me, for now I cannot help out to fix this issue. |
Dagnal, compare my code for the AudioOutput.h-File and the real implementation for the DAC. .. I believe the stop is implemented. "mute" was removed in the implementation. A mute-function would look like this: |
FWIW that should quiet down the NoDAC one as well...no transitions = 0 AC component = no noise. |
I will look tomorrow, but remember this is way out of my comfort zone! |
@earlephilhower @ErichHeinemann Following some experiments, my conclusion is that there is an issue in the mixer codes, but I can not home in on it. There is certainly some sort of timing issue, as I get (very) different results if I put a small delay in the main loop. Mods to ::Stop in DAC and noDAC, with this code have made no difference: #ifdef ESP32 #endif I did try to see if the clicks were loop() related by adding a delay(1) in the main loop. With just one channel on, and delay(1), there is no change. there are clicks when the files are started but the sounds play and loop. With delay(10) and a single channel, I see the "sink->stop send" debug message (I have not seen this before) Erich, could you compile my test ino and see if it works fully with an ESP32 with your modified library ? |
@earlephilhower RESULTS: I would surmise one issue in the noDAC for the clicks, plus another in the mixer for the channel related speed issues? |
Also, just discovered, the playback speed issue (DAC) is dependant on the ESP CPU frequency.. |
Hi use yield(); and not delay ...
… Am 20.02.2018 um 18:42 schrieb dagnall ***@***.***>:
@ErichHeinemann <https://github.com/erichheinemann>
( @earlephilhower <https://github.com/earlephilhower> )
I can confirm that the mixer works with noDAC, in fact it seems to work better with noDAC than DAC.. However there is still a lot to do: I have made some code with SPIFF and some sound samples and a few directives to test switching on channels .
https://github.com/dagnall53/mixtest2 <https://github.com/dagnall53/mixtest2>
My conclusion is that the mixer is currently adding "clicks" somehow and is perhaps not altering its operation when only a few channels are functional.
If you get the chance to test this I would appreciate any comments..
I am using the ESP-12, so I appreciate you may not have the hardware...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AiOjNXSIaBodUuVtzEBTH-b8zhkAa5Coks5tWwQZgaJpZM4SL0yE>.
|
Erich, I used delay to simulate real issues that we will get when the main loop is fully populated. The code should be robust enough to stand a small delay in the main loop. |
Actually, I don't take account the clock. The I2S is DMA controlled, and clocked at whatever fixed frequency is set up at the beginning of the run. So it "just works" assuming you feed the DMA engine samples before it underflows. If you're getting clicks, it may be DMA underflows...on the ESP8266 it unfortunately doesn't export DMA underflow count so it's not easily trackable. I only looked at it very early this AM before my flight, but I think that @ErichHeinemann 's code may only be processing a single sample per ->loop() call. If so, you may be spending too much time on overhead and get clicks. But, like I said, I'm not sure as this was just a few minutes before boarding. If the sounds are coming out slow, it may be "silent" clicks where it sends a few samples, sends an underflow (0) buffer, then sends the next few samples, etc. Do that fast enough and the silent buffers can almost become unhearable while the sound seems to be slower than expected. |
Thanks for looking at the code. |
I have reinstated the set rate linkage from the AudioGenerator through to the Audio output, by modifying However, during further exploring of the mixer, I have found that with a single channel, it seems to lose samples (about half of them?). I have updated my test code : https://github.com/dagnall53/mixtest2 to demonstrate that sending direct to the AudioOutput sounds fine, but sending it (as a single channel) via the mixer corrupts it. I will try to track down the issue, but any assistance would be appreciated! |
@dagnall53 about the mixer not starting w/o samples from all inputs. That actually has to be by design. Whenever a new audiogenerator is triggered, the mixer should be able to add a new channel on the fly. When an audiogenerator ends, the mixer should be able to drop that channel too. So at any point in time, for all connections, you need samples from them all to advance. I didn't realize Erich's code did resampling, that's great! Since it looks like the BearSSL replacement is now working pretty stably I should have some spare time to look at this stuff over the weekend. |
As far as I an see, the AudioGenerator works with a 128 long buffer, but Erich's code, at least in the test example, only takes 8 samples into each channel buffer. It can take more (and I have used up to 255 as the buffer size) but the tests I did did not show any improvement on the issues I was exploring. I presume that the intent is that the multiple channels being added together to become the mix can only get 8 samples out of synch.. |
Since I opened this year ago, I think all the noted issues have been resolved. |
A note to hopefully help others testing this mixer:
I am testing (trying to test) the code on an ESP12 with the Earle Philhower NODAC output.
The example code uses ESP32 output (AudioOutputI2Sesp32) that needs an extra driver 12s that is not in the Earle "library". Even if you comment out the include for AudioOutputI2Sesp32, the arduino compiler still complains!.
I suspect the AudioOutputI2Sesp32 code needs an overall #ifdef ESP32 around it to prevent this.
My quick and dirty fix was to delete the AudioOutputI2Sesp32.cpp and .h from my library. ,
The text was updated successfully, but these errors were encountered: