Welcome, Guest. Please login or register.

Author Topic: Os 3.1.4 - List of bug fixes and changes by component  (Read 85376 times)

Description:

0 Members and 1 Guest are viewing this topic.

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #134 from previous page: December 13, 2018, 11:22:30 AM »
Maybe a bit more in-depth information on one of the datatypes, the animation.datatype and anim.datatype. Actually, they sound related, but their job is a bit different. The animation.datatype is the generic base to play animations, in the same way as the picture.datatype shows pictures. The anim.datatype is specifically there for interpreting IFF ANIM files, and therefore related to the ILBM datatype, which are IFF pictures. Besides ANIM, the only other datatype "on top" of the animation.datatype is the CDXL.datatype, which plays very simple animations, small movie clips more than video (given the resolution and bitdepth Amigas can handle).

Animation was one of the things we debugged for too long, the ratio between bugs and actual code was... quite surprising, to put it mildy. First, you need to understand how this thing works: Animation launches two tasks, one that continuously pulls data from disk and puts it into a ring buffer - via the ANIM.datatype or anything else that reads files that represent video - and a second task that plays the frames. Problem with the 3.1 version is that there is absolutely no synchronization: Both task access the same data structures, without even using a semaphore. Clear enough, this cannot work. When one task accesses a data structure while the other is modifying it, you are calling for problems.

Olaf had this fixed for 3.9, so there are now semaphores for the ring buffer. Unfortunately, the problems did not stop there, so the 3.9 version is not working very well at all. One of the anoyances was that decoding of frames worked when playing forward, but - due to the dependencies between frames in the ANIM format ("P-frames" as one would call them) you could not reliably seek backwards. You were often left with junk on the screen because the decoder used the wrong reference. Which was fixed, of course.

A second interesting effect was that most anims played with two frames too much. This is one of the "features" of IFF ANIM, namely that the last two frames reconstruct to images that are identical to the first two - the reason for this is that DPaint wants to enable players to play the anims in a loop, without having to go through a full decode of the first two frames ("I-frames"). So the last two frames are predictive frames that go back to the initial two frames. There are two frames, not one, because ANIM uses a front-buffer (shown on the screen) and a back-buffer (in which data is computed), and swaps between them for every frame. Which was exactly the problem why seeking backwards did not work reliably.

Then we have screen modes that may turn out to be a problem: For example, HAM8 can not be played "as is" on an OCS/ECS machine. It could be played if colors are quantized down to a retricted palette, and it could be even played in original quality if RTG graphics would be available. Only that the datatype did not attempt any of that. This also changed, and we got for a couple of additional cases custom "renderers" that reduce the quality to be able to display the animation on the workbench, or on an RTG screen. Previously, the datatype would only show an error requester.

Synchronization between the two threads (loader and renderer) was also a bit... strange. One would typically do that with message parsing: "I'm ready to take four frames, preload them from disk", and so on. This natural Amiga communication protocol was apparently too much - instead, the datatype uses about four signals, depending on what the loader should do (load, stop abort, preload, exit...). Unfortunately, if the player is busy, and does not require any extra frames, the loader... just busy-waits and burns CPU time the renderer could use for showing frames.

Needless to say, I stopped this and I'm halting the loader task now if it has nothing to load, so the datatype is no longer a CPU hog. You saw this problem on 3.1 and on 3.9 even that the scroll-bar was quite "quirky" to use - it sometimes did not react, the mouse pointer was frozen, just because the CPU was locked on the player thread and the input.device (responsible for moving the pointer) did not get the CPU until the player released a critical semaphore of intuition, because it was busy waiting for the loader, and the loader was busy... doing nothing. Great job, folks.

Since the animation.datatype was written by the same guy as the sound.datatype, similar problems continued there..., but more on this later.
 
The following users thanked this post: Steady, Tygre, First Ninja, NinjaCyborg

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #135 on: December 19, 2018, 01:47:26 PM »
Quite a while ago, I already reported on the printer.device, and that it was the most nerve-wrecking experience we had with 3.1.4. So far, I always believed that graphics is bad, but despite it smaller size, printer made more trouble, for multiple reasons.

First, there is the Os 3.1 printer device and the new development from H&P for 3.9. Unfortunately, we do not have the 3.9 version, so this was not an option. The 3.0 version was not an option either as it does not support printing of RTG graphics - it has no clue about it. Then, there is the V58 or so version from Os 4.x, but this was not an option either because it was full of constructions that are only supported and meaningful in 4.x, such as library base access.

