I remember being very troubled by a case from years ago about a cop who knocked on someone's door because neighbors had heard screaming. The resident and his girlfriend had been having loud sex, but agreed to let the cop verify no violence was taking place. During the visit the cop noticed some cannabis plants and the man was convicted of possession with intent to distribute.
My rule of thumb if I were rewriting the law would be that the inadvertently discovered crime must be as or more serious than that which is being reported/investigated. If a person is a victim of or an honest cooperator in the investigation of a serious crime, lesser offenses should be held in abeyance, although a warning of potential liability in future unrelated police contacts would be acceptable.