Hi
30 KHz could be possible, but I would say only if done as kernel module, not as user space application.
It would be better to use some timer to count pulses, but this as well may still need kernel module development.
Are you developing with linux?
Antti