add pingpong buffer to hpi.c