thetechnobear (this is kind of interesting, as in past experiments, Ive similarly connected things directly to AEM but always used the audio (or cv) jacks to provide the ground... so perhaps this is needed, perhaps this is an audio ref ground?)
I don't understand exactly what happened. Is the final outcome that in order for the line out to work properly you need both one ground connected for power (P2_16?) and another ground (from the audio jack) connected for the signal, at which point you get the whistling? And if you have only one of the two, it doesn't work?
thetechnobear a 'side question'
do I some how need to protect the analog in on bela from being connected to an 'input' on the modular.
No, it's fine to connect inputs together, that is exactly what happens when you use a multiple: one output feeds multiple inputs. It seems that on the AEM you have max 5V, so you should not need any protection for the analog inputs. However, you may want to wire up a passive resistor divider with ratio ~4.096/5 and a decently high input impedance (>80k ?), so to get the full 5V range on your inputs, without a "dead end". You could similarly use a resistor divider with ratio ~3.3/5 to safely connect a 5V (max!!!!) trigger to the PocketBeagle's digital inputs.