Just to verify, this is a whine that increases and decreases with the rpm right, not like a popping sound? Just making sure. Out of intrest, what kinda speakers are running in this system. I have actually had crossovers back feed into the system and cause engine noise because the crossovers were burried in the dash and picked up some crazy field. It wouldnt make sense being it stops when the RCA's are unplugged but at this point nothing really make sense right. And for point of reference, when I did my system I ran a 12 gauge power and ground from the head unit to the batteries installed in the rear of the vehicle to avoid problems exactly like this as I had issues with noise in the previous system I had installed in the same car. Never had a problem after so you might wanna check into that. Also verify that the ground on the battery is good being you said it stopped when you used a external battery. It could be something just that simple.