Pain in the arse isn't it! Buy some high quality 'spray grease'.
Take the cable out the frame and blast the inside of the tube with the liquid grease,
then grease the outer cable and fit back in before the liquid turns into a grease,
this should quieten down the rattle somewhat, worked for me on two bikes.