In an insalubrious part of the San Fernando Valley in Los Angeles sits a squat, ugly building that suggests a storage unit crossed with a car park security office.

The Sound City recording studio is defunct, but even in its heyday it was ''kinda dumpy'', according to Butch Vig, the producer of Nirvana's Nineties-defining Nevermind album.

The studio always looked one step away from derelict, with floors seemingly made less of carpet and wood than human detritus. Kevin Cronin, of the rock band REO Speedwagon, called it ''a shithole''.

Dave Grohl agrees with Cronin's assessment. Nevertheless, the 44-year-old Foo Fighters frontman and one-time Nirvana drummer chose the studio as the subject of his directorial debut. His documentary film, Sound City, charts the studio's four-decade history.

Driving through the Hollywood Hills on the way home from a preview screening of the film, he recalls walking into the studio for the first time as a young musician: ''I walked in the front door and I thought, 'Oh no, this place is a f---ing dump. Then I looked at the wall and I saw [gold and platinum records for] Tom Petty, Fleetwood Mac, and I saw Rick Springfield and I saw Neil Young ... All of these people came to this shithole to make records.

''And then, once I set up, plugged in and hit record, I finally understood. It had nothing to do with who is sweeping up around here; it has to do with this room.''

Sound City tells the story of a room in which Fleetwood Mac recorded their self-titled, career-relaunching album in 1975. The band had, in effect, been reborn at the studio a year earlier when a visiting Mick Fleetwood, his band falling apart again, heard an album by starving duo Lindsey Buckingham and Stevie Nicks and thought, ''They're just what my band needs.''

This was the studio in which Nirvana, Cheap Trick, Rage Against the Machine, Guns N' Roses and Johnny Cash made some of their most important records. The studio was virtually the last outpost of analog recording in the digital age, until economic reality hit in 2011 and the doors were shut for the last time.

But the film is about much more than that. It examines the strange alchemy that happens when musicians get together to make something. It is a voyage into the mythology of making music - something that Grohl says excites and flummoxes him as much today as it did when he first plugged in a guitar.

''I wanted to show people that there is more to the music they hear on the radio than just the sound,'' he says. ''It's more than just the instruments and it's more than just the band; it's the people behind the instruments and the room where it was recorded and the people who built the studio ... For me to be able to tell all these people's life story was a f---ing honour. It was great.''

Sound City's technical elements were not what made it special - not even its famous Neve recording console, which attained near-mythical status among musicians. Grohl talks about an ''intangible magic'' that sometimes happens during the recording process.

''When you find a space where it happens over and over and over again, you have to consider that there is something about that room or something about that [console],'' he says. ''We'll never know how to define it or describe it, but if you've ever heard a song that you connect to emotionally ... that's the magic. It's not something you learn; it just happens and Sound City was certainly filled with that sort of intangible magic.''

Grohl chose not to seek advice from more experienced directors: He explains: ''I knew exactly what I wanted to say and I knew the story of Sound City because it is a part of who I am. I never took a creative-writing class but I do know how to tell a good story.''

Nor did he ask for hints from professional interviewers: ''I was basically calling all of my favourite musicians and asking them to sit down and talk about music with me. Which is what we do anyway; we just happened to have cameras rolling.''

Grohl's approach to filmmaking echoed his approach to music. ''With the Sound City movie, [at] one of the first meetings that I had with my small crew of people, I said, 'Look, I don't want any Hollywood people involved at all.

"I don't want anyone telling me that's not the way it's done because, had someone told me that when I started playing the drums, Nirvana wouldn't sound the way Nirvana sounds. If someone told me that's not how you play guitar, I wouldn't have written some of the songs that I've written.'

''It's all those bad habits and those mistakes I make that gives what I do personality. When it comes to making art, when it comes to creativity, there should be no right or wrong. As long as you have the tools, you should just go with what you feel and go with your heart. And that's exactly what I did.''

Some of the world's famous studios, such as Sun in Memphis and Motown in Detroit, have become virtual museum pieces, but thanks to Grohl, Sound City's Neve console will have a second life.

When the mixing board was installed in 1973, it cost twice as much as a standard house in the San Fernando Valley. When the studio closed, Grohl bought the board and installed it in his home studio in LA.

''We had to clean that thing out with a f---ing toothbrush when we first brought it into my studio because there was so much cocaine and fried chicken in it,'' he says. ''That thing survived the '70s, you know. It could make its way through an apocalypse.''

With the board in place, Grohl invited his friends - members of Cheap Trick, Foreigner and Nirvana; artists including Rick Springfield and Paul McCartney - to write and record in the old-fashioned, analog, face-to-face method of Sound City.

It was not an exercise in nostalgia. Grohl hoped to prove a point, summed up in a question: ''If you were to write a love letter to a girl, would you send it in a text? Would you send it in an email? Or would you put pen to paper, stuff a rose in it and wrap it up in a bow and hand it to her?''

In other words, sometimes an old way is still the right way to make art. Or as Grohl puts it when talking about the console: ''That board isn't dead. It may be old and it may seem obsolete and impractical to have something the size of the Rolls-Royce in your studio, but in reality it does something that you can't get anywhere else.''

Grohl tells a story about coming home on a recent afternoon with the massive Beatles vinyl box set: ''My daughter Violet - she's almost seven years old - loves the Beatles. [She] knows all the words, knows all the songs and she says, 'What is that?' I said, 'It's the Beatles records,' and she opened it up and pulled out the albums, holding them in her hands.

"I showed her how to pull them out of the sleeve and I got the record player, put it in her room and told her, 'You put the stem in the hole, you hit start, put the needle down; be careful, be gentle,' and I left her there.

''She sat in her room, listening to all of the Beatles records, with the sleeves scattered over the floor, reading the liner notes. The experience made it so special. It was no different to you and I when we were six years old; it was the exact same thing.

''The world has changed, technology has changed [but] the people really haven't. Children haven't, that's for sure. They live in a world that is much different to the one we grew up in but children are children and one of the reasons I made the movie was to inspire the next generation of musicians to appreciate those things the way that I did. Because it's still entirely possible.''

Sound City is available for download at buy.soundcitymovie.com. The soundtrack, on CD, and the film, on DVD and Blu-ray, will be released on March 8.