debugged filling samples buffer