There are may variables that can introduce noise. could be coming from your amps or the wiring from HU to Amps.
Make sure all your grounds are clean good grounds.
To minimize the chance for noise I recommend making sure your equipment has balanced inputs and using the twisted pair rca cables.
I did not have any engine noise at all while connecting this way. However when i did not use balanced rcas and used a cheap line driver without balanced inputs i had horrible noise. So the noise is there but the bose system uses balanced line to the bose amp so it filters out the noise.
My first set up only my processor had balanced inputs. My amps did not. My new setup everything accepts balanced inputs. Both had no noise.
If your amps do not have balanced rca's then noise is just coming from the wiring itself. Balanced rcas send the sound signal through both positive and negative. Whatever is not present in both signals gets filtered out.
As far as gains go, most amps go from ##mv to 4-5v. The lower the gain is set the higher the input voltage from the line level in. IF you are using the the HU then you will probably need to set your gain pretty high before it starts to clip.
I had to set the gain on my processor about 10.5 out 11 in before it started to clip.
The gain has a direct correlation to the voltage output of your source. the Bose headunit in my experience did not clip until it was 1 line away from max.
Here's a simplified explanation -