A hatchling inside an incubator at a vast aviary in Bogor, south of Jakarta, Indonesia

Barely a few days old, perched on a nest of twigs inside an incubator, a newborn Indonesian songbird—cherished for its melodious chirp—tweets weakly as a tiny metallic ring is attached to its leg.

The tag shows potential buyers the chick was bred in captivity. It's an important symbol, which shows it was not trapped in the wild and smuggled, an which sees packed in their thousands in shipping crates or stuffed in plastic bottles before being sold in giant avian markets in Indonesia's major cities.

The hatchling was born at Megananda Daryono's vast aviary in Bogor, a city on the island of Java, where he runs a breeding programme that is a sustainable alternative to the roaring trade in birds caught in the wild.

"I realised the birds being caught in the forest would one day be gone for good," Daryono told AFP at the site, now a cornucopia of exotic macaws, brilliant parrots and vulnerable songbirds.

He is among a small number trying to turn the tide in a country where once-common bird species are being driven to the brink of extinction, as an obsession for bird-keeping and even avian singing contests fuels unprecedented demand.

The jungles of the archipelago are home to 131 threatened bird species, according to wildlife trade watchdog TRAFFIC, more than any other country except Brazil. There are a dizzying array of exotic species, from the Sumatran Laughingthrush, to the Chattering Lory and the Black-winged Myna.

A ring on the leg of a Brazilian makaw at a vast aviary in Bogor, Indonesia, is proof it was bred in captivity and not smuggled illegally

At an emergency meeting convened in Singapore to discuss the crisis last year, wildlife experts declared Indonesia's rampant bird trade more of a threat to many native species than habitat loss, and called for urgent intervention to stop the plunder.

"The scale is massive. It involves millions and millions of birds every year," TRAFFIC's Chris Shepherd told AFP.

"It's just really reaching a point now, a critical point, where it's now or never for a lot of these species."

Bird owners shout during a bird singing contest in Indonesia, where a nationwide craze known as "chirping mania" is blamed for the dwindling of songbirds in the wild

'Chirping mania'

Caged birds have been kept as pets for centuries in Indonesia but the evolution of songbird contests from small, localised events to a nationwide craze known as "chirping mania" is in particular blamed for the rapid dwindling of songbirds in the wild.

There are entire fan clubs dedicated to certain species of canaries, "chirping" organisations boasting thousands of members, and champions who go on tour across the archipelago to compete for big prize money—and glory—at national gala events.

It's serious business, as one champion Johan explained at a recent contest in central Jakarta, as men screamed, whistled and clucked at their birds, encouraging them to keep singing as stony-faced judges awarded points for melody, duration and volume.

Capturing any native birds from the wild—whether they are protected or not—is illegal in Indonesia but law enforcement is lax

"This isn't a beauty pageant, it's a chirping contest. It's chirping mania," Johan, who like many Indonesians goes by one name, told AFP.

"The song is the only thing that matters," he added, his champion yellow canary—one of just 50 birds he personally owns—perched nearby in an ornate wooden cage.

Calls from some quarters for these popular contests to be banned or heavily regulated have met stiff resistance, with many defending them as uniquely Indonesian and blaming the trade—not the competitions themselves—for the crisis unfolding in jungles far away.

However efforts are being made to distance the contests from the illegal trade and unsightly bird markets like Pramuka—an overcrowded, filthy emporium in Jakarta known to sell critically-endangered and vulnerable birds.

The jungles of the Indonesian archipelago are home to 131 threatened bird species, according to watchdog TRAFFIC, more than any other country except Brazil

Changing attitudes

The Indonesian Bird Society (PBI), which sanctions and judges one major songbird league, has pledged to phase out all wild birds and replace them entirely with songbirds bred in captivity. So far three species must be captive-bred and bear the tell-tale ring to compete in PBI contests, with a fourth to be added next year.

But former PBI chairman Made Sri Prana, who helped usher in the regulations, said a full transition would take time and outside PBI-sanctioned contests, "there's no real obligations" for other songbird associations to follow suit.

Capturing any native birds from the wild—whether they are protected or not—is illegal in Indonesia but law enforcement is lax, with fines and jail terms rarely handed out to traffickers or vendors at big markets, Shepherd said.

But there are some positive signs. There are now estimated to be hundreds of breeding programmes like Daryono's across the country, and authorities have made a number of high-profile seizures of illegally caught birds.

In addition, conservationists working with the government hope in 2016 to update the list of birds protected under Indonesian law, which is many years out of date.

Raising public awareness is a longer game. Indonesian President Joko Widodo tried to do just that this month when he released 200 caged birds into the wild—but was criticised when it emerged the animals had been bought in Pramuka, a symbol of the country's .

Ria Saryanthi from Burung Indonesia, a local conservation group working for better protection of birds, said it would take time to alter old habits: "You cannot change people's minds easily."