Hi all,

I have done some modifications to the current v4.2 hg version.

MIDI
-------

First of all MIDI support is no enabled (by default). However it can be 
disabled by using the --config-midi=NO parameter when running the 
configure script. This means that the /dev/midi## devices are now 
functional up to some degree. However everything is still undocumented 
and some functionality is unimplemented.

There is no /dev/sequencer (/dev/music) interface/device any more. 
Instead all /dev/midi## devices can be used in two modes. The first one 
is the usual "raw" MIDI port mode that has been in OSS since year 0. 
Bytes written to the device file will be sent out as quickly as 
possible. All received bytes will be passed to the application. However 
active sensing (0xfe) will be stripped.

The second mode is some kind of timed/cooked mode that can be turned on 
by calling SNDCTL_MIDI_SETMODE. There are two variants that differ in 
timing. In MIDI_MODE_TIMED all times are relative to the previous time 
stamp written to the device. In MIDI_MODE_TIMED_ABS all times are 
absolute (relative to the moment when the device was started).

In timed mode the applications write/read data organized in records. 
Each record has a 32 byte header (midi_packet_header_t) that contains 
everything timing related. Bytes contained in the payload will be 
delayed until the right moment of time and sent to the device only after 
that. Times can be in microseconds or in MIDI ticks.

Currently timing is based on the system timer but in the future devices 
that have a hardware timer can be used instead. Each /dev/midi## device 
uses it's private timer instance so each /dev/midi## device can be used 
independently with different timing. In the future it will be possible 
to slave several /dev/midi## devices with the same timer (for example a 
sequencer program can support multiple MIDI devices in this way).

There are two known bugs related with MIDI. First of all some drivers 
that use the uart401 MIDI driver may be unstable if they have not been 
modified to use mutexes in proper way (most drivers have not been 
fixed). The second problem is that (in timed mode) some MIDI bytes may 
get lost which will cause hanging notes.

To play with MIDI you may compile the ossmplay utility 
(tutorials/sndkit/ossmplay). It takes two command line arguments which 
are the /dev/midi## device name and the MIDI file.

The oss_midiloop driver might be good tool for testing. You can use 
ossmplay to play to the client side device and redirect the server side 
device to a disk file (or to some software synth program).

Code optimizations
-------------------------

In addition to MIDI I have done some modifications to the code that 
handles audio format/rate conversions. It's now faster than in earlier 
version that performed the conversions with too short chunks (increased 
call/setup overhead). In particular there is significant improvement 
under Solaris because I added proper compiler flags for better code 
optimization (this cause problems earlier and it's possible that the 
optimized code crashes in some cases).

osspartysh
-------------

Final addition was an utility called osspartysh. It's kind of reverse 
telnet program with stereoids. It doesn't actually belong to OSS but I 
wanted to include it because it may appear to be useful. This program 
can be used when some user wants to help some other user who has 
problems with his OSS installation. It can also be used when two persons 
want to hack on some part of OSS at the same time. See man osspartysh 
for details. However in short the program can be used in the following way:

1) The person who gives support doesn't ask the "customer" to open ssh 
access for root. Instead he launches the terminal side program in his 
computer and opens the firewall/NAT settings if necessary. The terminal 
side listens to a TCP port for the customer to call.

    osspartysh -d -p <free TCP port number>

2) The customer doesn't need to anything. He just runs osspartysh in 
shell mode (osspartysh -h<IP/name of the terminal host> -p<terminal 
port>). After that osspartysh opens a TCP connection to the terminal 
"server" and starts a bash shell.

3) After that both users will see the same shell prompt. They can both 
type commands and they will see all the output. It is possible to run 
commands like vi (there may be some hiccup).

At this moment osspartysh has only been tested under Linux. It may also 
work under FreeBSD. It doesn't work under Solaris and SCO. I don't know 
about Haiku.

Best regards,

Hannu
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to