Aircraft emergency oxygen systems or air masks are emergency equipment fitted to pressurized commercial aircraft, intended for use when the cabin pressurisation system has failed and the cabin altitude has climbed above a safe level. It consists of a number of individual yellow oxygen masks stored in compartments near passenger seats and near areas like lavatories and galleys, and an oxygen source, like a centralized gaseous cylinder or decentralized chemical oxygen generator.

Use
Most commercial aircraft that operate at high flight altitudes are pressurized at a maximum cabin altitude of approximately 8,000 feet. On most pressurized aircraft, if cabin pressurization is lost when the aircraft is flying at an altitude above 4,267 m (14,000 feet), compartments containing the oxygen masks will open automatically, either above or in front of the passenger and crew seats, and the oxygen masks will drop down in front of the passenger. Oxygen masks may also drop on extremely rough landings or during severe turbulence if the oxygen mask panel becomes loose. Rows of seats typically have an extra mask (e.g. 3 seats, 4 masks), in case someone has an infant in their lap, or someone in the aisle needs one.

An oxygen mask consists of a yellow, soft, silicone facial cup with white elastic bands for securing the mask to the passenger's face. This band is adjustable by pulling two ends looped through the facial cup. The mask may also have a concentrator or re-breather bag that may or may not inflate depending on the cabin altitude, which has (in some instances) made passengers nervous the mask was not providing adequate oxygen, causing some to remove them, who thereby suffered hypoxia. All airlines now make a point in the safety video or demonstration to point out that the bag may not inflate. The bag is attached to a tube, connected to the oxygen source in the compartment, allowing for it to drop down and hang in front of the passengers. To operate on all aircraft, they must be pulled sharply toward the user to un-clip the flow pin and start the process of transporting the oxygen to the passenger. Passenger oxygen masks cannot deliver enough oxygen for sustained periods at high altitudes. This is why the flight crew needs to place the aircraft in a controlled emergency descent to a lower altitude where it is possible to breathe without emergency oxygen. While the masks are being used, passengers are not allowed to leave their seat for any reason until it is safe to breathe without the emergency oxygen. If there is a fire on board the aircraft, masks are not deployed, as the production of oxygen may further fuel the fire.

Aircraft safety cards and in-flight safety demonstrations shown at the beginning of each flight explain the location and use of oxygen masks.

Some aircraft, such as the Saab 340/2000 and the Beechcraft 1900D, have a mask system where either a mask is stored under the seat or is distributed by the cabin attendant.  These masks are removed from packaging and plugged into the socket for oxygen supply.

On the Boeing 777-300ER and Boeing 787, oxygen masks only consist of the mask and tube. Passengers breathe into the mask to start oxygen flow, and there are no side straps, as the mask adjusts automatically.

Portable oxygen supplies for cabin crew are not a suitable substitute for medically-necessary therapeutic oxygen, even in an emergency, because it does not provide enough oxygen to overcome Dalton's Law.

Mechanism

There are currently three systems that are typically found on aircraft:
 A chemical oxygen generator system connected to all masks in the compartment. Pulling down on one oxygen mask removes the firing pin of the generator igniting a mixture of sodium chlorate and iron powder, opening the oxygen supply for all the masks in the compartment. Oxygen production cannot be shut off once a mask is pulled, and oxygen production typically lasts at least 15 minutes, sufficient for the plane to descend to a safe altitude for breathing without supplemental oxygen.  During the production of oxygen, the generator becomes extremely hot and a burning smell may be noted and cause alarm among passengers, but this smell is a normal part of the chemical reaction. "For any aircraft which carries more than a very few passengers, the weight, complexity and maintenance issues associated with a compressed gas system would be prohibitive. As a consequence, the industry relies on chemical oxygen generators."
 A gaseous manifold system, which connects all oxygen masks to a central oxygen supply, usually in the cargo hold area. Pulling down on one oxygen mask starts the oxygen supply for that mask only. The entire system can usually be reset in the cockpit or in some other location in the aircraft.
 A decentralized gaseous system, often called a pulse oxygen system, is used on some modern airliners such as the Boeing 787. These systems have a small high pressure gas cylinder to support the number of masks located within the box. These systems differ from the other two in that they don't require an accumulator bag as they don't provide continuous oxygen, rather they only provide small pulses of oxygen upon inhalation by the user.

Dangers

Combustion is the exothermic chemical reaction between oxygen and a fuel, producing a flame and smoke. Because an oxidiser is necessary for a fire, oxygen-generating equipment on aircraft pose a significant fire hazard and have contributed to several aircraft fires, both on the ground and while in flight.

Incidents
Aircraft accidents and incidents related to oxygen supply systems include:

ValuJet Flight 592 (1996) - Expired chemical oxygen generators were improperly prepared and labelled as company material and without being designated as HAZMAT and placed in the cargo hold of a passenger aircraft, where they caught fire in flight resulting in a crash that killed all 110 persons onboard.
 ABX Air Flight 1611 (2008) - Cockpit fire in a Boeing 767 on the ground before departure caused by an unexpected electric current in the anti-kink spring a pilot's oxygen mask hose to ignite the hose in the presence of oxygen inside the hose that remained from pre-flight checks, although there was no indication that the oxygen supply was breached and began feeding the fire; both pilots safely evacuated the cockpit, but the aircraft was declared a total loss.
Qantas Flight 30 (2008) - According to the final report, "one passenger oxygen cylinder...had sustained a sudden failure and forceful discharge of its pressurised contents into the aircraft hold, rupturing the fuselage in the vicinity of the wing-fuselage leading edge fairing. The cylinder had been propelled upward by the force of the discharge, puncturing the cabin floor and entering the cabin adjacent to the second main cabin door. The cylinder had subsequently impacted the door frame, door handle and overhead panelling, before falling to the cabin floor and exiting the aircraft through the ruptured fuselage." There were no fatalities.
EgyptAir Flight 667 (2011) - Fire which began around the copilot's oxygen supply while the aircraft was boarding passengers, possibly due to a breach and sudden release of oxygen into the mask ignited by an electrical fault in the mask hose; no fatalities, but the aircraft was declared a total loss.

References

Oxygen system