Grain flows through pipes are frequently found in various settings, such as in pharmaceutical, chemical, petroleum, mining and food industries. In the case of size-constrained gravitational flows, density waves consisting of alternating high-and low-compactness regions may appear. This study investigates experimentally the dynamics of density waves that appear in gravitational flows of fine grains through vertical and slightly inclined pipes. The experimental device consisted of a transparent glass pipe through which different populations of glass spheres flowed driven by gravity. Our experiments were performed under controlled ambient temperature and relative humidity, and the granular flow was filmed with a high-speed camera. Experimental results concerning the length scales and celerities of density waves are presented, together with a one-dimensional model and a linear stability analysis. The analysis exhibits the presence of a long-wavelength instability, with the most unstable mode and a cut-off wavenumber whose values are in agreement with the experimental results.