A rainy afternoon on the Riviera and Pete Doherty is nursing a beer. The beach is feet away, but he is preternaturally pale, and entirely in black – exactly as he is in Confession of a Child of the Century, an experimental arthouse drama about a world-weary 19th-century roué. "There were parts of his character that I didn't really have to try too hard with," Doherty says with a smile. "The loucheness, wistfulness, arrogance."

If he is aware of the critical response to the film, which competes in Cannes' Un Certain Regard section, Doherty is not letting on. The reviews have been overwhelmingly negative, with Doherty's own performance deemed "catastrophic" and "calamitous". This seems unfair. In his own dreamy, minimalist way, Doherty portrays a flâneur effectively enough. He says he knew the work of Alfred De Musset, the French poet and novelist who wrote Confession. "But his best work has never been translated into English."

He might seem an unlikely choice for a lead role, but director Sylvie Verheyde says she cast Doherty because he "is a symbol of the sacred and damned poet, like De Musset in his time". She didn't want him to take acting or voice lessons, instead letting Doherty ad lib with relative abandon. "She was quite surprised I actually learned the lines!" he says. It's a source of obvious pride that he didn't miss a single day of shooting (he was up at five or six every morning) and that all promotional duties have been fulfilled.

"The producers were quite frank with me," he says. "I was very, very concerned about the film being a bit of a joke and not being good enough."

Shooting wasn't altogether smooth, though. This being a French production, there was wine available to cast and crew every day at lunch. Doherty was required to glug on screen, too. For this, he went method. "I wasn't going to drink coloured water. If I am doing a drunken scene, I am doing a drunken scene. That did cause a few problems. Once I start drinking, I have to carry on."

So far, so good. But it was when the producer binned his drugs that there was a real froideur on set. Making a movie as a "heroin addict" is a challenge, Doherty mentions almost in passing. "It's poison but it's also medicine. When you're in that state, you can't function unless you have your fix."

There was talk of him going away to rehab before shooting began. "But I was so absorbed in the work, there wasn't a chance." As for his director, "I couldn't hide it from her. She didn't really care. It was just a question of how quickly I can find a vein and then let's get on with it."

So is he clean now? "I am struggling, to be honest."

Despite rumours of a relationship, he says he didn't get on especially well with co-star Charlotte Gainsbourg. "You can't not be intimidated. I couldn't have helped but have picked up things about her and her father [Serge] and her whole mythology."

Doherty adds that Gainsbourg wasn't "all that happy" about the production, which, he says he knows because he snuck into her room and looked at her journal.

Doherty had worked on the production for months, but Gainsbourg came in "as someone everyone knew but a complete stranger in the immediate environment. She is used to being treated in a certain way and that's not how these people were working. You couldn't be a star in the environment." It was freezing cold on location. Between takes, assistants would "leap on her with loads of blankets and hot-water bottles and I was stood there in 19th-century cotton with lots of holes in it".

For all that Doherty is matter-of-fact about the difficulties of working with Gainsbourg, and his drug-taking, he only really becomes emotional when he talks about his spell in prison.

"It's horrible, horrible. There are lots of aggressive, money-oriented, very masculine people, but at the same time, there is really nasty homoerotic violence. It's not the place to be if you are a freethinking man."

Other prisoners tried to blackmail him for protection money. The officers treated him without sympathy. "They enjoyed it, seeing me vulnerable. I was getting a lot of mail from kids saying: Pete, I love your songs. I love your poetry. They were having to sit and read this. It was winding them up because they had this idea I was this scumbag drug addict and I am getting these letters saying what a talented songwriter I am. They didn't like it. So they put me in with the nastiest, most horrible bloke you could imagine. But it turned out he was a big music fan and he didn't like bullies."

Doherty's bitterness about his brief sentence is self-evident. So is his anger at the media. He has followed the Leveson inquiry carefully, and was paid £40,000 by News Corp, he says. The real criminals, he thinks, are the dodgy journalists, not someone like him, banged up "for smoking a pipe".

As for music, Doherty is still terrified of performing. He talks of the "enormous anxiety" he feels before going on stage. And if "The Libertines were three reliable, talented musicians and one fuck-up. Babyshambles is like one talented musician … and the rest of us are fucked up."

Right now, the best way to relax, he says, is to sit at home and listen to Radio 4. Happiness is the Shipping Forecast. "I listen to it and I feel a real sense of peace."