Observations of solar flares with sunquakes by space- and ground-based instruments reveal essentially different dynamics of seismic events in different flares. Some sunquakes are found to be closely associated with the locations of hard X-ray (HXR) and white-light (WL) emission, while others are located outside either of them. In this article we investigate possible sources causing a seismic response in a form of hydrodynamic shocks produced by the injection of mixed (electron plus proton) beams, discuss the velocities of these shocks, and the depths where they deposit the bulk of their energy and momentum. The simulation of hydrodynamic shocks in flaring atmospheres induced by electron-rich and proton-rich beams reveals that the linear depth of the shock termination is shifted beneath the level of the quiet solar photosphere on a distance from 200 to 5000 km. The parameters of these atmospheric hydrodynamic shocks are used as initial condition for another hydrodynamic model developed for acoustic-wave propagation in the solar interior (Zharkov, Mon. Not. Roy. Astron. Soc. 431, 3414, 2013). The model reveals that the depth of energy and momentum deposition by the atmospheric shocks strongly affects the propagation velocity of the acoustic-wave packet in the interior. The locations of the first bounces from the photosphere of acoustic waves generated in the vicinity of a flare are seen as ripples on the solar surface, or sunquakes. Mixed proton-dominated beams are found to produce a strong supersonic shock at depths 200 – 300 km under the level of the quiet-Sun photosphere and in this way produce well-observable acoustic waves, while electron-dominated beams create a slightly supersonic shock propagating down to 5000 km under the photosphere. This shock can only generate acoustic waves at the top layers beneath the photosphere since the shock velocity very quickly drops below the local sound speed. The distance Δ of the first bounce of the generated acoustic waves is discussed in relation to the minimal phase velocities of wave packets defined by the acoustic cutoff frequency and the parameters of atmospheric shock termination beneath the photosphere.