The active sonar had me scratching my head tonight aswell.
Had just made my 2nd attack of the night on a large convoy and was quietly slipping away at 2knts 80m deep backtracking down the convoys route. I had 2 escorts chasing shadows 1500m away and was just letting the tail end escort pass over me when he started pinging me. I did nothing to alert him, wasn't reloading etc, so how he knew I was there is a mystery - his 1st round of DCs where bloody close aswell.
2 RL hours later, and I was able to surface and bring in my external stores ready for round 3