This is not strictly a Linux-issue as I reproduce this issue under Windows 10 as well (but can not reproduce under Android or macOS), but I will be using Linux for any troubleshooting and I wasn't sure where else to post this.
I have a pair of Sony WH1000MX5 that acts like an expensive piece of garbage so far. I will eventually (usually within 2-10 minutes usually) hear crackling noises when using the headset via Bluetooth in high-fidelity mode on my Linux machine (and as mentioned above, this is reproduced on two other machines running Windows 10). The crackling noises are there regardless of whether active noise canceling is active or not. It is not constant, but it is enough to significantly reduce the listening experience, especially for tracks where not too much is going on, such as quiet piano pieces.
On my Linux machine, I can choose between three codecs: SBC, SBC-XQ and LDAC. It tends to be less pronounced using the LDAC codec over SBC (right now I've had a longer period with no issue). SBC-XQ also seems better. However, I have experienced it for all choices of codecs before. Also, under Windows (which I must use for work), this does not seem to be a choice at all. But I wonder if the problem lies here? I don't know much about Bluetooth codecs.
Ideally, as in addition to these issues, they are not very comfortable, I would like to return them and get a refund (should be possible under local laws), but I am having some issues with the retailer claiming they can't find anything wrong with them after two trips to a repair shop. The first time they factory reset it and updated the firmware, the second time they did nothing. I don't think local Sony support will be of much help, and the local laws relate to to the buyer/seller contract, so for the refund or repair they will anyway refer me to the retailer.
So I am trying to get a better understanding of the issue before pursuing this further, and if I fail to get a refund, I would like to fix the issue if possible. So if anyone is familiar with this and could help point me in the right directions to fix these issues, I would be very grateful.
IIRC LDAC mode does not support microphone input. Still, if you want high sound quality, which you do, you need to use LDAC. I had some issues with my wh1000xm2 defaulting to SBC even though I specified LDAC. Disabling microphone input helped keep it consistently in the right mode. In KDE my settings working fine are the following:
Also might worth looking at the bluetooth headset section of ArchWiki.
That looks very similar to mine, except I don't have AAC and aptX. I guess the WH1000MX5 only supports SDC and LDAC? As far as I know, I need to use the Headset Head Unit to get microphone input. After a system update some time back, it would switch automatically if I e.g. was on a Signal call. Prior to this, I would have to switch manually to get microphone input.
By the way, I am not entirely sure if I am running PulseAudio or PipeWire, as I get the confusing output below, but it seems to be PulseAudio. Is it likely to improve things if I were to switch to PipeWire?
As for my Windows issue, it seems LDAC is not natively supported in Windows 10, so I guess it is using SDC. Could my problems simply be that I am trying to stream a too high bitrate? I will need to recheck my settings for stream quality.
The mx5 only support sbc (minimum to support) aac and LDAC. They dropped aptx to only use their own high latency (and not that much better) codec. The headphone has BT 5.3, but does not support LC3 (an extremely good, low latency codec integrated in base bluetooth).
If you want to check what codec is used in windows, or change, there is a tool : https://www.bluetoothgoodies.com/a2dp/
Not sure if it's free or free trial. But they also have a software allowing to check what is currently in use which is a free trial.