Hence, no good options for development. We settled for an intermediate version which was before the integration of many Os-4 specific constructions, but branched off from the V40 version from 3.1. It turned out that this wasn't a good option either, but the best we had.

The first problem we noticed was that buffer management was broken. Actually, broken in similar ways than in the 3.9 version. If you had an old slow pin-printer, you may have noticed strange artifacts at the left of the page. This happens because the printer driver renders into the output buffer while the printer is printing it, and as old parallel printers are relatively slow, the printer isn't ready before the line buffer is touched again, so 3.9 was actually unusable with anything with a slow parallel interface.

Another gymmick of the 3.9 version was that it supports multiple printers. This was re-implemented in the Os 4.x variant, and we had it. But it had the bad side-effect that whenever you opened the printer device, it would re-load the printer driver from disk. This is probably not much of an issue with harddisk users as of today, but it is clearly an anoyance if you want to print from floppy as it causes a "please insert ... in any drive", everytime you want to print. Our printer device is now smarter and buffers drivers.

Unfortunately, more issues in printer drivers remained: They all have an initialization code that opens core libraries and returns a failure code in case initialization failed. Though the printer.device never checked... so if initialization failed, the printer.device would fall over. Unfortunately, someone (ehem, Olaf) must have mis-read the documentation when implementing the HP printer drivers for 3.9. Instead of an error code and 0 for sucess, they return 1 for OK and 0 for error, quite the reverse of what is needed. This was never noticed in 3.9 because there was never any check, but for V45, there is a check and hence printer drivers from 3.9 just do not work in 3.1.4. However, we updated all of them, and the 3.1 drivers are ok in this respect. Just do not use the 3.9 drivers.

Then, Floyd-Steinberg dithering did not work as it required a larger buffer than it allocated, and then left artifacts on the right hand side of the page, at least for low resolutions. This kind of thing happens if you never attempted to print with a old-style needle printer with a stunning resolution of 90dpi. Ok, so this was noticed by our beta-team (thanks!) and hence fixed as well.

In 3.1 and 3.9, the printer.device checks for out of paper and offline conditions, but in 3.1, you could never abort printing. Yes, there was a nag requester "Printer is out of paper...", but if you attempted to abort printing, it just came back. The error was never propagated "upwards" in the code, and the only thing you could do is either insert paper - or reboot the machine. Even worse, it checked the parallel port pins just the wrong way around and hence always reported the wrong error. "Out of paper" if the printer was offline, and "offline" if the printer was out of paper. The Os 4 version also has this inverted, and while Olaf invested quite some time to make the printer abort printing, it was neither completely succesful. Just going through all the layers of the software, and checking consistently for abortion conditions is quite a hassle.

So my tests with my antique Nec P6 seem to be succesful in so far as that aborting a print now really aborts it. This is a bit touchy - you cannot simply "pull the rug" in the middle of an ESC-sequence which prints a dot graphic because if you want to continue printing later, the new commands would then be understood as part of the ESC-sequence graphics that was unfinished and part of the aborted first printer job. Apparently, Olaf missed this - you cannot just abort printing "anytime", you can only abort after the end of a control sequence.

Printing with hp printer drivers turned out also to be a hassle, even though we had updated sources, thankfully provided by Olaf who also wrote them for 3.9. Whenever we tried, graphics came out just garbled. It took a while until we found the reason: There was a silent interface change from 3.1 to Os 4.x how graphics is exchanged between the printer.device and its drivers. In 3.1 and below, the expansion of graphics (i.e. magnification to the printer resolution) is half done by the printer.device and the driver. What the driver receives is a "run-length" compressed version of the low-resolution graphics and the run sizes, i.e. two arrays: The graphics data, and the expansion factors for each pixel. For Os 4.x, the expansion factors are always 1, and the graphics is expanded by the printer.device. This allows to use old printer drivers with the new printer.device, but not using new printer drivers that do not handle expansion with the old V40 code of the printer.device we had. Hence, I also updated the hp drivers from Olaf to support the type of runlength coding used in the 3.1 world.

Then, we had similar bugs for downscaling graphics instead of upscaling graphics. If you downscale in x direction by a factor of sx, and in y direction by a factor of sy, the printer.device uses a rather naive "box filter" for the downscaling, i.e. it sums up all pixel values in boxes of size sx times sy, and then divides by the box size. Or rather, it should. In fact, it divided by sx+sy instead of sx*sy, which does, of course, just give nonsense. Strangely, nobody noticed before.

All this averaging and downscaling has several implications on HAM graphics as well: Here, the printer.device has to emulate the custom chip hardware and has to "hold and modify" pixel values itself. This is all simple if you just have single pixels, but if you also have to take averages over pixels for downscaling, things can go wrong - and did go wrong. So HAM printing was broken in V40, and probably is still broken in Os 4.x (not that these machines have HAM in first place).

