Many techniques help pilots to cope with ear popping.
The primary measurement for altitude of an aircraft comes from a pressure altimeter.