Page 1 of 1

Bluetooth/WiFi conflict

Posted: Wed Sep 12, 2018 7:12 pm
by sagarpi
I have turned my raspberry pi into a bluetooth audio receiver following this thread.Got it working after awhile, only problem is that the audio skips/stutters every 5 seconds. I found out that its caused by the WiFi and Bluetooth running at the same time. When I manually switch off WiFi whenever I play music it the audio plays fluently, however its just tiring having to do that every time and then having to power-reboot my pi to get WiFi up again.
A simple solution for me would be to listen to the bluetooth interface and having a script run that disables WiFi when a device connects via bluetooth with my pi and enables WiFi again once the device disconnects. Its a little ironic that I call this solution simple since I actually have no idea how to go about it. I am currently working off the thread below to code my own program. Douglas6 suggests monitoring the the dbus system for bluez messages, and reacting to them. However I don't have any knowledge about that stuff. Could you guys tell if i am on the right path, or maybe someone even knows a better and/or already existing solution?
    Thanks in advance :)

    Re: Bluetooth/WiFi conflict

    Posted: Wed Sep 12, 2018 7:47 pm
    by Douglas6
    If you want to determine when a Bluetooth device connects or disconnects, listening to the D-Bus signals is probably your best bet.

    What model Pi are you using? I was hoping they solved the Bluetooth/WiFi issues with the 3B+.

    Re: Bluetooth/WiFi conflict

    Posted: Thu Sep 13, 2018 8:19 pm
    by sagarpi
    just checked, I am using Model B, should have considered that when i bought it, how sure are you the B+ resolves the issue? might just buy it again. From the github thread this guy says the b+ doesnt work for him, where as this guy says b+ works.

    Re: Bluetooth/WiFi conflict

    Posted: Thu Sep 13, 2018 8:29 pm
    by Douglas6
    Not at all sure, to be honest. I have not tried it on my Pi3B+ (actually, I might have, briefly, and didn't see a problem; no promises, though) . There seem to be fewer complaints on this forum, is all. A cheaper solution would be to purchase a USB Bluetooth dongle, and disable the onboard one. On the other hand, what could be the possible downsides of owning an extra Pi?

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 2:36 am
    by HawaiianPi
    I have used both a Pi3B and 3B+ on my Bluetooth speakers and never got satisfactory results. I don't recall issues with music playback, but videos were always out of sync with the sound. No such problems with my Windows 10 laptop or Android phone.

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 2:50 am
    by Douglas6
    I've experienced the same kind of out-of-sync with video. And not only on the Pi. My advice: don't expect video and audio synchronization ever, using Bluetooth. Just don't.

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 4:36 am
    by HawaiianPi
    Douglas6 wrote:
    Fri Sep 14, 2018 2:50 am
    I've experienced the same kind of out-of-sync with video. And not only on the Pi. My advice: don't expect video and audio synchronization ever, using Bluetooth. Just don't.
    As I said above, it works fine with my Android phone and Win10 laptop. No audio/video sync issues with either.

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 7:38 pm
    by sagarpi
    Douglas6 wrote:
    Thu Sep 13, 2018 8:29 pm
    A cheaper solution would be to purchase a USB Bluetooth dongle, and disable the onboard one
    Wheres the fun it that lol. Id rather code a solution
    cheers

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 7:49 pm
    by Douglas6
    More power, Bro.

    Re: Bluetooth/WiFi conflict

    Posted: Fri Sep 14, 2018 8:19 pm
    by LTolledo
    At the moment my policy on this is:

    "If you WiFi... don't Bluetooth! If you Bluetooth.... don't WiFi!"
    ;)