-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Trying to establish a Stream from i2s to a2dp. #10
Comments
The copy is doing a read from I2SStream. If you check in the source, it uses a buffered read from I2S by calling i2s.readBytes(data, length); I think your example should work: I suggest to set the logging level to debug to find where the issue is.... |
Ah yes, I see it, good to know.
that the cycles aren't always the same or got mixed up isn't an issue, I guess, due to the speed, the print to Serial will surely do something wrong. And just to be sure, we are talking from the perspective of the ESP, when we send data. So RX means, that the ESP receives and TX that the ESP sends, right? Not that I got that mixed up. But in the Log, everything seems fine to met but the "a2dp_stream_source_sound_data 128 -> 0". |
I will look into this... |
I tried your code on my setup (DSP (i2s master) and ESP (i2s slave)) and got the same problem. But this code example was working, when the ESP was the master. I am using this code example where the i2s -> a2dp is over a callback function. |
Recently, I have changed the logic quite a bit:
I did not test it with this scenario - but with mp3 decoding from files and it is working like a charm |
Here is an improved sketch:
|
Thank you for putting so much work into it!
A few notes here:
|
Somehow is the logging the problem, it seems. |
The Log level should be at most Info - better Warning. Debug is giving too much info and the sound generation can not catch up... And thanks for your error report. I am working on OS/X and my file system is not case sensitive. So this is pretty difficult to catch. The corrections are now on Github... |
Do you know how to disable the logging? I'm glad that I can help |
I would recommend AudioLogger::instance().begin(Serial, AudioLogger::Warning) in the sketch |
Can you point me where? |
This is the ESP logging: in Arduino: |
Oh, so in Platformio it would be probably set in the .ini file. |
build_flags = -DCORE_DEBUG_LEVEL=5 I think 5 is debug |
So yeah, the ESP logging caused the error, I even got the stream, but my sound is super noisy and loud but also I hear my environment in the background. |
The default I2S format might not be fitting with your device |
Could you indicate how you solved your problem ? |
Yeah sure.
In my terminal snippet, you can see that it printed the function, but after that went mad.
There you see the line at the bottom "[D][BluetoothA2DPSource.cpp:111] BluetoothA2DPSource(): BluetoothA2DPSource, " and that the code line prints the value, but the code didn't go further.
The format issue I haven't tackled yet. |
So I tried different formats! |
@BirdLightning Sorry for commenting on closed issue. Can you share the configuration for SPH0645, I have tried with I2S_MSB_FORMAT but i only get noise. |
Hello,
first of all, thanks for those awesome tools!
As the title says, I'm trying to establish a stream between i2s (in) and a2dp (out).
In the folder sandbox, there already is an example that won't work, at least not for me. With help of the working example, which is the other way round, I was able to build it.
As I was trying to understand the code, what does what, and so on, I stumbled over one thing I don't understand.
In the Class I2SStream and the object that calls ".begin" is just installing the drivers and configurations for the I2S.
The Class A2DPStream an the object that calls ".begin" is connecting to the Bluetooth device and opens a useable connection.
The copier in the loop is doing two channels out of one from the Streams I defined as input and output.
The question I got is, where happens the "read" of the actual data from the I2S. I have to read the data at some point, with something like "i2s.read()", which I could find in some classes, but I didn't get if the code is already using the i2s.read somewhere and the problem is actually a different one.
I'll put my sketch in as a reference so that you know what I'm talking about. :)
The text was updated successfully, but these errors were encountered: