<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>RSS Feed for bluetooth - James Stone&apos;s Blog</title><description>Blog posts tagged with bluetooth</description><link>https://jamesst.one/</link><item><title>Bluetooth and Wi-Fi fight over 2.4GHz</title><link>https://jamesst.one/posts/bluetooth-wifi-coexistence/</link><guid isPermaLink="true">https://jamesst.one/posts/bluetooth-wifi-coexistence/</guid><description>&lt;![CDATA[&lt;p&gt;I have a phone running a &lt;a href=&quot;https://github.com/badaix/snapcast&quot;&gt;Snapcast&lt;/a&gt; client: it pulls synced audio over Wi-Fi and plays it out to a pair of Bluetooth headphones. It buffered constantly: a few seconds of audio, then a stall, then a reconnect.&lt;/p&gt;
&lt;p&gt;The Wi-Fi signal was excellent (RSSI -44), the server was idle, and the same stream played fine elsewhere, so naturally I blamed everything &lt;em&gt;except&lt;/em&gt; the obvious thing. Eventually I just pinged the server with Bluetooth on, then turned Bluetooth off and pinged again. Same Wi-Fi network, same location, seconds apart:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# Bluetooth ON (streaming to the headphones)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;10 packets transmitted, 8 received, 20% packet loss&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;rtt min/avg/max/mdev = 8.6/238.6/742.4/254.4 ms&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# Bluetooth OFF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;10 packets transmitted, 10 received, 0% packet loss&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;rtt min/avg/max/mdev = 7.4/9.1/10.8/0.9 ms&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The only variable was Bluetooth, and it took the link from a flawless 9ms to 238ms average with 20% loss.&lt;/p&gt;
&lt;p&gt;The cause is &lt;strong&gt;2.4GHz coexistence&lt;/strong&gt;. Bluetooth lives in the 2.4GHz band,&lt;sup&gt;&lt;a href=&quot;#user-content-fn-btband&quot; id=&quot;user-content-fnref-btband&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; and so did my Wi-Fi. On a phone the two typically share a single radio and antenna,&lt;sup&gt;&lt;a href=&quot;#user-content-fn-antenna&quot; id=&quot;user-content-fnref-antenna&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; so pushing audio &lt;em&gt;out&lt;/em&gt; over Bluetooth while pulling audio &lt;em&gt;in&lt;/em&gt; over 2.4GHz Wi-Fi means they have to take turns and they trample each other. Snapcast streams real-time PCM with a ~1s buffer;&lt;sup&gt;&lt;a href=&quot;#user-content-fn-snapcast&quot; id=&quot;user-content-fnref-snapcast&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; with packets arriving 250ms+ late and one in five dropped, the buffer starves and the client gives up and reconnects.&lt;/p&gt;
&lt;p&gt;The fix was to get Wi-Fi off the band Bluetooth is squatting on: &lt;strong&gt;move the phone to 5GHz&lt;/strong&gt;. Bluetooth stays on 2.4GHz, Wi-Fi moves up, and they stop fighting.&lt;/p&gt;
&lt;p&gt;There was one more gotcha. The 5GHz SSID didn’t even &lt;em&gt;show up&lt;/em&gt; in the phone’s Wi-Fi scans as the router had auto-selected channel 104, which &lt;a href=&quot;/posts/dfs-wifi-channels&quot;&gt;phones won’t see&lt;/a&gt;. I pinned the router’s 5GHz radio to channel 36 and the problem disappeared entirely:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;# 5GHz channel 36, Bluetooth still ON&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;12 packets transmitted, 12 received, 0% packet loss&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;rtt min/avg/max/mdev = 8.9/10.3/13.7/1.3 ms&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;10ms average, 1.3ms jitter, zero loss  with Bluetooth doing exactly what it was doing before. The audio has been rock solid since.&lt;/p&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot;&gt;&lt;h2 class=&quot;sr-only&quot; id=&quot;footnote-label&quot;&gt;Footnotes&lt;/h2&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-btband&quot;&gt;
&lt;p&gt;Bluetooth operates in the 2.4 GHz ISM band (2.400–2.4835 GHz), the same unlicensed band used by 2.4 GHz Wi-Fi. &lt;a href=&quot;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10255637/&quot;&gt;“Improved Spectrum Coexistence in 2.4 GHz ISM Band Using Optimized Chaotic Frequency Hopping for Wi-Fi and Bluetooth Signals”, &lt;em&gt;Sensors&lt;/em&gt; (NCBI/PMC)&lt;/a&gt;. &lt;a href=&quot;#user-content-fnref-btband&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;user-content-fn-antenna&quot;&gt;
&lt;p&gt;Phones commonly use a combined Wi-Fi/Bluetooth chip that shares a single antenna between the two radios, requiring time-division coexistence so they transmit in alternating time slots rather than simultaneously. &lt;a href=&quot;https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf/9130605&quot;&gt;“Systems and methods for coexistence between plurality of wireless communications modules sharing single antenna”, US Patent 9,130,605&lt;/a&gt;. &lt;a href=&quot;#user-content-fnref-antenna&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 2&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;user-content-fn-snapcast&quot;&gt;
&lt;p&gt;Snapcast reads PCM chunks from its source and tags them with server time for synchronized playback; its default read/buffer size is 1000 ms. Note that, while it supports an uncompressed &lt;code&gt;pcm&lt;/code&gt; codec, its default wire codec is FLAC rather than raw PCM. &lt;a href=&quot;https://github.com/snapcast/snapcast/blob/master/README.md&quot;&gt;Snapcast README — codecs and buffering&lt;/a&gt;. &lt;a href=&quot;#user-content-fnref-snapcast&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 3&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;]]&gt;</description><pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate></item></channel></rss>