Is this mainly happening when using hot water? If so, it may be that the hot water is causing the 3" drain pipe to expand. The sound you are hearing is probably the pipe straining inside a hole cut in the stud. Solution? Well, it would probably mean getting into a wall or ceiling and cutting the hole around the pipe a little larger. Just out of curiousity, how old is the home?