Context. The heating process that balances the solar chromospheric energy losses has not yet been determined. Conflicting views exist on the source of the energy and the influence of photospheric magnetic fields on chromospheric heating. Aims. We analyze a 1-h time series of cospatial Ca II H intensity spectra and photospheric polarimetric spectra around 630 nm to derive the signature of the chromospheric heating process in the spectra and to investigate its relation to photospheric magnetic fields. The data were taken in a quiet Sun area on disc center without strong magnetic activity. Methods. We have derived several characteristic quantities of Ca II H to define the chromospheric atmosphere properties. We study the power of the Fourier transform at different wavelengths and the phase relations between them. We perform local thermodynamic equilibrium (LTE) inversions of the spectropolarimetric data to obtain the photospheric magnetic field, once including the Ca intensity spectra. Results. We find that the emission in the Ca II H line core at locations without detectable photospheric polarization signal is due to waves that propagate in around 100 s from low forming continuum layers in the line wing up to the line core. The phase differences of intensity oscillations at different wavelengths indicate standing waves for nu < 2 mHz and propagating waves for higher frequencies. The waves steepen into shocks in the chromosphere. On average, shocks are both preceded and followed by intensity reductions. In field-free regions, the profiles show emission about half of the time. The correlation between wavelengths and the decorrelation time is significantly higher in the presence of magnetic fields than for field-free areas. The average Ca II H profile in the presence of magnetic fields contains emission features symmetric to the line core and an asymmetric contribution, where mainly the blue H-2V emission peak is increased (shock signature). Conclusions. We find that acoustic waves steepening into shocks are responsible for the emission in the Ca II H line core for locations without photospheric magnetic fields. We suggest using wavelengths in the line wing of Ca II H, where LTE still applies, to compare theoretical heating models with observations.