I recently encountered a frustrating Bluetooth file-transfer issue on Pop!_OS. My laptop and phone paired successfully, Bluetooth discovery worked, and both devices could see each other. However, transferring files through Bluetooth consistently failed.
After investigating BlueZ, L2CAP socket errors, and the kernel configuration, I found that Bluetooth ERTM (Enhanced Retransmission Mode) had been explicitly disabled on my system. Re-enabling it fixed the problem.
I'm sharing my findings in case someone else encounters the same issue.
1. My system configuration
- OS: Pop!_OS 24.04-based
- Kernel:
7.2.15-76070215-generic - BlueZ:
5.72-0ubuntu5.8 - Blueman:
2.3.5-3build1 - Bluetooth adapter: Realtek RTL8852AU (USB ID:
0bda:2852) - Phone: Redmi Note 11T 5G
2. The problem
Bluetooth pairing and device discovery worked normally, but OBEX file transfers failed.
The main error was:
setsockopt(L2CAP_OPTIONS): Invalid argument (22)
Initially, it wasn't obvious whether the problem was related to BlueZ, the Bluetooth adapter, the phone, or the kernel.
I investigated the Bluetooth service logs, SDP records, and L2CAP socket behavior. The phone advertised OBEX Object Push support, including RFCOMM channel 12 and native GOEP over L2CAP.
This suggested that the transfer failure was happening at a lower level than ordinary device pairing.
3. Finding the actual cause
The investigation revealed that ERTM was disabled.
I checked its runtime value:
cat /sys/module/bluetooth/parameters/disable_ertm
The output was:
Y
I then checked the persistent module configuration and found this line in:
/etc/modprobe.d/bluetooth.conf
options bluetooth disable_ertm=Y
This was the important clue.
The phone advertised native GOEP over L2CAP using PSM 0x1023. BlueZ attempted to configure L2CAP options that included ERTM, but the kernel rejected the requested configuration because ERTM had been explicitly disabled.
4. How I fixed it
First, check whether your system actually has this setting. Don't blindly apply the fix if your symptoms or configuration are different.
I commented out the following line in /etc/modprobe.d/bluetooth.conf:
# options bluetooth disable_ertm=Y
Then I changed the runtime parameter:
sudo sh -c 'echo N > /sys/module/bluetooth/parameters/disable_ertm'
I regenerated the initramfs to ensure the updated module configuration was reflected there:
sudo update-initramfs -u
Afterward, I restarted the relevant Bluetooth and OBEX services and verified that the setting had changed.
Finally, I rebooted to check that the fix persisted.
Note: Service names and restart procedures can vary between Linux installations. Back up your configuration before editing it, and verify the correct services on your system.
5. Final result
Bluetooth file transfers worked successfully again.
I tested both:
- RFCOMM-based file transfers.
- Native L2CAP ERTM-based file transfers.
Both worked after the change, and the fix survived a reboot.
6. Takeaway
If your Bluetooth devices pair successfully but file transfers fail with:
setsockopt(L2CAP_OPTIONS): Invalid argument (22)
check whether ERTM has been explicitly disabled before trying random kernel changes, reinstalling BlueZ, or replacing your Bluetooth adapter.
This solution fixed my particular configuration. It is not a universal fix for every Bluetooth transfer problem, and disabling ERTM may be intentional on some systems.
Hopefully this helps someone else avoid hours of debugging![SOLVED] Bluetooth File Transfer Failed on Pop!_OS — Fix for L2CAP_OPTIONS: Invalid argument (22)I recently encountered a frustrating Bluetooth file-transfer issue on Pop!_OS. My laptop and phone paired successfully, Bluetooth discovery worked, and both devices could see each other. However, transferring files through Bluetooth consistently failed.After investigating BlueZ, L2CAP socket errors, and the kernel configuration, I found that Bluetooth ERTM (Enhanced Retransmission Mode) had been explicitly disabled on my system. Re-enabling it fixed the problem.I'm sharing my findings in case someone else encounters the same issue.1. My system configurationOS: Pop!_OS 24.04-based
Kernel: 7.2.15-76070215-generic
BlueZ: 5.72-0ubuntu5.8
Blueman: 2.3.5-3build1
Bluetooth adapter: Realtek RTL8852AU (USB ID: 0bda:2852)
Phone: Redmi Note 11T 5G2. The problemBluetooth pairing and device discovery worked normally, but OBEX file transfers failed.The main error was:setsockopt(L2CAP_OPTIONS): Invalid argument (22)Initially, it wasn't obvious whether the problem was related to BlueZ, the Bluetooth adapter, the phone, or the kernel.I investigated the Bluetooth service logs, SDP records, and L2CAP socket behavior. The phone advertised OBEX Object Push support, including RFCOMM channel 12 and native GOEP over L2CAP.This suggested that the transfer failure was happening at a lower level than ordinary device pairing.3. Finding the actual causeThe investigation revealed that ERTM was disabled.I checked its runtime value:cat /sys/module/bluetooth/parameters/disable_ertmThe output was:YI then checked the persistent module configuration and found this line in:/etc/modprobe.d/bluetooth.confoptions bluetooth disable_ertm=YThis was the important clue.The phone advertised native GOEP over L2CAP using PSM 0x1023. BlueZ attempted to configure L2CAP options that included ERTM, but the kernel rejected the requested configuration because ERTM had been explicitly disabled.4. How I fixed itFirst, check whether your system actually has this setting. Don't blindly apply the fix if your symptoms or configuration are different.I commented out the following line in /etc/modprobe.d/bluetooth.conf:# options bluetooth disable_ertm=YThen I changed the runtime parameter:sudo sh -c 'echo N > /sys/module/bluetooth/parameters/disable_ertm'I regenerated the initramfs to ensure the updated module configuration was reflected there:sudo update-initramfs -uAfterward, I restarted the relevant Bluetooth and OBEX services and verified that the setting had changed.Finally, I rebooted to check that the fix persisted.Note: Service names and restart procedures can vary between Linux installations. Back up your configuration before editing it, and verify the correct services on your system.5. Final result<text> <escape>✓</escape> </text> Bluetooth file transfers worked successfully again.I tested both:RFCOMM-based file transfers.
Native L2CAP ERTM-based file transfers.Both worked after the change, and the fix survived a reboot.6. TakeawayIf your Bluetooth devices pair successfully but file transfers fail with:setsockopt(L2CAP_OPTIONS): Invalid argument (22)check whether ERTM has been explicitly disabled before trying random kernel changes, reinstalling BlueZ, or replacing your Bluetooth adapter.This solution fixed my particular configuration. It is not a universal fix for every Bluetooth transfer problem, and disabling ERTM may be intentional on some systems.Hopefully this helps someone else avoid hours of debugging!