I have and old house and since we purchased it 25 years ago, we have had to clean the main line regularly. It was roots in the line and we took down an old sicky tree and tha helped. Additionally roto tooter makes a product its crystals . You put SMALL amounts in the lowest toilet and flush. Its done once a month and it really has kept the line clear. The crystals should be put in is smalll amounts so it can be flushed, I put in the prescribed amount in three flushes otherwise it may clog the toilet.
We were told we have a dip inthe main line and that causes some of the problem as well. These crystaly have kept thr roots out very well.