# Balena sound audio stuttering and bluetooth constantly disconnecting and reconnecting

**URL:** <https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827>\
**Category:** Project help\
**Tags:** support\
**Created:** [April 28, 2020, 10:14pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827 "2020-04-28T22:14:20Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 22, 2020, 8:41pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/40 "2020-09-22T20:41:04Z")

</div>

Sure! Do you want me to collect the logs from `/var/log/journal/b993ce325b5f4aefa301d8b5e0e048ee` after enabling `AUDIO_LOG_LEVEL` to `DEBUG` ?

One more question, how do I capture the running logs e.g. something like `tail -f abc.log`?

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [September 22, 2020, 8:48pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/42 "2020-09-22T20:48:03Z")

</div>

Hi Alok , my guess is that @tmigone would have meant for you to grab logs from the `bluetooth` and/or `audio` service containers so no need to get anything from the journal. You can probably just enable that `AUDIO_LOG_LEVEL` == `DEBUG` on the device and then from the device dashboard click the little download logs button at the top right of the logs window.

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 22, 2020, 9:05pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/44 "2020-09-22T21:05:30Z")

</div>

Thanks!  
Added the log level to debug.

 ![image](https://global.discourse-cdn.com/balena/original/2X/9/95c41b2264b1c56d30300f32658d74af0951209f.png)

And here is the log downloaded from the dashboard.

> **[balenasound\_restless-sea-22.09.20\_14\_02\_43\_(-0700).txt](https://drive.google.com/file/d/1DxweeVM-XShlhv-8olrtchIBGEj5jJO0/view?usp=sharing)**
>
> Google Drive file.

Note - This log was collected after bluetooth would have connected and disconnected at least 10 times.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [September 22, 2020, 9:14pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/45 "2020-09-22T21:14:01Z")

</div>

Thanks for the logs it looks odd that a bunch of the services keep restarting over and over. Can you run the diagnostics check on this device (you can find it on the left hand menu in our dashboard) and post the results here if there are any failures.

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 22, 2020, 9:20pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/46 "2020-09-22T21:20:30Z")

</div>

These were restarted because I changed the `AUDIO_LOG_LEVEL` == `DEBUG` and before that, I did restart it for some other reason. One thing I noticed is, while Bluetooth was getting connected/disconnected, I could not see anything changing in the dashboard log console.

Here is the output from “Device diagnostics”

 ![image](https://global.discourse-cdn.com/balena/original/2X/3/3ee37e6403c1a78372faf58de62f4fba9900d8f5.png)

> **[2828aa082170141fc98147a07b789249\_2020.09.22\_21.17.43+0000.txt](https://drive.google.com/file/d/1B6THxH5yNVq2wQn8u1uBN9RilXD3U-Zp/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![tmigone](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tmigone/32/2814_2.png) [@tmigone](https://forums.balena.io/u/tmigone)\
**Post date:** [September 22, 2020, 9:55pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/47 "2020-09-22T21:55:46Z")

</div>

Hey thanks for the logs. I don’t see anything really suspicious other than the services restarts, but that wouldn’t cause 10 connect/disconnect events. What timeframe are we talking about for those 10 times? Was that over a few minutes?

The fact that the bluetooth container logs nothing while the disconnects are happening makes me think of hardware issues. We can maybe look into `dmesg` logs to see if there is anything there. Can you provide that log? You’ll need to run `dmesg` on the hostOS. If you have additional hardware you can also try to test with it. For example, using a bluetooth dongle if you have one, or trying with a different Raspberry Pi?

Also, for posterity, the env var `AUDIO_LOG_LEVEL` was introduced in balenaSound version 3.0 so in your case it didn’t matter.

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 22, 2020, 10:23pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/50 "2020-09-22T22:23:01Z")

</div>

Thanks for the details. I have already tried it with another raspberry pi 4 and another SD card, nothing changed.

Connect and disconnect would have happened over a few mins. This can be easily seen in the journal log I posted earlier.

### [journal\_b993ce325b5f4aefa301d8b5e0e048ee](https://docs.google.com/document/d/1jPryy3ffchclyYUtUigDBHAYihPGxIiNVoDamMF0gAs/edit?usp=sharing)

```
Sep 22 18:24:54 2828aa0 bluetoothd[1543]: connect error: Connection timed out (110)
.
Sep 22 18:27:06 2828aa0 bluetoothd[1543]: connect error: Connection timed out (110)
.
Sep 22 18:30:06 2828aa0 bluetoothd[1543]: connect error: Connection timed out (110)
.
Sep 22 18:35:13 2828aa0 bluetoothd[1543]: connect error: Connection timed out (110)
.
.
Sep 22 18:37:08 2828aa0 bluetoothd[1543]: connect error: Connection timed out (110)

```

Here is the output from of `dmesg`

> **[dmesg](https://docs.google.com/document/d/1JqIQYZ30kqAWyyiySOQ68n5SpOYkYUlJfqpYwebJUV0/edit?usp=sharing)**
>
> ============================================================= Welcome to balenaOS ============================================================= root@2828aa0:~# dmesg \[0.000000\] Booting Linux on physical CPU 0x0000000000 \[0x410fd083\] \[ ...

One more point I mentioned earlier, but I guess its worth mentioning again - Bluetooth works with NO issues when I am streaming music. As soon as I pause or stop the music, it starts getting disconnect/connect.

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [September 23, 2020, 12:06am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/51 "2020-09-23T00:06:35Z")

</div>

Just another idea to rule out wireless signal/noise/interference issues, can you try installing [hcitool](https://unix.stackexchange.com/a/393497/78029) and check what the signal quality is like?

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [September 23, 2020, 12:22am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/52 "2020-09-23T00:22:05Z")

</div>

Also, I can see in the `dmesg` logs, that there are 74 bluetooth devices with the same mac `A8:87:B3:31:64:9D`. That doesn’t look right. Do you know what device this MAC is associated with?

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [September 23, 2020, 12:23am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/53 "2020-09-23T00:23:32Z")

</div>

Presumably that the Samsung phone you are pairing with the Pi. Can you try to reset the BT peering cache and pair the device only once?

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 23, 2020, 2:06am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/55 "2020-09-23T02:06:52Z")

</div>

Okay. Sure!

1 - For signal strength, how do I get the Bluetooth address?

2 - Regarding MAC address - As per the dashboard DC:A6:32:BF:11:CC is the MAC address. Not sure why it’s appearing twice.

 ![image](https://global.discourse-cdn.com/balena/original/2X/2/233b04562a4a03a1fd885e9521e82bffab8dafe7.png)

3 - Yes, the device I am using most of the time is Samsung S10. Cleared the Bluetooth cache, still no impact.  
I have tried it with a Macbook Pro and an iPhone XS and observed the same behavior.

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 23, 2020, 2:13am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/56 "2020-09-23T02:13:02Z")

</div>

One more point - While I was there checking “Device diagnostics”, I checked “Device health check” as well. I see 2 errors. Not sure if these can cause Bluetooth issue. Just wanted to highlight.

 ![image](https://global.discourse-cdn.com/balena/original/2X/0/096280b977e43337f7a0393ffa7ee5d0f5f4d2a8.png)

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 23, 2020, 2:45am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/57 "2020-09-23T02:45:46Z")

</div>

Okay. So I flashed another SD card with the same build; check\_localdisk error is gone, however, I am still getting -

```
 Some networking issues detected: 
test_balena_registry: Could not communicate with for authentication

```

 ![image](https://global.discourse-cdn.com/balena/original/2X/0/06baee046ccccdd283d9f76af9cbf5f77907cf82.png)

---

<div class="post-metadata">

**Author:** ![kaisoz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/kaisoz/32/3570_2.png) [@kaisoz](https://forums.balena.io/u/kaisoz)\
**Post date:** [September 23, 2020, 8:23am UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/59 "2020-09-23T08:23:00Z")

</div>

Hi!!

> 1 - For signal strength, how do I get the Bluetooth address?

You can run `hcitool dev` and it’ll show the local Bluetooth device along with its address. In order to check a connection signal strength, run `hcitool rssi <CONNECTED DEVICE MAC>`

> 2 - Regarding MAC address - As per the dashboard DC:A6:32:BF:11:CC is the MAC address. Not sure why it’s appearing twice.

They are not the same (the last letter changes ;-)) This should be showing the MAC address of your ethernet and wifi adapters.

> One more point - While I was there checking “Device diagnostics”, I checked “Device health check” as well. I see 2 errors. Not sure if these can cause Bluetooth issue. Just wanted to highlight.

The `check_localdisk` error was warning you that the SD card was starting to fail, so it was a good thing that you replaced it :). However, the `check_networking` error indicates that your network configuration is not meeting Balena apps requirements. Please make sure that your network setup is as this guide: [Network Setup on balenaOS - Balena Documentation](https://www.balena.io/docs/reference/OS/network/2.x/#network-requirements)

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 24, 2020, 3:56pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/61 "2020-09-24T15:56:06Z")

</div>

Thanks kaisoz.

For signal strength, I can’t get it working …

root@eb67f67:~# hcitool rssi DC:A6:32:BF:11:CC  
Not connected.  
root@eb67f67:~# hcitool rssi DC:A6:32:BF:11:CE  
Not connected.  
root@eb67f67:~#

The `check_localdisk` error - can this impact Bluetooth? Also, not sure if I understood the instructions given on the URL. It says whitelist a list of domains but where? on my router, browser, or on my laptop?

`Each of these should work with outward only (and inward once outward connection established) firewall settings. Additionally, the NTP ( `123`) and DNS (`53` ) ports may be blocked if a local NTP and DNS server are provided.`

What does it mean, what I am supposed to do with this? These are probably too technical for me ☹

---

<div class="post-metadata">

**Author:** ![jtonello](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jtonello/32/3246_2.png) [@jtonello](https://forums.balena.io/u/jtonello)\
**Post date:** [September 24, 2020, 5:09pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/64 "2020-09-24T17:09:49Z")

</div>

Hi,

The whitelisting is done with the `hcitool` as in `hcitool lewladd <url>`…done on the command line of the HostOS.

John

---

<div class="post-metadata">

**Author:** ![alok.span](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@alok.span](https://forums.balena.io/u/alok.span)\
**Post date:** [September 26, 2020, 8:23pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/66 "2020-09-26T20:23:57Z")

</div>

Okay. So I whitelisted it.

```
=============================================================
    Welcome to balenaOS
=============================================================
root@eb67f67:~# hcitool lewladd https://dashboard.balena-cloud.com/devices/eb67f67d4cb9b4a772301e214948ef9a/summary
root@eb67f67:~# 
root@eb67f67:~#

```

But I am still getting that error. More importantly, do you really think this error has anything to do with the Bluetooth issue I mentioned? I will let you guys decide on that but I think this debugging is going in another direction 🙂

 ![image](https://global.discourse-cdn.com/balena/original/2X/a/a573374ccb6b7b3c51f1a4a6c294a13095d9334b.png)

---

<div class="post-metadata">

**Author:** ![ab77](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ab77/32/2870_2.png) [@ab77](https://forums.balena.io/u/ab77)\
**Post date:** [October 2, 2020, 11:29pm UTC](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827/67 "2020-10-02T23:29:57Z")

</div>

You could try moving the device around the room to see if any of the observed behaviours change. The other thing to try is to re-flash it and start from the beginning.

[Previous page](https://forums.balena.io/t/balena-sound-audio-stuttering-and-bluetooth-constantly-disconnecting-and-reconnecting/101827.md?page=1)
