gsoc2011

Batiseur: not a bed and breakfast

Blog post by jrabbit on Sun, 2011-08-07 15:14

In these last few (official) weeks of Google Summer of Code I’m focusing on the meat of my project. This means that side features like the achievements, scoreboard etc will be ‘frozen’ as-is until after GSOC. I’m planning on rounding them out, just not yet. The main work will be on the builddrone working properly and testing/signing. A major but was in the camlistore python library, I’ve fixed it and will change how it works a little.

I wrote a haikuports standalone validator which can be used in an upcoming version of haikuports possibly or just for your own amusement on a simple bepfile. (Hint you could wrap this in a git-hook and then only allow a commit if your beps pass!) On the builddrone front I fixed a bunch of assumption-related bugs that came from not testing.

BONUS: WPA derived propaganda

Language Bindings for the C++ API: Third Quarter Report and Fourth Quarter Goals

Blog post by jalopeura on Sat, 2011-08-06 08:10

The following classes are now mostly implemented; there are some methods that cannot be implemented yet because they require objects that are not yet implemented, but otherwise these classes are complete.

From the Application Kit: From the Interface Kit: From the Support Kit:
Application
Clipboard
Cursor
Handler
Invoker
Looper
Message
Alert
Box
Button
CheckBox
Control
Font
Menu
ListItem
ListView
MenuBar
MenuField
MenuItem
OutlineListView
Point
PopUpMenu
RadioButton
Rect
Screen
ScrollBar
ScrollView
SeparatorItem
StringItem
StringView
TabView
TextControl
TextView
View
Window
Archivable
Errors*

*Errors doesn't actually have any classes, it merely exposes a lot of constants to the target language.

My goals and results for the last quarter:
- Continue to test threading issues (Done)
- Expand existing bindings and add new bindings (Done)
- Fix bugs reported by users (None reported)
- Enable structs (Done)
- Expose globals (Done)
- Add documentation (Partially done)
- Write additional and more complex test programs (Done)
- If there is sufficient time, select a third target language (Insufficient time)
- If there is sufficient time and user interest, work on overloaded operators (Done)

No users have reported bugs yet, but I found several of my own, including a threading problem. Perl passes arguments and fetches results via a stack. The stack is maintained by the interpreter, which lives in the main thread. When multiple threads write to the stack at the same time, the arguments and return values can end up mixed. I solved it by calling be_app->LockLooper() before doing any stack manipulation and be_app->UnlockLooper() once I was done.

I didn't uncover this bug until I was writing a complex example program, with lots of events coming back from the system. I learned enough Python to write minimal test programs, but I don't have any complex examples in Python, so there may be hidden bugs in the Python bindings. (This particular bug won't be an issue though, because Python doesn't use a stack to pass values to and from functions.)

