During breaks from acting roles that include State’s Attorney James Castro in TV’s “The Good Wife,” Michael Cerveris sings in a New Orleans-based country band.

Viewers of HBO’s “Treme” will also recognize Cerveris as Marvin Frey, the outwardly smiling but inwardly bottom line-obsessed manager of Lucia Micarelli’s musician character, Annie.

In real life, the actor, a resident of New Orleans and New York, says he formed Loose Cattle most of all to have fun. To that end, Cerveris and Loose Cattle have a marathon of local shows planned for this weekend, starting Friday at Chickie Wah Wah.

Spending time in Louisiana reintroduced Cerveris to the folk and old-time country music he grew up with in Huntington, West Virginia.

He experienced an extended stay in New Orleans while filming the 2009 film “Cirque du Freak: The Vampire’s Assistant.” And then he wanted to stay.

During the production of “Cirque du Freak,” Cerveris said, “I started to get to know the city. I stayed for a few months after I’d finished working, because I loved it so much and I’d made a lot of friends.”

Loose Cattle began when the actor-musician and his then-girlfriend, Kimberly Kaye (a singer and trumpeter whose credits include the ska group New Direxion), were going through a rough patch in their relationship. They decided that making music together was a better use of their time than squabbling.

“I called around and found a bunch of friends, and friends of theirs, who were interested in playing country music, with a pretty broad definition of country,” Cerveris said. “The whole idea was to do it casually, not have it be a formal or stressful thing. We picked songs we felt like playing and we played in people’s living rooms, keeping the emphasis on playing music, not trying to get anyplace. It was great fun right out the gate.”

Cerveris and Kaye’s relationship didn’t last, but their band did. Loose Cattle also features guitarist Gabriel Caplan, pedal steel guitarist Jon Graboff, mandolinist Alex Harvey, fiddler Justin Smith, bass and sousaphone player Lorenzo Wolff and percussionist Eddy Zweiback.

Despite Loose Cattle’s casual intentions, it has performed for NPR’s “Mountain Stage,” at Joe’s Pub in New York City and made an album, “North of Houston.”

“Performing opportunities fell in our laps,” Cerveris said. “But we still keep the focus on having a good time.”

While living in Louisiana and filming the HBO drama “Treme,” Cerveris also became a Cajun music fan. The Red Stick Ramblers, a Cajun and swing band, played “Treme” character Annie’s band in the series. The Ramblers have since disbanded, but fiddler and former Rambler Linzay Young now sits in with Loose Cattle.

“The thing I love so much about Cajun music,” Cerveris said, “is that there’s almost no division between the audience and the performers.”

Everybody plays and the music is woven into dinner and the evening and life. That’s what I want Loose Cattle to feel like. No grand aspirations, but it turns out that’s a good way to have nice things happen for the band.”

Back in TV land, Cerveris has a great acting gig with CBS’ “The Good Wife.”

“The feeling on set is terrific,” he said of the critically acclaimed legal-political drama. “Everybody is so happy to be there. And it comes from the top down. Juliana Margulies is the most fantastic quarterback that we could hope for.”

The actor doesn’t know, however, if his character will stay on the show. Season five, for instance, ended with the possibility that Margulies’ Alicia Florrick would run for the office of state’s attorney.

“Which is my job,” Cerveris said. “But nothing is ever that straightforward on the show, so I don’t honestly know what will happen. But I hope James Castro is going to be in office a long time.”

Michael Cerveris and Loose Cattle are peforming at 8 p.m. Friday at Chickie Wah Wah; 2 p.m. Saturday at the Louisiana Music Factory; 6 p.m. Saturday at Siberia; and 5 p.m. Sunday at Kajun’s Pub.