Project: The Sound of Violence.
Software development ran into a major problem – I can’t get write() to the serial-port to cooperate with read() from the serial-port, thus blowing the planned device-self-identification idea out of the water. It’s wierd, I used to be able to do termios programming and modem-control in my sleep, but I just can’t get to the bottom of the problem here. As long as I tie CTS into the asserted state (using the breakout box), everything works, but as soon as I let it float, the synchronous write() succeeds but the *read()* times-out. Wierd.
In desperation, I opened a “tip” (terminal-emulator) session with CTS disconnected, and everything typed came echoing right back. At any baud rate chosen. The breakout-box LEDs flashing just right at 110 baud (the transitions are so fast at 4800 baud that the LEDs appear steady, even though the bits come through just right).
Hmmm, just as I thought and remembered: with the right port-mode setting, CTS is ignored. Next step was to truss “tip” and my test program, to capture a low-level system-call trace from each. Inspection of the traces showed that both programs were setting exactly the same port modes and file-I/O modes. Darn! Inexplicable! Oh well, I will have to dispense with the echo-check device-auto-detection method for now, and concentrate on the meat of the software – detecting changes in the modem-control lines. I will be using the breakout box to emulate the PedalBox switches.
The volume-control test program is having better fortunes – I have got to be able to control the audio volume *even whilst another program is driving the audio device*. This is quite easy on Solaris thanks to the distinction between /dev/sound/4 and /dev/sound/4ctl.
It appears that the “gain” setting in the Solaris audio API is in fact a scaled linear value, not a dB gain value at all. There is the possibility that it is hardware-dependant, so I will have to compare the behaviour of the “dbri” audio hardware in the SPARCstation-10 against the “audioamd” in the SPARCclassic and the “cs4231” in the Ultra-10. I’m betting (hoping) that they are all linear-response under Solaris.