Pain at night

Ive recently been having increasing levels of pain at night especially in my shoulder and hip making sleeping more and more difficult. I have started taking paracetamol before bed. I have codeine prescribed but only use this when really in pain especially on days when I have to active. Can anyone recommend what solutions they have had to ease this problem. I suffer from osteoarthritis and am due to have a hip replacement operation at some point. Regards Damien