use frame serial
add global DEBUG flag
wrap printf()s to DEBUG
init channel frame serial to -1