You can just wipe with diluted vinegar, but if you think the wall is dirty, you can generally use any soap (diluted), then wipe them again with diluted vinegar to remove any residue. I've used Mrs. Meyers, and I really liked it for cleaning old dirty walls.
If there is any grease on the surface, or if it's been a long time since anyone cleaned it, then you should use TSP = I've never used it, but I should have on one particular door .... I always always wipe with a diluted vinegar after using any "product".
I prefer to wait at least 8 hours after washing a surface before painting to be sure it's *really* dry. The last step is to dust down the wall one more time - I use microfiber cloth.
And, I wait at least 8 hours before doing a second coat of anything - usually just wait a day between any two tasks done on a surface. I've had a lot of really crappy luck over the past few years with paint, so I got into this habit. Now I use only Sherwin Williams Zero-voc Harmony paint - with MUCH better results, but I'm still wary. Perhaps living in Houston climate has contributed to my issues, I don't know.
--janis
(currently painting my entire big house between now & November - I'm pregnant, don't want to paint past 32 weeks - and we're hoping to sell the house in Feb. I don't think I'll be painting much with a newborn!)