Thank you and I am sorry you are experiencing the difficulties you have.
The process is to go to the court that issued the Order of Custody. Request a Modification form, file it with the court. You will be assigned a hearing date. At that time, you can request the court to interview your daughter in Chambers, out of earshot of both parties so as not to intimidate her. The court will interview your daughter and then may use what she says in considering how the custody should be modified, in her best interests
Also, it seems to me that if he is half as bad as you present here, you would be able to get some assistance from your local DA to help with an investigation as to your daughter's wellbeing while living with him. The DA can enlist the help of your local child protection services to have an investigation into the living environment. So, I suggest, you also contact your local DA and give them the information you have on his pornography, sleeping with your daughter in his bed, etc. If the DA will not assist you for some reason, then you should consider contacting your local FBI office and have them investigate for the pornography to ensure it is not anything illegal. Here is that contact information
They will be very interested and will assist you, if he is into pornography that may be illegal.
If you have further questions, you may post them here and I will continue to assist. Otherwise, please ACCEPT my answer as that is the only way I can get credit for my time and information in this matter. Thank you