kamalmostafa / minimodem

general-purpose software audio FSK modem
http://www.whence.com/minimodem
Other
846 stars 113 forks source link

Add non-blocking capability with --tx-carrier #13

Closed aquila12 closed 9 years ago

aquila12 commented 9 years ago

I've added a non-blocking capability, using read() in place of getchar(), and using select() to check whether there is data on the input. This means a carrier tone can persist on the line if desired, even when waiting for input data.

To cope with the 'idle' line state, I've used a value of 2 in tx_transmitting to signal that the preamble has been set, where 1 now reflects that the carrier has been present for the necessary time. This enables sync bytes to be sent before actual data, even when the carrier is being transmitted.

aquila12 commented 9 years ago

ALSA seems to accept arbitrarily large amounts of data rather than blocking, which makes it break with --tx-carrier. [ Fixed in subsequent commit ]

aquila12 commented 9 years ago

If ALSA latency needs to vary from system to system, it might be worth having a command-line option for it.

kamalmostafa commented 9 years ago

Thanks for your minimodem enhancements, Nick! I'll review this and respond early next week.

aquila12 commented 9 years ago

Tweaks as requested - also squashed into two commits.

kamalmostafa commented 9 years ago

Looks great, Nick! Thanks again for --tx-carrier. Very useful!