Years ago I had some towels mildew. My sister gave me a hint that I've used to get all kinds of odors out of things (even cigarette smoke.)
Mix baking soda & hydrogen peroxide in a cup to the thickness of peanut butter. Add this to your laundry before you start the water.( Put spoon fulls of the mixture all around & on top of the clothes.) As the water is filling up the mixture is still having a chemical reaction. The amount of time to fill the machine with water is just right.
Hope this helps.