Chorus waves are naturally occurring electromagnetic emissions in space and are known to produce highly energetic electrons in the hazardous radiation belt. The characteristic feature of chorus is its fast frequency chirping, whose mechanism remains a long-standing problem. While many theories agree on its nonlinear nature, they differ on whether or how the background magnetic field inhomogeneity plays a key role. Here, using observations of chorus at Mars and Earth, we report direct evidence showing that the chorus chirping rate is consistently related to the background magnetic field inhomogeneity, despite orders of magnitude difference in a key parameter quantifying the inhomogeneity at the two planets. Our results show an extreme test of a recently proposed chorus generation model and confirm the connection between the chirping rate and magnetic field inhomogeneity, opening the door to controlled plasma wave excitation in the laboratory and space.