British Prime Minister David Cameron said ties between politicians and the media had become "too close" as he began giving evidence on Thursday to a public inquiry into press ethics.

"It has been too close and I think we need to try and get it on a better footing," Cameron said.

There should be "greater transparency, better regulation, having a little more distance" in the future, he added.

"I don't think the regulatory system we have at the moment works."

Cameron was driven from Downing Street to the Royal Courts of Justice across central London to attend the inquiry.

Wearing a white shirt with a dark suit and blue tie, he gave a brief wave to waiting photographers as he walked inside.

Once inside Court 73, he was called to testify and held the Bible, swearing that the evidence he would give would be "the truth, the whole truth and nothing but the truth".

Sitting with his hands interlocked, he explained how he started out working at the Conservative Party's central office and worked as a special adviser and speechwriter at the Treasury.

Discussing how he forged relationships with journalists, he said: "You want people to understand your motivations, your character, your judgement, your views and why you hold them.

"Sometimes you strike up a good and strong relationship; sometimes you struggle."

And of the current media climate, he added: "The 24-hour news cycle has meant that newspapers have had to turn up the volume on everything.

"It feels like you're being shouted at rather than spoken to."

The prime minister is also likely to face questions on his own ties to Murdoch's media empire.

Cameron set up the Leveson Inquiry in July last year after Rupert Murdoch's News of the World was shut down in the wake of a public outcry when it emerged the tabloid had hacked into the voicemails of a murdered schoolgirl.

His immediate predecessors Gordon Brown, Tony Blair and John Major have already given evidence to the inquiry, which is examining the culture, practices and ethics of the press.

It is due to produce a report, likely to include recommendations on the future of press regulation, in October.