Frequency microcombs, alternative to mode-locked laser and fiber combs, enable miniature rulers of light for applications including precision metrology, molecular fingerprinting and exoplanet discoveries. To enable frequency ruling functions, microcombs must be stabilized by locking their carrier-envelope offset frequency. So far, the microcomb stabilization remains compounded by the elaborate optics external to the chip, thus evading its scaling benefit. To address this challenge, here we demonstrate a nanophotonic chip solution based on aluminum nitride thin films, which simultaneously offer optical Kerr nonlinearity for generating octave soliton combs and quadratic nonlinearity for enabling heterodyne detection of the offset frequency. The agile dispersion control of crystalline aluminum nitride photonics permits high-fidelity generation of solitons with features including 1.5-octave spectral span, dual dispersive waves, and sub-terahertz repetition rates down to 220 gigahertz. These attractive characteristics, aided by on-chip phase-matched aluminum nitride waveguides, allow the full determination of the offset frequency. Our proof-of-principle demonstration represents an important milestone towards fully integrated self-locked microcombs for portable optical atomic clocks and frequency synthesizers.