Police chiefs need to be held accountable for failures to disclose evidence which leads to the collapse of trials, a former lord chief justice has said.
Lord Thomas of Cwmgiedd said there was a "systemic problem" and suggested a greater use of computer technology could uncover evidence from social media accounts which might otherwise have been overlooked.
He added that police and prosecutors needed to recognise the "system of values" which meant all evidence - even if it damaged their case - had to be put before the court.
Lord Thomas, who retired as lord chief justice last year, was speaking after a series of problems with the disclosure of evidence, especially social media messages.
He said it was unlikely that the problems were due to an effort to boost conviction rates.
"I would be surprised if it was a desire to obtain convictions, I think it is much more an overlooking of the fact that our system requires fairness to everyone and that is the disclosure of all the evidence obtained."
He told BBC Radio 4's Today programme that police and the Crown Prosecution Service "must understand our system of values, that the duty is to ensure all the evidence is put before the court - favourable or unfavourable".
He added: "They must appreciate the huge effect of technological change on social attitudes, particularly people recording their thoughts, what has happened, on social media."
While the Director of Public Prosecutions is accountable to the Attorney General, there is "a serious issue of police accountability", he said.
Last year Her Majesty's Crown Prosecution Service Inspectorate (HMCPSI) and Her Majesty's Inspectorate of Constabulary (HMIC) carried out a joint review of the disclosure provisions.
Lord Thomas said: "I think what we need is public accountability of each chief constable by publishing what is being done in response to the inspectorates' recommendations."
Suggesting that technology could be used to scan thousands of messages, he said: "In civil justice we have had computer programmes that have been able to search vastly greater tranches of material.
"They are now considered as accurate - if not more accurate - than human searching and we need to look at this for use by the police."
Responding to the suggestion that a lack of funding may be part of the problem, Lord Thomas said the criminal justice system as a whole was being squeezed.
"If they haven't got the resources then that is a problem common to much of the criminal justice system, which has seen huge cuts.
"That's a matter for which the Chancellor of the Exchequer is responsible."