I think it might have only been a clog in the P trap and the line from the secondary sink. The dishwasher runs into the food disposal under the main sink and there's a side sink that connects to just above the P trap, well the horizontal pvc running from the secondary sink was a tad unlevel in the wrong way. I noticed the side sink was draining slow so I thought it was the P trap. I took all the PVC apart. The vertical pvc from the side sink was almost clogged shut, the P trap was clean. I'm hoping it was simply that when the chunks of food fill the P trap, it enters the horizontal PVC from the side sink and then struggles to push everything up and out the P trap. Thus was getting cloudy dirty water sometimes and the smell was also coming from the side sink (although much more noticeably when the dishwasher was opened, which seems sort of contrary to the clogged PVC from the side sink being the cause which should smell as bad above the sink as the dishwasher smelled.
Anyway, it's being working fine though mostly for the past few weeks from starting this thread, but then just now cleaned major clogging in the pvc so hopefully that's all it was.