Foreword: I have been dealing with choppy, stuttering, crackling bluetooth audio for the last couple years (particularly with bluetooth earbuds). This timeframe includes both a RPI-4 and for the last couple months, my brand new RPI-5. My experience have been very erratic. Sometimes i had better connections and sometimes i had very bad connections.
Before telling you what i have changed to make things better, let me also tell you that, it has also been impossible for me to use a 40mhz wifi channel in the past, before actually making this change. When i switched to a 40mhz channel with my Pi, i would have intermittent cut offs to my internet connection. There would be no sign of disconnection, but my upload and download would go to "0" for some time frame, and come back after a while. To my surprise, i can now use a 40mhz wifi channel and my throughput is so much faster. Bluetooth audio issues, although still present, have been greatly reduced to a level of small glitches which are rare and far in between.
So, after giving you the context, let me tell you what i did change. I urge you to try and see for yourself, if you have such issues with bluetooth and wifi. It might not work for you, but it is a revertible and simple modification.
For different Raspberry Pi versions (ie. different wifi/BL chips), the file that you need to modify is different. The files are all located in "/usr/lib/firmware/brcm/". The good news is, there are "soft links" to the correct txt file (within the same folder) with the Pi version attached to the name of the file, so you can easily know which file you need to modify.
In my case (RPI-5), the file was "brcmfmac43455-sdio.txt" (it is the same file for RPI-4).
Within this file, there is this section:
The first line "btc_mode=1" is duplicated in another part of the same file (i think this is a mistake):
Now these lines were added to remedy a potential wifi/bluetooth interference. If you google these lines, these forum posts come up (including some github bug reports):
https://community.infineon.com/t5/AIROC ... m-p/379269
https://community.infineon.com/t5/AIROC ... m-p/391400
I think Infineon is owned by the people who issued the firmware for the particular chip that is used in our Pis.
To my understanding, "btc_mode" line determines which function will get priority:
"btc_mode"
I have changed its value to "4". As i have said, this line is "duplicated" so i have erased the other one. Now i have:
"btc_mode=4" and the others (btc_params..........) are disabled (with a #).
My bluetooth audio experience is so much better. My wifi throughput is faster, and i can actually use a 40mhz channel.
Try it if you have similar issues and let me know if things got better for you too. If it doesn't work, you can always change the file to its original state.
The fastest speed test result i have ever received using wifi on my Pi-5 (and even Pi-4 before that). I could only achieve this after making this modification. (My internet is 50mbit by the way)
Before telling you what i have changed to make things better, let me also tell you that, it has also been impossible for me to use a 40mhz wifi channel in the past, before actually making this change. When i switched to a 40mhz channel with my Pi, i would have intermittent cut offs to my internet connection. There would be no sign of disconnection, but my upload and download would go to "0" for some time frame, and come back after a while. To my surprise, i can now use a 40mhz wifi channel and my throughput is so much faster. Bluetooth audio issues, although still present, have been greatly reduced to a level of small glitches which are rare and far in between.
So, after giving you the context, let me tell you what i did change. I urge you to try and see for yourself, if you have such issues with bluetooth and wifi. It might not work for you, but it is a revertible and simple modification.
For different Raspberry Pi versions (ie. different wifi/BL chips), the file that you need to modify is different. The files are all located in "/usr/lib/firmware/brcm/". The good news is, there are "soft links" to the correct txt file (within the same folder) with the Pi version attached to the name of the file, so you can easily know which file you need to modify.
In my case (RPI-5), the file was "brcmfmac43455-sdio.txt" (it is the same file for RPI-4).
Within this file, there is this section:
Code:
# Improved Bluetooth coexistence parameters from Cypressbtc_mode=1btc_params8=0x4e20btc_params1=0x7530btc_params50=0x972c
Code:
#XTAL 37.4MHzxtalfreq=37400btc_mode=1
https://community.infineon.com/t5/AIROC ... m-p/379269
https://community.infineon.com/t5/AIROC ... m-p/391400
I think Infineon is owned by the people who issued the firmware for the particular chip that is used in our Pis.
To my understanding, "btc_mode" line determines which function will get priority:
So, i "commented out" (put a # to the beginning of the lines) the lines that start with "btc_params" as i could not find any info on how to modify them. These lines, "i assume" determine the switching of priority in cases of varied throughput for bluetooth and wifi. The line that is important and i think more "impactful" is the first line.btc_mode 1 means Full TDM mode, When one side has priority, it has full control of the shared resource.
btc_mode 5, Some simultaneous activities are allowed.
btc_mode 4, BT is always allowed to use the medium. WLAN keeps the normal activity.
"btc_mode"
I have changed its value to "4". As i have said, this line is "duplicated" so i have erased the other one. Now i have:
"btc_mode=4" and the others (btc_params..........) are disabled (with a #).
My bluetooth audio experience is so much better. My wifi throughput is faster, and i can actually use a 40mhz channel.
Try it if you have similar issues and let me know if things got better for you too. If it doesn't work, you can always change the file to its original state.
The fastest speed test result i have ever received using wifi on my Pi-5 (and even Pi-4 before that). I could only achieve this after making this modification. (My internet is 50mbit by the way)
Statistics: Posted by jason_kidd — Sun Mar 24, 2024 6:39 pm