We study the effects of different descriptions of the solar surface convection on the eigenfrequencies of p-modes. 1-D evolution calculations of the whole Sun and 3-D hydrodynamic and magnetohydrodynamic simulations of the current surface are performed. These calculations rely on realistic physics. Averaged stratifications of the 3-D simulations are introduced in the 1-D solar evolution or in the structure models. The eigenfrequencies obtained are compared to those of 1-D models relying on the usual phenomenologies of convection and to observations of the MDI instrument aboard SoHO. We also investigate how the magnetic activity could change the eigenfrequencies and the solar radius, assuming that, 3 Mm below the surface, the upgoing plasma advects a 1.2 kG horizontal field. All models and observed eigenfrequencies are fairly close below 3 mHz. Above 3 mHz the eigenfrequencies of the phenomenological convection models are above the observed eigenfrequencies. The frequencies of the models based on the 3-D simulations are slightly below the observed frequencies. Their maximum deviation is ~ 3 mu Hz at 3 mHz but drops below 1 mu Hz at 4 mHz. Replacing the hydrodynamic by the magnetohydrodynamic simulation increases the eigenfrequencies. The shift is negligible below 2.2 mHz and then increases linearly with frequency to reach ~ 1.7 mu Hz at 4 mHz. The impact of the simulated activity is a 14 milliarcsecond shrinking of the solar layers near the optical depth unity.