Comments (7)
I confirm this bug, at least when trying to use I2S via an external audio output function.
Weird things:
- an analogWrite in
audioOutput
seems to work (PWM frequency is to low thought), does not hang - putting the I2S output function in
updateAudio
works (but not clean as this function can be called in burst) - putting the I2S output function in a user defined
audioOutput
works for approx 0.5s, then makes weird signal (random) and then hang the whole chip. The weird signal actually looks like what we got when the conflict on IRQ with the I2S was not solved yet.
I have to say that I really do not have any idea of why this is happening… Especially as the I2S (did not try SPI) works inupdateAudio
I kind of rule out an I2S problem, why putting it inaudioOutput
changes something?
Any idea?
from mozzi.
So what you tested is essentially that you took the code for EXTERNAL_DAC_VIA_I2S but placed it in a custom audioOutput(), instead? And in that case is does not work? Weird.
One idea: Could it be that the speed of the I2S does not quite match the rate at which audioOutput() gets called? Perhaps the buffer is getting overcrowed, eventually resulting in a hang? If that is the issue, checking i2s.availableForWrite()
should help.
from mozzi.
So what you tested is essentially that you took the code for EXTERNAL_DAC_VIA_I2S but placed it in a custom audioOutput(), instead? And in that case is does not work? Weird.
Yup.
I do not really care about getting it to work with I2S (as this is already implemented in "hardware") but there was a report of a similar problem on the forum with I2C, which triggered me to test the EXTERNAL_AUDIO_OUTPUT
on RP2040 (did you try?).
That being said, I2C is usually too slow to sustain an AUDIO_RATE
, so it might be the same problem. Will try one of these days with SPI emulating I2S (without buffer) to see if this error remains.
from mozzi.
Okay, using i2s.availableForWrite()
as a crude test seems to work (with a few glitches because of the two buffers probably not running exactly at the same time, that is not an optimal situation).
So closing this for now.
from mozzi.
Ok, actually, I think setting BYPASS_MOZZI_OUTPUT_BUFFER is the "clean" way to go in this situation, then. That makes sense, too, as the whole trouble is that there already is another buffer at work.
from mozzi.
Yeah, but I think there is no need to have this work cleanly with I2S as it is ported already. This was just a mockup test to see if the EXTERNAL_AUDIO
was working (and I had this DAC wired on my breadboard ;) ).
from mozzi.
Sure, I was just saying this for completeness (and because I had sort of forgotten that we already have a ready solution for dealing with the case of an independent output buffer somewhere).
from mozzi.
Related Issues (20)
- 16 bit wavetable support HOT 16
- Teensy LC: conflict between I2C and ADC HOT 16
- Ambiguity in `fromAlmostNBit` for 32bits platforms HOT 4
- ESP32 Input audio HOT 5
- Problem installing under Arduino ise 2.0.0-rc HOT 4
- LowPassFilter coefficients incorrectly calculated HOT 4
- Audio Input causing high Frequency feedback (over time)
- Wavefolder HOT 5
- Add note to installation instructions not to use Releases versions HOT 1
- Teensy 4.1 high definition circuitry HOT 1
- StateVariable centre frequency depends on Q HOT 3
- Hardware support for the PicoADK RP2040 DSP Board HOT 7
- rPi Pico RP2040 Documentation HOT 3
- Conflict between StateVariable and ResonantFilter enum filter types HOT 3
- multiline2.h non-functional? HOT 2
- Make new release HOT 15
- triangle warm 8129 table includes values outside valid range HOT 1
- Arduino giga port HOT 4
- getAudioInput not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mozzi.