fix memory leak: take ownership of input, and delete it.
no need to init device manager manually, devices_manager do it already
fix bug: kAC is 1
Add WriteSoftDiff()
change memory range to constants
fix memory leak