I have no advice on the CD player but my factory radio does the same thing with the volume.
One thing that works well for me is to spray some electronics cleaner/lube into the knob housing.
I turn the radio off, spray and then spin the crap out of the knob back and forth. For me, sometimes I need to lift up on the knob as I spin it. One of those things you just get used to.
But try the spray and see if it helps you out.