It wasn't all bromance and backslaps in Ottawa when U.S. President Barack Obama addressed Parliament on Wednesday.

Behind the closed doors of his bilateral meeting with Prime Minister Justin Trudeau, the tone abruptly changed from convivial to tense over softwood lumber — an export industry worth billions of dollars to Canadian producers.

There are different accounts of exactly what happened. But multiple sources tell CBC News the issue first boiled up at a brief meeting between Michael Froman, the Americans' top trade negotiator, and senior Canadian government officials.

From there it spilled over to the formal sit-down meeting in the Centre Block between Trudeau and Obama just before the two entered the House of Commons for Obama's address to Parliament.

"It was quite the moment," said one Canadian source. "Froman tried to pull a fast one on us and the PM called him on it. He was telling Obama that we were making more progress than we are."

During the prime minister's state visit to Washington in March, the two leaders had instructed Froman and Trade Minister Chrystia Freeland to explore options to avoid another protracted trade dispute over softwood lumber and report back within 100 days.

Fresh-cut logs are stacked after being harvested by loggers near Youbou, B.C. Canada and U.S. are once again at odds over the softwood lumber industry. (Canadian Press)

That deadline passed in mid-June but Freeland and Froman continued to talk. She and senior Canadian trade officials were in Washington just last week to discuss the issue.

Canada had hoped for a substantive announcement out of Wednesday's bilateral meeting. But a U.S. source said that was never realistic given that the Americans are heading into the presidential election cycle.

"We need some breathing room here," the U.S. source told CBC News. "We need to get through November, then it's possible another long-term deal could get done."

In an interview for CBC Radio's The House, Freeland wouldn't comment about the closed-door conversations, but said Canada made "good progress this week."

"It is inevitable when you have that volume of an economic relationship that there are irritants, there are disagreements, there are disputes.… We have frank discussions with our American counterparts," she said.

Friendship on display

There may well be time for Trudeau and Obama to use their friendship and shared political views to nail down an agreement before Obama leaves the Oval Office in January.

And certainly that friendship was evident in Ottawa, from the moment Obama stepped off Air Force One.

Obama could be seen chatting and laughing with American Ambassador Bruce Heyman and Gov. Gen. David Johnston.

Sources tell CBC News that Johnston had asked Heyman beforehand what he intended to say to the president.

Obama greets Vicki Heyman, wife of U.S. Ambassador to Canada Bruce Heyman, right, as Gov. Gen. David Johnston, second from right, looks on at the airport in Ottawa on Wednesday. (Justin Tang/Canadian Press)

Heyman said his plan was to tell him that his approval ratings in Canada are at 70 per cent — higher than at home.

He never got the chance.

When the president descended from the plane, Johnston said: "Welcome to Canada, where your approval ratings are 90 per cent. The ambassador will try and talk you down, but that's the truth."

The relaxed atmosphere continued throughout the day, and into Obama's address to Parliament, where he garnered prolonged applause in praising Trudeau's re-engagement with First Nations and focus on promoting equality rights for women and members of the LGBT community.

Obama: 'The world needs more Canada' 1:21

Even his criticism of Canada's lagging commitment to NATO was tempered by repeating Irish singer Bono's now familiar line, "The world needs more Canada."

Yet not a word on softwood lumber. Or an acknowledgement that what Canada needs is more access to U.S. markets, nailed down in another long-term deal.

Sliver of hope?

The previous softwood lumber pact — negotiated in 2006 by the Conservative government — expired last October, but there's a 12-month grace period that bars the U.S. from imposing tariffs on Canadian exports.

That deadline is still a few months away.

But with the U.S. housing market rumbling back to life, softwood lumber shipments have been steadily increasing. Last month, B.C. producers reported the highest first-quarter production numbers since 2007.

It's been suggested the two countries could appoint a mediator, someone with knowledge of the individual demands of the various lumber-producing provinces and strong political connections.

In the end, Trudeau and Obama issued a joint statement setting out common goals for reaching an agreement.

But, while the statement confirms progress had been made in the negotiations, it noted "significant differences remain" over key features, including one designed to maintain Canadian exports at or below an agreed U.S. market share still to be negotiated, and provisions for a region or company to be excluded.

One of the most affected provinces — British Columbia — has been working closely with the federal government on these talks. A B.C. official concedes the joint statement may not seem optimistic at first read, but insists it does offer a "sliver of optimism."

"Before yesterday we thought the chance of a deal was gone," the official told CBC News. "Now there's a feeling that there's at least a small amount of hope."

There is that. Neither the Canadians nor Americans are abandoning the idea that something will get done on this file before Obama leaves office and the bromance is over.