5

All the tutorials around the topic are outdated, but following the general ideas of it I managed to get the RPI 3 receiving audio through bluetooth: The latest raspbian version at the moment, Jessie from May 16, brings every needed tool pre installed, so the only thing I had to do was to run pulseaudio and pair my device using bluetoothctl.

My problem is that the sound cuts intermittently (each 1-2 seconds) with a little noise in the background. After about 5-10 minutes the sound is muted completely.

The problem disappears if I use a bluetooth usb dongle, with which the sound is great and I tested it for more than an hour.

I tried to modify the config of pulseaudio changing the resampling method or other things that could be affecting the performance, but with no success.

So the problem here, I guess, is with the internal bluetooth. Is there any configuration I should check for the internal bluetooth? Is the internal bluetooth unable to accomplish this for some reason? Any other idea?

rodripf
  • 113
  • 1
  • 7
  • 1
    Try https://dbader.org/blog/crackle-free-audio-on-the-raspberry-pi-with-mpd-and-pulseaudio – ott-- Jul 04 '16 at 18:09
  • @ott-- Even thought I think it doesn't address the problem, I tried what says in the post, but with no improvement in my problem. Thanks anyway – rodripf Jul 06 '16 at 15:42
  • 1
    I think I'll do some tests from my end. Will keep you posted. – Aloha Jul 09 '16 at 11:57

3 Answers3

3

This is a known bug on the rpi3. internal Wifi and internal Bluetooth simultaneous usage will provoke crackling sound and sound disapearance. No fixes yet. https://github.com/raspberrypi/linux/issues/1402

Using a bluetooth dongle or Wi-Fi dongle resolve the problem.

2

Okay, I've done some tests.

  1. Setup:

    • Pi 3 without a heatsink, 1A power supply (artificial starvation, on purpose)
    • Fresh install of Raspbian Jessie Lite (downloaded a few minutes ago as of writing)
    • Samsung Galaxy S6 Duos
    • VLC player for Andorid
    • 320kbps HD copy of Tremor by Martin Garrix
    • 320kbps HD full copy of Tomorrowland 2014 @ Belgium (57min:11sec)
    • Modified version of this setup: https://raspberrypi.stackexchange.com/a/48055/24224
    • sysbench --test=fileio --num-threads=8 --file-total-size=1G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
    • sysbench --test=cpu --num-threads=64 --cpu-max-prime=20000 run
  2. Tests (while playing music):

    • Phone right on top of Pi
    • Phone ~1 meter away
    • Phone in kitchen (~5 meters away behind 2 thick concrete walls)
    • Phone inside cookie tin with sewing supplies ~1 meter away
    • Stress test CPU and File IO, 72 threads total

Findings:

  1. Connection very stable in all tests above
  2. pulseaudio at 5%-10% CPU usage according to top
  3. Sound quality 7/10. Perfect when listening at medium-high volume but slight/soft static noise when playing low-volume audio.

Conclusion: Either your device is causing it (very likely) or your Pi is defective (very unlikely).

Recommendations on what you should do:

  1. Check your device. Maybe it's causing issues, especially if it's Android
    • It's very possible that your phone CPU is throttling down, especially when screen-off
    • It's also very possible that your music player app gets killed, especially when screen-off
    • Source: Experience, and I'm also an Android developer.
  2. Try borrowing another phone. Test using that.
  3. Try to find and borrow another Pi 3. Maybe your Pi is defective.
  4. Do NOT fiddle with any pulseaudio settings (/etc/pulse/daemon.conf).
    • Set resample-method = trivial and that's it. Don't touch anything else.

Screenshots (since what stress test goes by without screenshots):

Preparation: enter image description here

Hammer time: enter image description here

Post-trauma: enter image description here

Aloha
  • 7,136
  • 1
  • 28
  • 52
  • Great answer! Thank you for your job! I'll try to follow your suggestions. I saw that post before, but I'll give it another shot.Perhaps is too much to ask... but could you create an image of your working rpi and upload it? – rodripf Jul 13 '16 at 22:34
  • @rodripf yeah, sure, although my internet connection isn't the strongest. I'll post a link here. – Aloha Jul 14 '16 at 04:01
  • @rodripf But I don't think it's necessary though. I followed the link in the answer up until aplay /usr/share/sounds/alsa/Front_Center.wav. From there, I went on my own. I think the most efficient way would be to write what I did instead. – Aloha Jul 14 '16 at 04:08
  • @rodripf http://pastebin.com/fLb5Xpkt – Aloha Jul 14 '16 at 06:18
1

In my case, the choppiness was due to the fact the bluetooth device scan kept running in the background and was never stopped. The choppiness disappeared once the scan was stopped using,

scan off

This was written after bluetoothctl was executed.

  • (using Elementary OS/Ubuntu, not raspberry pi, but this comes up on Google) I had to close out of the bluetooth settings GUI, which kept scanning for nearby devices – XMB5 Jul 21 '20 at 03:03