The stability of high-end piezoacoustic drop-on-demand (DOD) inkjet printing is sometimes compromised by the entrainment of an air bubble inside the ink channel. Here, bubble pinch-off from an oscillating meniscus is studied in an optically transparent DOD printhead as a function of the driving waveform. We show that bubble pinch-off follows from low-amplitude high-frequency meniscus oscillations on top of the global high-amplitude low-frequency meniscus motion that drives droplet formation. In a certain window of control parameters, phase inversion between the low- and high-frequency components leads to the enclosure of an air cavity and bubble pinch-off. Although phenomenologically similar, bubble pinch-off is not a result of capillary-wave interaction such as observed in drop impact on a liquid pool. Instead, we reveal geometrical-flow focusing as the mechanism through which, at first, an outward jet is formed on the retracted concave meniscus. The subsequent high-frequency velocity oscillation acts on the now toroidal-shaped meniscus and it accelerates the toroidal ring outward, resulting in the formation of an air cavity that can pinch off. Through incompressible boundary-integral simulations, we reveal that bubble pinch-off requires an unbalance between the capillary and inertial time scales and that it does not require acoustics. The critical control parameters for pinch-off are the pulse timing and amplitude. To cure the bubble entrainment problem, the threshold for bubble pinch-off can be increased by suppressing the high-frequency driving through appropriate waveform design. The present work therefore aids the improvement of the stability of inkjet printers through a physical understanding of meniscus instabilities.