Building materials manufacturers are getting their long-awaited chance to raise prices.

In recent weeks price increases have been announced for cements, roofing hardboard insulation and some other building products. And the higher prices generally are holding.

Demand has picked up lately, while inventories are low because the cold spell earlier this year interrupted production and shipments. Also producers say the market appears less resistant to higher prices.

Last year was a different story. Price boosts crumbled in the face of tough customer opposition soft markets and excessive inventory building. Asphalt-roofing prices for example, rose sharply throught August 1976 but tumbled in the final part of the year. By last January they were practically unchanged from a year earlier, according to the latest construction review by the Department of Commerce.

Now, with market conditions improving manufacturers are putting through price increases to try to offset higher energy and raw materials costs.

John-Manville Corp. said the costs of materials and supplies used in its building products manufacturing have increased about 15 per cent in the past year. Recently the company raised prices of its home insulation and roofing products 6 per cent. Last year it didn't put through any increases on those products.

Much of the improved demand for building materials is coming from the residential building and remodeling market. They National Association of Home Builders estimates that housing starts this year will jump 21 per cent to 1.9 million units from last year's 1.5 million.

But a lot of homeowners and apartment dwellers can't afford a newly built home so they are remodeling existing dwellings. This do-it-yourself market last year accounted for 30 per cent of the estimated $30 billion in building materials sales for residential remodeling, said Carmine J. Muratore an analyst with Blyth Eastman Dillon & Co. In 1966. By contrast that market accounted for only 10 per cent of the $6 billion in materials sales for remodeling.

Demand for building materials in other parts of the construction market has been weak, however. Some building-products prices reflect this. Interpace Corp., a Parsippany, N.J., building-products maker, hasn't increased prices of its concrete pipe for water and sewage transmission despite rising manufacturing costs, said William R. Hartman, president. "The market is very competitive right now, and there is a great deal of surplus manufacturing capacity," he said.

Another manufacturer, Keene Corp. said it hasn't been able to recover higher costs in production of its metal grating and lighting fixtures because of soft markets.

Particular strength already is being shown in cement and gypsum prices. Jim Walter Corp., a Tampa, Fla. homebuilder and building-products supplier, raised its gypsum prices about 8 per cent last month.

The company said it plans another increase in late May of about 9 per cent. Other gypsum producers and distributors also are raising prices. Last year they had trouble making price increases stick and resorted to steep discounting.

Lone Star Industries, a major cement producer put into effect prices increases ranging from 11 per cent to 16 per cent in its markets last January and other producers also have raised prices.