Rio de Janeiro - The year was just a few hours old when a prison riot near the capital Brasilia left nine inmates dead - two of them decapitated - and set the stage for what is proving to be a deadly 2018 in Brazil.Since then, the country has seen a wave of violence that prompted Defence Minister Raul Jungmann to declare that "the security system is broken".There have been 688 shooting incidents reported in Rio de Janeiro state in January, many of them focused in the same few sprawling, poor neighbourhoods known as favelas where police are barely in control.Then came the massacre of 14 people at a nightclub in the north-eastern city of Fortaleza, followed by the deaths of 10 people in clashes at a prison nearby.While Brazil has long suffered high crime and Rio in particular is beset by drug gang wars, there was dismay last week in the "Marvellous City" at television footage of drivers on a main artery being forced to stop and hide behind their cars because of shooting between police and traffickers nearby.Corruption in the ranksJungmann told Globo television that urgent change is needed."We have to take the necessary measures before it's too late and we find ourselves on the trajectory of other countries," he said, referring especially to Mexico.But the task of taming criminal gangs and adequately training the police continues to elude politicians, partly because the root of the chaos stretch far beyond security and into poverty, poor education, poor municipal services, racism and deep inequality.Drug trafficking gangs, meanwhile, have ever better weapons and operate often with impunity in favelas, while their leaders issue orders from prisons that the authorities only partially control.On the other side are police forces - notably in Rio - crippled by corruption, poor funding, and a military style training that does not necessarily work in modern policing.Jungmann said "penetration of crime throughout the police has to be combatted."Historic roots Some trace Brazil's seemingly insoluble crime problems to the 1988 constitution, written at the end of a two-decades long military dictatorship. This gave almost all budgetary and strategic responsibility for security to individual state governments."Public security was like the stepchild. We were coming out of a dictatorship and no one wanted to talk about public security," said Jose Mariano Beltrame, Rio's former security secretary."Why were health and education put under the federal government? Because they were considered important, they won votes. Today we're paying for that."Arthur Trinidade, a former security chief for the capital and now at the University of Brasilia, told AFP "there is no doubt that Brazil needs a new federal agreement. Public security has to be a federal matter."Trinidade said the national security body is understaffed, and that the police do not even have their own system for collecting reliable statistical data.Organisations like the Brazilian Public Security Forum fill the gap when it comes to data. According to the non-governmental group's latest report, there were 61 619 homicides nationwide in 2016, or seven an hour.That means in terms of body counts that Brazil is already deadlier than Mexico, with 29.9 homicides per 100 000 people, compared to 21.Ignacio Cano, an expert at Rio's state university, said the latest trend is for violence to grow in the far-flung regions of the north and north-east. He doesn't have much faith in the authorities' response."The federal government is on the defensive and makes bombastic declarations instead of taking measures, as a way of avoiding their responsibility," he said.