The printer.device also supports  a primitive form of "color correction" that, essentially, attempts to adjust between the different gamma exponents of screen and printer, and the different color densities. It's all a bit naive, but whatever... it should work, which it did not if downscaling was involved. Actually, the way how it works is that it modifies the palette before printing the image, hence - it  does still not work with true color graphics or HAM, both of which do not have a palette. Speaking of true-color images, printing these images sideways was broken, too, and just generated nonsense.

So, this was really an extremely bug-ridden piece of code, and I believe there was not a single source file that remained untouched. It should be fairly ok now.

More words of warning: As already said, do not use the Os 3.9 printer drivers. They simply won't work as their initialization code returns the error indicator just the wrong way around. Use the 3.1.4 supplied drivers, which were all refactored - not only the hp drivers, also the Epson and NEC drivers were updated and cleaned up and tested. (Guess who has a NEC?). In worst case, use the Os 3.1 driver, or send me a line if you want it updated and are willing to help testing. However, they should continue to work unchanged.

A second (not-) change is the preferences system. Os 3.1.4 uses the Os 3.1 preferences system, which means that there are separate preferences files for the printer and the printer graphics configuration as these are two different preferences programs. In 3.9, this moved all to a single program and a single file. While the printer.device of 3.1.4 supports and reads the 3.9 preferences files just fine (it is just another IFF dialect) the 3.1 settings from the second preferences file override the 3.9 settings. So, either use the 3.1.4 preferences program consistently, or delete the printer preferences in ENVARC: and only use the 3.9 preferences program. Both works, but do not mix. In case of doubt, delete the printer preferences from ENVARC: and create new ones, this will work.

A feature we do not have is the printer preferences preview. This was added in the 3.9 printer.device -namely to generate a preview using the latest settings - but documentation how to do that is missing. Hence, no preview for 3.9 preferences. As soon as we find out, we may add it.

 
The following users thanked this post: Steady, Orphan264, Tygre, First Ninja, NinjaCyborg

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #136 on: December 19, 2018, 06:22:45 PM »
The post was long enough, but I still forgot something...

Laserjet printer drivers... The laserjets, and actually most modern printers are page-printers, not line printers. That is, they receive an entire page, and then print it once it is complete, unlike the old-style needle-printers that printed graphics line by line as it comes in.

This has an impact on how the printer drivers work, and this may be a bit confusing at first: Whenever the printer driver closes down, it has to eject a form feed as otherwise nothing is printed at all. Hence, if you redirect several commands to PRT: such as
Code: [Select]
list >PRT:
dir >PRT:
the output of list and dir will appear on separate pages for the laserjet and deskjet printers simply because the shell closes the redirection file after each command.
The alternative would have been not to print the form feed, but this would mean that you probably do not get *any* output at all until you run a command that prints a form feed, manually.

I decided against this. This is error prone, and even worse, "service prone". Consider the bug reports  on "my printer does not work" if there is no output, even though there is clearly a redirectio to PRT: in the shell. It is one of the decisions "you cannot simply do it right".

There is a second strange "gotcha" in the printer drivers for the HP printers, and this is due to PPaint (Cloanto, do you read?). This program tries to outsmart the printer driver to allow borderless printing on some printers, at least. For this, it first reconfigures the page size to "wide tractor", no matter what the user configured as page size, and then computes the page limits manually, and prints "white" in those page areas that are, according to PPaint's computation, within the printable area.

Now, there is no "wide tractor" paper option for the HP printers. Only A3 and A4, US Letter and US Legal. So the hp drivers have to "outsmart" PPaint and emulate such a page. Of course, the printer cannot print on wide tractor settings, but at least it can return the page defintions such paper would have would it fit into the printer, and this is good enough to make PPaint happy and let it indicate and let you choose the correct page size.

So, in case you wonder: There is a wide tractor setting in the printer preferences for the HPs, but simply do not use. It's a dummy, just to keep some programs happy.
 
The following users thanked this post: Steady, Tygre, roberthazelby, First Ninja, NinjaCyborg

Offline 10MARC

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #137 on: December 21, 2018, 05:25:49 AM »
On the topic of printer drivers - I use NETPAR that replaces the parallel.device to print to a network printer. It seems to work fine with my 3.1.4 installation. Should there be any problems using it? Are all of the changes in the printer drivers and not the parallel.device?
 
