Optical sensors are the oldest sensors when it comes to submarine hunting, starting with the Mk1 eyeball, aka, human eyes.
But radar and optics only works up to a certain depth, periscope depth. The primary way to detect a submarine under water is by using sound. And since sound propogates differently due to changes in temperature, salinity, depth etc, you need a lot of air, surface and sub-surface assets if you are to detect, track and kill submarines. The P-8I is only one of those assets.
I don't believe a single asset can effectively perform anti-sub operations on its own. You need a sensor net over a very large area.