This could also be a bad jack in combination with grounding issues. To help troubleshoot, when the humming starts, try touching a wire to the lip of the jack at each end of the cable at the same time and see if the humming goes away. Also, does additional wiggling of the cable ever stop the humming?