hw: use ref counted buffer and new api. no warning about deprecated apis