It is hypothetically possible to have an active-detection process too, but presumably that would take the form of emitting a pulse of electromagnetic radiation and looking for its echoes, in other words it's just another form of vision. The standard problem applies: find a frequency at which water is mostly transparent. Unfortunately the absorption spectrum for water is https://en.wikipedia.org/wiki/Electromagnetic_absorption_by_... , it has a minimum in the visible range.
In addition to being one of the more stunning confirmations of evolution (of course our eyes are only sensitive to the least-absorbed wavelengths of light in water -- our ancestors evolved eyes in the ocean! there weren't many other useful wavelengths down there!) this has the nasty property that it's unlikely that we'd be able to detect a sub this way with any better approach than shining a bright laser or spotlight or what have you, and watching what's reflected back with our own eyes.