If you use pockets you can boil the inserts to try and release the soap.
I use purex free and clear. Just 1/2 tablespoon in my front loader for 12-15 diapers. Covers then inserts.
Everything gets a presoak (covers with poo seperate) while other laundry is finishing.
Pockets get a quick wash on warm (to release poop) then normal wash on warm, then rinse until no soap (which can be alot!!!)
Inserts get my sanitize cycle with extra rinse. Then multiple rinses to rid soap.
I have a crummy machine but this way I have 0 stink issues with just a regular box store detergent.
If you suspect hard water see if you do dishes by hand how 'sudsy' the water gets with dish soap. If it seems to need alot to suds (more than 1/2 tsp), you have hard water.
Baking soda helps fix hard water.