MDF paint – someone experience?

hi, have a problem from the home audio area but maybe there is one or the other in the caraudio that has already done something like that. I made boxes from MDF and would like to paint them now. if I spray the MDF directly with a primer it sucks up full and the surface becomes rough like 40’s sandpaper – what can you do against it? there are special varnishes that prevent such a thing? was already with various screamers but no one could help me… thanks in advance markus