Calculating acid volumes needed

I collect water quality samples used for irrigation. The samples are sent to a lab to measure $\ce{Ca^{2+}, Mg^{2+}, CO3^{2-}, HCO3^-}$, pH, and total dissolved solids.
I need to use acid to prevent scaling on my water emitters, so I want to calculate, based on the results of each sample, how much HCl I need to add to lower the pH to 6 and to 4.
I understand that the target pH gives the amount of H+ but how do I add to that the buffer capacity of alkalinity?
Thanks