The following users thanked this post: kas1e, roberthazelby

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #138 on: December 21, 2018, 01:00:32 PM »
No, no worries. There is no interface change from the printer.device to its backend printers. Actually, there is not even a need for a replacement parallel.device for network printing as the printer.device supports printing to any other device (including netpar.device),
but unfortunately we currently do not have any GUI to change this setting.
 

Offline QuikSanz

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #139 on: December 21, 2018, 03:36:26 PM »
@Thomas Richter,

What is the difference if any between the 3.14 ROM's and the 3.X ROM's from Cloanto?

Chris
 

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #140 on: December 21, 2018, 04:24:02 PM »
Oh my... 3.1.4 is, despite its moderate name, a rework of the 3.1 operating system, including RAM components, not just the application of uncarefully applied binary patches hacked into the ROM.
 

Offline QuikSanz

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #141 on: December 21, 2018, 04:58:57 PM »
Thank you,perfect. Now I just need to find some in stock, looks like everyone is a no stock :(.....
 

Offline BozzerBigD

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #142 on: December 21, 2018, 05:23:42 PM »
Quite a while ago, I already reported on the printer.device, and that it was the most nerve-wrecking experience we had with 3.1.4. So far, I always believed that graphics is bad, but despite it smaller size, printer made more trouble, for multiple reasons.

Wouldn't it be far easier just to buy out the TurboPrint source code and concentrate on new drivers for that superior system. You seem to think it is still important to support dot matrix printers in 2018 just because Workbench 3.1 did. I really am confused at bug fixes of pointless outdated parts of the operating system that no one interested in printing used past 1993 anyway!!
"Art challenges technology. Technology inspires the art."

John Lasseter, Co-Founder of Pixar Animation Studios
 

Offline Pgovotsos

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #143 on: December 21, 2018, 05:34:06 PM »

Wouldn't it be far easier just to buy out the TurboPrint source code and concentrate on new drivers for that superior system. You seem to think it is still important to support dot matrix printers in 2018 just because Workbench 3.1 did. I really am confused at bug fixes of pointless outdated parts of the operating system that no one interested in printing used past 1993 anyway!!

Believe it or not but there are still uses for dot matrix printers. I have software we wrote in SuperBase for our business. They print on carbon paper. Sure I could rewrite it to print multiple pages on a laser printer but I couldn't be bothered. This works perfectly as it is. So, personally, I am glad for fixes like these.
 

Offline Pgovotsos

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #144 on: December 21, 2018, 05:38:20 PM »
Thank you,perfect. Now I just need to find some in stock, looks like everyone is a no stock :(.....

You can always burn your own or use a Deneb or Kickflash if you have one. You can put the Intuition.library in that you need also.
 

Offline kamelito

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #145 on: December 21, 2018, 06:13:51 PM »
Since development of 3.1.x restarted why don't Hyperion release Toolmaker (latest 1.19?) along with the upcoming SDK/NDK?
 

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #146 on: December 21, 2018, 07:27:31 PM »
Wouldn't it be far easier just to buy out the TurboPrint source code and concentrate on new drivers for that superior system.
Buy from whom? And pay with which money?

I really am confused at bug fixes of pointless outdated parts of the operating system that no one interested in printing used past 1993 anyway!!
Hey, my P6 still prints fine, and I want to continue to use it. It outlasted all printers I bought later. (-: But yes, hp printers using PCL and postscript printers are also supported.

Most "modern" printers besides postscript and PCL printers are GDI printers,meaning all rendering is done by Windows - documentation is not available.

Hence, at present, the three open printer languages: PCL (hp) EscP (epson, Nec) and postscript are all supported. Everything else you find today is proprietary Windows only.
 
The following users thanked this post: Tygre

Offline BozzerBigD

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #147 on: December 21, 2018, 09:59:56 PM »
@Thomas Richter

Quote
Buy from whom? And pay with which money?

Buy from the owner: IrseeSoft.
Buy it with Hyperion's legal war-chest money. Better to spend it on that source code acquisition than lawyers IMHO.
"Art challenges technology. Technology inspires the art."

John Lasseter, Co-Founder of Pixar Animation Studios
 

Offline Minuous

Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #148 on: December 22, 2018, 03:22:43 AM »
This is by default on the workbench, but not on custom screens, but every constom screen can request it by a flag or a tag.

SA_OffScreenDragging (SA_Dummy + 0x2A) like on OS4?
 

guest11527

  • Guest
Re: Os 3.1.4 - List of bug fixes and changes by component
« Reply #149 on: December 22, 2018, 09:25:35 AM »
SA_OffScreenDragging (SA_Dummy + 0x2A) like on OS4?
Precisely.