It would be a big help if interested users were to download the bindings and try them out, especially the Python bindings. The bindings can be downloaded from the files pages on the project site (http://dev.osdrawer.net/projects/perl-haiku-kits/files). (Edit: Removed erroneous '>' from the end of the URL.)

While researching the best way to handle structs, I found a reference (http://www.parashift.com/c++-faq-lite/classes-and-objects.html#faq-7.8) which indicated that classes and structs are the same thing as far as the compiler is concerned. And some Haiku structs do in fact take constructors and methods. So since I already had a way to expose classes, I used the same method to expose structs.

I have some more partial documentation for the classes, and I have started on documentation for the generator itself.

There was no time to add additional target languages. I'd still like to, but I won't be able to fit it into GSoC.

During the rest of GSoC, I will be fixing bugs, writing documentation, and creating more code examples. I still have several groups of classes that I want to include, but I won't have time to implement them before GSoC ends. (Mostly these classes are layout-related, drawing-related, and query-related.)

Goals for the fourth quarter:
- Fix bugs reported by users
- Add documentation
- Write additional example programs and enhance existing ones

GSOC 2011: Three-Quarter Term Milestone Report

Blog post by antifinidictor on Fri, 2011-08-05 21:17

So far SDL 1.3 for Haiku has made significant progress. Video draws correctly both with and without opengl, audio appears to already work, and various tests provided in the SDL test suite seem to work. However, there are a few significant bugs I have come across.

The first error occurs when resizing the window. The application occasionally receives the illegal operation signal or a SEGFAULT. The illegal signal operations occurred when blitting from the backbuffer I allocated to the screenbuffer provided by BDirectWindow's DirectConnected() function. Presumably this was caused by the window being resized in the middle of a draw operation, since this error only occurred after I moved blitting to a separate thread. Before this, blitting was done in the application thread, and caused a slowdown of SDL's event handling by up to 1 second (moving around the mouse required redrawing the window). I received several suggestions to fix this error, including move the blit code back to the application thread, use mutexes, and use BBitmaps. I have since transferred drawing operations to a BBitmap object, which appears to have removed the illegal operation signal. However, resizing the window continuously will result in the occasional SEGFAULT. I only discovered this error today; I intend to investigate it further over the weekend. So far I have noted that the SEGFAULT occurs in different places on different runs, although I have not officially found a connecting pattern.

The OpenGL implementation is incomplete, but works surprisingly well, thanks to BGLView. There are problems with loading libraries, however; for some reason, the flag indicating a library was successfully loaded is being set to false. I will experiment with this error in the coming weeks, and hopefully resolve it. OpenGL also has a resizing issue where any attempt to resize the window causes the program to freeze- without setting off any errors or signals in gdb.

In addition to fixing these errors, I intend to add functionality that I missed in the process of writing the video code. For instance, many SDL flags passed to the window are not yet handled; currently only window resizing capability is used.

I intend to add to this list over the weekend, and possibly after the due date of this blog.

Note that the SDL repository I am editing is available at bitbucket.org (but I have not had access to internet this week up until today, and won't be able to upload the most recent changes until Sunday at the earliest): https://bitbucket.org/antifinidictor/haiku-sdl-1.3/

VBox guest additions: 3/4 term report

Blog post by scgtrp on Thu, 2011-08-04 04:12

New status report:
major feature dropped; bugs fixed;
did some screen research.

At the start of the third term, it was pointed out to me that Haiku does not actually support hardware 3D acceleration, and to add it would be a larger project than I have the time (or knowledge) for. Therefore, I've had to drop host-accelerated OpenGL from the planned features. I'm somewhat annoyed by this, but looking back it was probably a bit too ambitious anyway, and I'm not convinced I could have finished it in time.

As a result of this quite large decrease in scope, I decided to mentally revise the timeline and spend most of my coding time in the third quarter fixing some of the annoying bugs that had been following me around for a while:

  • Icons can now be dragged around without having to disable MPI first.
  • VBoxService no longer implodes on exit.
  • vboxsf no longer refuses to load on hosts that are running VBox 3 (but symlinks will not work properly as VBox 3 didn't support them).

I've also added guest control support for executing programs - see $(VBoxManage help guestcontrol) for usage instructions. Note that you'll have to set a password on your Haiku user account to use this if you haven't already, as VBox's guest control requires authentication.

This leaves screen resizing, which will be my primary focus in these last few weeks, followed by a bit of cleanup and finally sending a patch off to the VBox people.

UVC Driver -- GSoC Three-quarter-term Report

Blog post by gabriel.hartmann on Mon, 2011-08-01 20:25

Not so long ago, at the half way mark of the GSoc, I was optimistic that I was near to actually interpretting data from the camera in such a way as to produce images on screen. I was successfully grabbing payload data from the camera, the camera's in-use light was on, things were looking good. Since that point, progress has been repeatedly stalled by strange and difficult to debug behaviour.

The first problem which I encountered was that the vast majority of the data received from the camera consisted only of headers with very little actual image data ever attached. In a few seconds of contact with the camera as an example, only 6 out of 7714 packets (0.000778%) contained content. That was worrying. Furthermore the bit indicating an error was often set in the headers, although not perpetually. Investigation of that problem has revealed one of two possible scenarios.

1) Protected content -- This situation occurs if the data source device detects that the video or still-image data is protected and cannot be transmitted. In this case, empty packets containing only headers will be sent for the duration of the protected content.

2) Input buffer underrun -- If the data source device is not able to supply data at the requested rate, it will transmit empty packets containing only headers for the duration of the buffer underrun.

There are other possible error modes, but these are the only two described in the specification which indicate the empty packets with only headers behaviour. Both I and my mentors believe that the second scenario is most likely. However we do not know for certain, which leads to another problem.

Requesting information about what error mode exactly is being encountered of the camera, should be very nearly in exactly the same format as the probe / commit routine which directly precedes the initiation of data transfer. However, whenever the camera is asked for further information about the error mode it is indicating, both the media_addon_server and the camera lock up. Now, it is far from abnormal for the media_addon_server to lock. This has happened countless times during development. But the camera has never locked up befor. Even after a restart, the camera remains locked. A full power cycle is required to bring things back to relative normal. So that's one major intractable issue at the moment, but it is not the only one.

Another major issue was an essentially infinite loop in the VideoProducer's Datapump thread. A division by zero was causing a very large negative number to be included in a sum. The result of this sum was supposed to be a time in the future for which a semaphore grabbing loop should wait. However since the time was hugely negative, at no point could a constantly positive and climbing system time reach this "future" date. Investigations into this issue were going on at the same time as I was investigating the empty packets error. Because my camera was locking up, I had been unplugging and replugging my camera repeatedly. In order to make this easier I had started using the usb plug on the front of my machine. This movement has, I believe, solved the division by zero problem. I haven't done rigorous testing yet, but it was a consistent problem before, and now that I've switched usb plugs, it has gone away. Do you see what I mean about strange and difficult to debug behaviour?

Finally, in an effort to see if the empty packets problem was confined to the beginning of data transfer, and perhaps worked itself out later, I began watching printouts of actually full packets being received. After about 20 seconds of this, Haiku reliably crashes into Kernel Debug Land (KDL). I'm now looking into kernel debugging advice my mentors have given me. Just judging by the kernel debug messages, it looks like an inappropriate NULL pointer problem in the ehci isochronous transfer code.

So, while it would be nice to be writing a deframer or some code for negotiating resolution between the user applications and the driver, with a view towards getting images on the screen at user requested qualities, I think it's probably more important to get the back end working properly. There are only about 3 weeks until the firm pencils down date and I haven't entirely given up hope of one day seeing images, but at the very least I'll hope to have made thorough informative investigations into a series of problematic behaviours that would certainly not be acceptable for end-users to encounter.

Contacts Kit, Mid-term

Blog post by Barrett on Tue, 2011-07-19 17:16

From my latest post, i had to do more work on the base classes, i realized that my implementation of BContactField was too inflexible for the use so my progresses were not fast as i hoped.
The main problem was to provide something that can fit the simplicity of the Person format (people files) and the complexity of VCard. The result was BContactField. Starting from a number of fields (defined in ContactDefs.h) the class provide some methods to access the field-type of a particular fields and give an interface able to manage properties and parameters as well. At the bottom there are some classes that implements BContactField, they will be used directly by the user, let me give some examples :

BStringContactField
This merge every fields that does not have any other object or special functionalities like B_CONTACT_NAME or B_CONTACT_EMAIL.

BUrlContactField
This is the first example of a field that will incorporate an object from the Haiku's API, in this case it's simple but will be helpful when the BAddressContactField will be added.

How the API help to distinguish between the type of the fields?

You can use the method BContactField::FieldType() but there's a more simple solution, using the visitor pattern i have created a BContactFieldVisitor class, it is nothing more than an interface that specify one Visit() method for every BContactField child class. Implementing a your own class, when you receive a BContactField you can pass your visitor into the BContactField::Accept() method without having any troubles converting the base class to the derived class. One pratical use is for example the EqualityVisitor that allow to implement the method BContactField::IsEqual() in a nice manner. Also the VCardTranslator use a private visitor as a class that convert every field into a VCard string.

While i should commit some changes for BContactField, BContact and BRawContact are basically complete and usable and seems working as well.

Translators

The state of translators is summarily good, at the moment VCard can read and write some basic properties, People is in full development state. The main problem with it was a intrinsic limitation of the translation kit, basically you have to pass a BPositionIO (BFile, BMemoryIO..) to a translator but people files are recorded as attributes. You cannot edit an attribute using a BPositionIO since they are data written outside the file, so at the moment the translator will check if the input/output (as the case) is a BFile and if not it will fail.

Future
At this point i will not make forecasts, i'm working on a plan for the services kit and the addon API in order to begin discuss it with my mentor(s), the first part of the project seems close to be complete so i'll update you with a blog post in the next days.

ZFS Port: Midterm Report

Blog post by GeneralMaximus on Tue, 2011-07-19 09:44

My midterm goal was porting libzpool -- which contains most of the ZFS code -- to Haiku. Another midterm goal was to get ztest -- the ZFS testing tool --- to run on Haiku. Being able to run ztest in a loop for an entire day means that about 80% of the ported code is working fine (though the remaining 20% is the most difficult part of the entire porting process). ztest is a userland test, so actual file system modules or disks are not involved in the testing procedure -- ztest creates block files in a temporary directory and treats them as disks.

It took me days of fighting with the linker and the compiler, but I'm happy to report that both ztest and libzpool build on Haiku without errors! Does that mean I can run ztest for a day without problems? Sadly, that is not the case. ztest is unable to create ZFS storage pools and fails within a second of starting up. I am currently trying to investigate and fix this crash. Fixing this one crash will reveal more crashes, and running ztest with several threads will reveal subtle threading issues. This means I have my work cut out for me ;)

Meanwhile, I have also started porting libzfs, which is the library used by the zfs and zpool administration tools to communicate with ZFS code in the kernel. This communication occurs as ioctl() calls on /dev/zfs. My goals for the quarter term are getting libzfs, along with zpool and zfs, to build on Haiku. Of course, an additional goal is to get ztest to run without crashing.

You can follow the project at http://github.com/GeneralMaximus/zfs-haiku. Building ztest is as easy as cloning the repository, changing into the zfs-haiku directory, and typing "jam ztest". The ztest executable is generated in the debug.X86 directory.

Syndicate content