-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Internal DAC glitches using I2S ".use_apll = true" (IDFGH-7784) #9321
Comments
Is anything happening on this problem? |
Is the issue exists on other released branch? I didn't catch any clue where the glitches might come from 😟 |
It seems not a software issue,I monitored the clock of APLL, it looks pretty well, and it's totally same with the PLL clock. I used two DMA strategies to transport the data, not work, it's not likely a DMA problem as well. The most possible reason I guess is these two clock domain (APLL for I2S DMA and RTC for DAC) are affected by each other. Due to the APLL generated a good clock, I doubt RTC is interfered by something that introduced by the APLL |
It happens on all the branches / releases I've tried and on several hardware platforms. |
I tried again with the data that calculated by
|
No this does not fix the problem. |
Yeah, you're right! Seems the phase shift between the two channels will indeed bring more glitches. I tested the case on the new driver-NG of DAC (not merged yet), the glitches are still there, but they don't show up on ESP32-S2 under same conditions. And I checked the sent data as well, at least the data is correct after they are transmitted by DMA, the only possible point that breaks the data should between DMA and DAC converter. Which might be a hardware bug, sadly I'm not sure if there will be a solution for this issue. I'll report the issue to the hardware designer. |
Thanks, I was concerned that it may be hardware related. Do you know if it is also OK on the S3 (I need the dual core)? |
I haven't received any comments from hardware team yet, seems it's an unknown bug, probably no work-around for this. If you only need to generated a sine wave from DAC module, is it possible to use the DAC cosine wave generator? You can have a try using the patch of the DAC driver-ng preview (based on master) You can check the dac examples in the patch to learn how to use it. |
Alas, no I cannot use the cosine generator. I'm generating low frequency tones of very precise frequencies .. https://en.wikipedia.org/wiki/Continuous_Tone-Coded_Squelch_System#List_of_tones |
Sounds like DAC DMA is the only solution, may I ask how low the frequency might be? According to my test, PLL can support down to 20KHz converting rate on ESP32, if it's not low enough, the one work-around could be duplicating the data meanwhile double the converting rate. |
the lowest is 67 Hz the highest 254 Hz. |
Is this a sine wave frequency or DAC conversion rate of each data? |
As far as I know, I am afraid the only possibility is to use an older version of idf. I am using Arduino as IDE. |
Additional information if you are not familiar with ESP32 and IDE Aduino When in Preferences del Arduino IDE you write (This is declared as the latest estable release) In case you need new ESP boards (i.e. ESP32 Adafruit feather V2) then you need to include in preferences Arduino IDE To be change in the Sketch with Board Manager 2.0.5 Good Luck! |
How old ? (what version works?) This is good news and means that it is not a hardware issue. Michael |
Dear Michael,
"How old ? (what version works?)" I cannot give you a precise answer.
I have been working the last two years with the so call IDF stable version (in Preferences) and the Board Manager 1.0.6 (captures attached) Board Adafruit Feather ESP32
Only when about two months ago I realized about the Board Adafruit Feather ESP32 V2 I bought this board for evaluation then I had to upgrade to the Development release and Board Manager 2.0.5
with this upgrade the behavior of my old Board Adafruit Feather ESP32 is not the same when using DMA DAC.
Good luck!
https://dl.espressif.com/dl/package_esp32_index.json
https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#windows-manual-installation
https://learn.adafruit.com/adafruit-esp32-feather-v2/arduino-ide-setup
De: Michael G. Katzmann ***@***.***
Enviado el: sábado, 08 de octubre de 2022 4:12
Para: espressif/esp-idf
CC: JoseEnriqueFA; Comment
Asunto: Re: [espressif/esp-idf] Internal DAC glitches using I2S ".use_apll = true" (IDFGH-7784) (Issue #9321)
As far as I know, I am afraid the only possibility is to use an older version of idf.
I am using Arduino as IDE. With the latest version if .use_apll = 1 the glitches appear. In this version of IDF .use_apll = false, no glitches appear. However with an older version of IDF and .use_apll = 1 these glitches do not appear.
How old ? (what version works?) This is good news and means that it is not a hardware issue.
I'm not using Arduino but straight C (as demonstrated in the example above)
Michael
—
Reply to this email directly, view it on GitHub <#9321 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AML3OVAEM7QSTLBKEDCFQJTWCDJ6VANCNFSM53DUPZDA> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AML3OVCETNKRONNFYIASRKDWCDJ6VA5CNFSM53DUPZDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJPKDD3Y.gif> Message ID: ***@***.***>
|
I have found this URL https://github.com/espressif/arduino-esp32/releases?page=1 ** When I use the "Release 1.0.6" in Arduino IDE I can use_"apll = 1" glitches free Best whishes **PD : Only FYI, I was looking for information in the WEB. |
HI,
I have found this URL https://github.com/espressif/arduino-esp32/releases?page=1 **
where you can read " <https://github.com/espressif/arduino-esp32/releases/tag/1.0.6> ESP32 Arduino Release 1.0.6 based on ESP-IDF v3.3.5"
When I use the "Release 1.0.6" in Arduino IDE I can use_"apll = 1" glitches free
Best whishes
José
**PD : Only FYI, I was looking for information in the WEB.
In the latest version ESP32 Arduino 2.0.5 based on ESP-IDF 4.4.2
I have identified two problems, I am investigating ...
De: Michael G. Katzmann ***@***.***
Enviado el: sábado, 08 de octubre de 2022 4:12
Para: espressif/esp-idf
CC: JoseEnriqueFA; Comment
Asunto: Re: [espressif/esp-idf] Internal DAC glitches using I2S ".use_apll = true" (IDFGH-7784) (Issue #9321)
As far as I know, I am afraid the only possibility is to use an older version of idf.
I am using Arduino as IDE. With the latest version if .use_apll = 1 the glitches appear. In this version of IDF .use_apll = false, no glitches appear. However with an older version of IDF and .use_apll = 1 these glitches do not appear.
How old ? (what version works?) This is good news and means that it is not a hardware issue.
I'm not using Arduino but straight C (as demonstrated in the example above)
Michael
—
Reply to this email directly, view it on GitHub <#9321 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AML3OVAEM7QSTLBKEDCFQJTWCDJ6VANCNFSM53DUPZDA> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AML3OVCETNKRONNFYIASRKDWCDJ6VA5CNFSM53DUPZDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJPKDD3Y.gif> Message ID: ***@***.***>
|
I am having a similar issue, where the I2S/DAC is now generating very noisy audio. I use the I2S to feed 8bit 22050Hz data to the DAC. On IDF version 4.2.2 this worked fine, but in 4.4.3 the sound quality is very bad. This would seem to indicate it is not a hardware issue, or if it is, some configuration in the IDF must have made it worse. Has any progress been made to identify the problem and come up with some work-arounds? |
When it has changed in a certain IDF version, you need to check that all parameters are being initialised correctly:
As an example of code that works, have a look at https://raw.githubusercontent.com/earlephilhower/ESP8266Audio/master/src/AudioOutputI2S.cpp
....
|
Environment
Problem Description
The output of the DAC is glitchy when the "use_apll" is set TRUE. It is very clean when the PLL is off (use_apll set to off).
For my application I must use the PLL. Without the PLL, the correct sampling frequency cannot be generated.
See the attached pictures. The glitches are random (non synchronous to the waveform and vary).
In the sample code I am generating two quadrature sinewaves at 100 Hz.
Expected Behavior
Clean signals generated at the DAC outputs corresponding to the digital values set
Actual Behavior
Random noise on DAC outputs
Steps to reproduce
Code to reproduce this issue
Here is a trace showing the glitches are random (non-periodic)
Here is a trace showing a close up of the glitches
again, the gliches to not occur if the clock is not using the PLL (indicating the code is good)
Michael
The text was updated successfully, but these errors were encountered: