sagarpi
Posts: 5
Joined: Sat Mar 17, 2018 12:27 pm

Bluetooth/WiFi conflict

Wed Sep 12, 2018 7:12 pm

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 :)

    User avatar
    Douglas6
    Posts: 4456
    Joined: Sat Mar 16, 2013 5:34 am
    Location: Chicago, IL

    Re: Bluetooth/WiFi conflict

    Wed Sep 12, 2018 7:47 pm

    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+.

    sagarpi
    Posts: 5
    Joined: Sat Mar 17, 2018 12:27 pm

    Re: Bluetooth/WiFi conflict

    Thu Sep 13, 2018 8:19 pm

    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.

    User avatar
    Douglas6
    Posts: 4456
    Joined: Sat Mar 16, 2013 5:34 am
    Location: Chicago, IL

    Re: Bluetooth/WiFi conflict

    Thu Sep 13, 2018 8:29 pm

    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?

    User avatar
    HawaiianPi
    Posts: 2903
    Joined: Mon Apr 08, 2013 4:53 am
    Location: Aloha, Oregon USA

    Re: Bluetooth/WiFi conflict

    Fri Sep 14, 2018 2:36 am

    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.
    My mind is like a browser. 27 tabs are open, 9 aren't responding,
    lots of pop-ups...and where is that annoying music coming from?

    User avatar
    Douglas6
    Posts: 4456
    Joined: Sat Mar 16, 2013 5:34 am
    Location: Chicago, IL

    Re: Bluetooth/WiFi conflict

    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.

    User avatar
    HawaiianPi
    Posts: 2903
    Joined: Mon Apr 08, 2013 4:53 am
    Location: Aloha, Oregon USA

    Re: Bluetooth/WiFi conflict

    Fri Sep 14, 2018 4:36 am

    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.
    My mind is like a browser. 27 tabs are open, 9 aren't responding,
    lots of pop-ups...and where is that annoying music coming from?

    sagarpi
    Posts: 5
    Joined: Sat Mar 17, 2018 12:27 pm

    Re: Bluetooth/WiFi conflict

    Fri Sep 14, 2018 7:38 pm

    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

    User avatar
    Douglas6
    Posts: 4456
    Joined: Sat Mar 16, 2013 5:34 am
    Location: Chicago, IL

    Re: Bluetooth/WiFi conflict

    Fri Sep 14, 2018 7:49 pm

    More power, Bro.

    LTolledo
    Posts: 736
    Joined: Sat Mar 17, 2018 7:29 am

    Re: Bluetooth/WiFi conflict

    Fri Sep 14, 2018 8:19 pm

    At the moment my policy on this is:

    "If you WiFi... don't Bluetooth! If you Bluetooth.... don't WiFi!"
    ;)
    "Don't come to me with 'issues' for I don't know how to deal with those
    Come to me with 'problems' and I'll help you find solutions"

    Some people be like:
    "Help me! Am drowning! But dont you dare touch me nor come near me!"

    Return to “Beginners”