-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Noise of the Bluetooth HFP via I2S (IDFGH-5488) #7222
Comments
Hi, I look forward to hearing from you. |
Hi, @m-kiso Different codecs have different sampling rates. The sampling rate using CVSD codec is 8k, and the sampling rate using mSBC codec is 16K. If ESP32 is used as I2S slave, you need to pay attention to the problem of data format (big-endian or little-endian). Thanks |
Hi, @xiongweichao Thank you for your reply. I have the following configuration and I want to skip the audio data, but I hear noise in the headset. [STM32] ---(CVSD 8kHz , 16bit , mono )---> [ESP32] ---( Bluetooth HFP)---> [Headset] Also, I have written the source as attached, but I cannot come up with a source to convert the frequency. audio_gateway\src\main.c
audio_gateway\src\i2s_ctrl.c
audio_gateway\src\bt_ctrl.c
Regards, |
Hi, @xiongweichao Thank you for your reply. I don't know what this data format (little-endian or big-endian) is, because the audio data is output from the customer's STM32. We are checking now. What I want to know in a hurry is what kind of conversion expression source I should write for the following configuration. [STM32] ---(CVSD 8kHz , 16bit , mono )---> [ESP32] ---(Bluetooth HFP)---> [Headset]. Regards, |
Hi, @m-kiso Please try to modify the value of I2S_BUFFER_SIZE to be greater than 240. If it still doesn't work, please try the following code if it can solve your problem.
Thanks |
Hi, @xiongweichao Thank you for your prompt reply! Thanks, |
Hi, @xiongweichao I haven't changed the I2S_BUFFER_SIZE yet, but I did printf the data acquired by I2S and graphed it, and found that it was being sent in a digital data-like format. How should I convert this data if I send it via HFP? Thanks, |
Hi, @xiongweichao
If you have a next move, please let me know. Thanks, |
Hi, @xiongweichao Is there an update on this? Thanks, |
Hi, @m-kiso Is Thanks |
Hi, @xiongweichao Yes, I do use bt_ctrl_play. Thanks, |
Hi, @m-kiso But in the source code you provided, I didn't see you using bt_ctrl_play. Thanks |
Hi, @xiongweichao Thank you for your prompt reply! I apologize for the lack of explanation regarding bt_ctrl_play.
Please tell me, did you check the audio in Thanks, |
Hi, @m-kiso
Thanks |
Hi, @xiongweichao I have some good news. I think I've solved this problem.
I'm not sure why the problem was solved by shifting the upper bits, but this problem can be closed. Thank you for your support. |
@m-kiso Thanks for reporting and sharing updates, and glad the issue resolved, feel free to reopen. |
Hello @m-kiso, did you make any changes to the original |
Environment
Hardware: ESP32-WROOM-32E
Software: esp-idf V4.3
Example project: \esp32\examples\bluetooth\bluedroid\classic_bt\hfp_ag
Problem Description
I has succeeded playing a sine audio in the Example project.
So I try to read audio data from I2S and send to the bluetooth HFP(HCI protocol).
I changed bt_app_hf.c in the Example project.
I take audio data from i2s_read() and put s_m_rb(RingBuffer) instead of bt_app_hf_create_audio_data().
Then, I heard only noise.
What should I do?
Code to reproduce this issue
I2S config is
The text was updated successfully, but these errors were encountered: