Skip to content
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

Weird noises when playing music from Spotify or YouTube #485

Closed
1 task done
Razzorback225 opened this issue Oct 6, 2023 · 10 comments
Closed
1 task done

Weird noises when playing music from Spotify or YouTube #485

Razzorback225 opened this issue Oct 6, 2023 · 10 comments

Comments

@Razzorback225
Copy link

Razzorback225 commented Oct 6, 2023

Problem Description

Hi all,

I just tested the library today in a hurry and I just use a old board that I developped a few years ago.
This board uses a ESP32-WROOM32D module and I soldered a 3.5mm audio jack to the pins 25 and 26 of the module.
The Bluetooth part seems to work as I can connect to the ESP32, but the audio out is not working properly.
I captured what I can hear when plugin some earphones or speaker to the 3.5mm audio jack. Sound

I used the latest release of the library.

Device Description

Custom ESP32 board using an ESP32-WROOM32D (4MB of Flash)
IMG_20231006_151717590
IMG_20231006_151725612

Sketch

Sketch used comes from the examples folder of the Github.

Other Steps to Reproduce

No response

Provide your Version of the EP32 Arduino Core (or the IDF Version)

Arduino ESP32 Core version 2.0.1

I have checked existing issues, discussions and online documentation

  • I confirm I have checked existing issues, discussions and online documentation
@pschatzmann
Copy link
Owner

pschatzmann commented Oct 7, 2023

I am hardly hearing anything.

  • Did you try to increase the volume on the phone or by calling set_volume() ?
  • Looking at your picture, I can't see the ground connection to the audio jack

I just recently retested the analog output with this board and it was working perfectly

@Razzorback225
Copy link
Author

@pschatzmann Yeah sorry for that I tried to be as close as possible of the earphones when I recorded the sample.

I set the volume at max level on my phone when I tried but not in the code.

The jack is connected to ground through the PTH at its right. It is connected to ground.

The board you mentionned is the one with Yellow mask and TFT or the one above?

@pschatzmann
Copy link
Owner

pschatzmann commented Oct 9, 2023

The one with the TFT screen is using the internal DAC of the ESP32 with an amplifier to output audio.
To be honest I tested it with my AudioTools. Maybe it helps if you do some tests

Try to change it to use 44100 on 2 channels!

@mrhempman69
Copy link

mrhempman69 commented Oct 17, 2023

What is the phone that you are using? Did you try anything else besides Spotify and YouTube? I'm just asking why they were specified in the title specifically

See also: #495

@Razzorback225
Copy link
Author

@mrhempman69

Sorry for the late answer.

I've got an android phone (a Motorola Edge).
I'did not try anything else than these 2 applications.
I put them in the title because they are the 2 applications I used to test the setup.

@pschatzmann
Copy link
Owner

Maybe is it just noise from your power supply ?
Did you try to power it from an (e.g. laptop) battery

@Razzorback225
Copy link
Author

I also tried to power it from 5V coming from USB to UART adapter but it makes no changes.

The sound I add to this topic is the only thing that comes out of the speakers when I play a song on my phone. There is no music just this sound

@pschatzmann
Copy link
Owner

Did you try another ESP32 to figure out if the issue is your phone or your Processor ?
Did you run the test sketch to figure out if the issue is with the A2DP library ?

@Razzorback225
Copy link
Author

I did not tried yet on another ESP32 due to missing components.

I run the test sketch for internalDac and this was not working but I cannot guarantee that this does not have to do with my setup.

I tryied the library with an I2S DAC (PCM5102A) using a custom pin assignement and It worked like a charm.

Once I'll have all the component I'll try again.

@CC0126
Copy link

CC0126 commented Feb 3, 2024

I face this problem too
This is due to the lack of CPU processing ability or the BREDR signal quality difference leading to the loss of blue sound frequency, different solutions:

  1. Setting CPU speed at least 160MHz or higher (recommended 240MHz)
  2. Increased DMA Buffer length like .dma_buf_len = 256,
    3.Increasing TX power by using esp_bredr_tx_power_set(ESP_PWR_LVL_P9, ESP_PWR_LVL_P9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants