Sony has managed to gain a lot of fans among developers thanks to its Open Devices program. It's an initiative that brings Android Open Source Project (AOSP) builds to some of the company's devices and allows developers to adapt and change the code. It also makes it easier to unlock the bootloader and install custom ROMs. Sony has announced that the latest phone to become part of the Open Devices program is the Xperia 5.
When you head over to the Open Devices portal, you can get a bootloader unlock code for the phone. Once that's done, you can download and install Sony's AOSP builds and binary drivers for the device, as well as custom ROMs from a source you trust. Keep in mind that you might still void your warranty in the process and that certain security features will stop working due to the unlocked bootloader, but at least you shouldn't run into camera problems anymore.