Maestro
Colin (478) 2433 posts |
Are you sure you are reading the UpCall 8 (UpCall_BufferFilling) from the input buffer only. Sending to the device will generate UpCall_BufferFilling events from the output buffer which will also be seen in your upcall handler. You need to check the buffer handle of the UpCall_BufferFilling event (r1) |
Dave Higton (1515) 3534 posts |
Yes, don’t worry. When I first put my UpCall handler in, I didn’t filter on the buffer handle. But at that stage it was only reporting (via DADebug) the buffer handle, nothing more. It was useful to see that the UpCall handler was being called, and that I could create debug output from it without crashing the machine. Now I know it’s doing what I expect, it filters on UpCall number 8 and the desired buffer, right at the top. Next stage will, I hope, be to get it to do something more useful! Actually that’s the next but one stage; the real next stage is to count ticks at 1kHz from timer 1. |
Dave Higton (1515) 3534 posts |
OK, I’m counting 1 kHz ticks. At first, doing so just crashed the machine, and it took a while for the bleedin’ obvious to strike me… In the interrupt handler, when you’re calling SWIs, DO NOT use the _kernel_swi_regs passed into the handler. Use a separate set. |
Dave Higton (1515) 3534 posts |
I reached the stage yesterday that my UpCall 8 handler saw an UpCall for the USB input buffer, called a buffer manager function (thanks, Colin!) to enquire how many bytes are in the buffer, and send a DADebug message with the number of bytes and the tick number. This appeared to be called about every 99 ms, which I take it must be the period at which the ME50 sends Active Sensing messages. So far, so good. The next addition was code to read those bytes out of the buffer into another buffer. But this completely stiffs the machine (no mouse cursor movement, even). Same result if I purge the buffer, which rules out attempts to read out from the buffer into somewhere I shouldn’t. Now what? Since it stiffs the machine, I can’t get any debug information. When I receive an UpCall 8 that is specifically for me, should I intercept the call? If so, how, given that the module is written in C? Would failing to intercept the UpCall explain the stiffing? I’ve looked over the code so many times. I can’t see anything wrong with it. The remove bytes and flush functions are so similar to the one to enquire how full the buffer is, and are very simple. So are the calls to them. |
Colin (478) 2433 posts |
Care to send me your code? I’m not quite sure what you are trying to do. In SerialUSB I transfer data between 2 DeviceFS buffers for both rx and tx in the upcall handler without problems. I pass on the upcall. I would have thought that midi works similar to a serial device. You may be stuck in a loop in the upcall handler |
Dave Higton (1515) 3534 posts |
There is no loop in the UpCall handler, nor in the assembly wrappers of the buffer manager functions that it calls. But I’ll take up your kind offer, so expect some email soon! Thank you. |
Dave Higton (1515) 3534 posts |
Thinking about it some more, I don’t think I should attempt to intercept my UpCall 8, even if it’s possible to do so, and I don’t think that failure to intercept it is the cause of the crash I’m seeing. UpCalls are fired off by the OS regardless of who’s waiting for it. It’s not like an IRQ, which must be serviced and the IRQ cleared. |
Colin (478) 2433 posts |
Did you get the email I sent? |
Dave Higton (1515) 3534 posts |
Yes, thank you, but I haven’t had a chance to do anything about it yet. Later today. |
Chris Mahoney (1684) 2165 posts |
[Deleted. Post was about MIDI 2.0 and has been moved to FastTickerV thread]. |
Chris (121) 472 posts |
I’m testing a version of Maestro that allows vertical placement of rests, as well as allowing more than one rest to be placed in the same vertical space on a stave. Both of these features are useful when scoring multi-part staves. It all seems to work well here, and degrades sensibly with older versions of Maestro – in this case the vertical placement is just ignored, with the worst-case scenario that you can get some ugly overlaps. Are there any other programs that can import Maestro files? Does Rhapsody do this? If so, can anyone with a copy get in touch and test out some files for me? I’ve used up some spare bits in the file spec to achieve this, and it’s possible that doing so will mess up the file import. Even if that’s the case, I’m not sure whether it’s worth worrying about (how often do people really import Maestro files into music editors?), but it would be good to at least know whether everything still works as it should. |