Yes, the phone oximeter is written in Gambit-C, with an OpenGL based user interface and some minimal platform specific glue. The app is meant to be a low cost alternative to expensive standalone monitors.. it's a fairly complete implementation, with real-time plethysmogram, oxygen saturation and heart rate trends, saturation pitched heart beat sound and alarms (audible and visual).
Gambit-C is really great as a rapid prototyping environment (thanks Marc!), it's robust and extremely portable. The framework used for the oximeter app builds on iOS, Android, OS X, Windows, OpenBSD, NetBSD and Linux.
Chris
On 2011-02-17, at 8:08 PM, Bradley Lucier wrote:
A user named Chrisp added a line to the "Real-world software and services" wiki page that seems to imply that the "PhoneOximeter",
an iPhone app to measure real-time oxygen levels being developed at the University of British Columbia, is written in Gambit-C.
I googled "Gambit" on phoneoximeter.org but found nothing that would confirm this. If it's true, I find it quite exciting. My question is: Is my interpretation of this wiki change correct?
Brad
Yes that's cool! I couldn't find any other information myself. Perhaps a query on the Gambit list will ring in some more details...
Marc
Afficher les réponses par date
On Feb 19, 2011, at 11:08 PM, Petersen, Chris wrote:
Yes, the phone oximeter is written in Gambit-C, with an OpenGL based user interface and some minimal platform specific glue
Congratulations!
I'm sure many people on the list would love to know your development set up - specifics of how you built gambit for iOS, what revision of iOS you used, any emacs customizations if you're using emacs with an inferior gsi/gsc for tethered debugging or incremental development, etc.
Thanks in advance!
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
2011/2/20 Raffael Cavallaro raffaelcavallaro@mac.com:
On Feb 19, 2011, at 11:08 PM, Petersen, Chris wrote:
Yes, the phone oximeter is written in Gambit-C, with an OpenGL based user interface and some minimal platform specific glue
Congratulations!
I'm sure many people on the list would love to know your development set up - specifics of how you built gambit for iOS, what revision of iOS you used, any emacs customizations if you're using emacs with an inferior gsi/gsc for tethered debugging or incremental development, etc.
Thanks in advance!
warmest regards,
Ralph
Yes! We are very interested in these topics! :)
Álvaro
As has been reported on the list, the stat64 patch is all that's needed to get gambit-c to build for iOS4. I don't really have anything to add as far as Gambit build instructions go.
The framework used for the oximeter app exposes a small OpenGL subset (~25 functions) through the Gambit FFI, and uses a native hook to transmit events (button/key presses, motion, battery status etc.) to the scheme side. The hook is a few hundred lines of code in whatever the native language of the platform is. For example, the iOS hook is ~400 lines of Objective-C, the Android hook is ~250 lines of Java with JNI callouts and so on. The OSX hook is based on Carbon, while on linux and the *BSDs it's X11 based. There is also a console variant of the hook that can build apps without guis on any platform with a gcc compiler. We need real-time audio for some of our applications, and this is done through an AudioUnit c-declare chunk for iOS and portaudio FFI for everything else (except Android, still haven't worked out how to do a real-time hook into the Java audio API). The rest of the framework is written entirely in scheme, including all application specific code, and a widget based gui/event system on top of a GL/GLES compatibility layer, also in scheme.
The development environment is a standard make/autoconf setup. For example, to build the oximeter (iPleth) for the iPhone you'd do:
./configure --with-app=iPleth --with-platform=iphone make
This invokes gsc+gcc to build the binary, signs it and packages the app as needed for the particular platform. The framework is modular, and allows you to define any number of apps. We are working on a handful of different ones at present. I do most development on a Mac, because I can then compile an app for OSX, iOS, Android, Windows and linux from the same box using just that single configure command.
By the way, I can report that gambit-c also works on Maemo, Nokia's now abandoned smartphone OS (for the N900). Early versions of the framework ran on it. Also have gambit-c based applications running on embedded (Soekris) hardware with OpenBSD.
Chris
________________________________________ From: Álvaro Castro-Castilla [alvaro.castro.castilla@gmail.com] Sent: Tuesday, February 22, 2011 10:23 AM To: Raffael Cavallaro Cc: Petersen, Chris; gambit-list@iro.umontreal.ca Subject: Re: [gambit-list] Gambit and oximeter
2011/2/20 Raffael Cavallaro raffaelcavallaro@mac.com:
On Feb 19, 2011, at 11:08 PM, Petersen, Chris wrote:
Yes, the phone oximeter is written in Gambit-C, with an OpenGL based user interface and some minimal platform specific glue
Congratulations!
I'm sure many people on the list would love to know your development set up - specifics of how you built gambit for iOS, what revision of iOS you used, any emacs customizations if you're using emacs with an inferior gsi/gsc for tethered debugging or incremental development, etc.
Thanks in advance!
warmest regards,
Ralph
Yes! We are very interested in these topics! :)
Álvaro
On Feb 23, 2011, at 10:06 AM, Petersen, Chris wrote:
[informative email snipped]
Speaking on behalf of all those interested in using gambit on iOS (and other mobile platforms) thanks for sharing this with us!
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
2011/2/23 Raffael Cavallaro raffaelcavallaro@mac.com:
On Feb 23, 2011, at 10:06 AM, Petersen, Chris wrote:
[informative email snipped]
Speaking on behalf of all those interested in using gambit on iOS (and other mobile platforms) thanks for sharing this with us!
Yes! Thanks a lot, Chris
Long life to Gambit!
Álvaro
On 2011-02-23, at 10:06 AM, Petersen, Chris wrote:
The development environment is a standard make/autoconf setup. For example, to build the oximeter (iPleth) for the iPhone you'd do:
./configure --with-app=iPleth --with-platform=iphone make
This invokes gsc+gcc to build the binary, signs it and packages the app as needed for the particular platform. The framework is modular, and allows you to define any number of apps. We are working on a handful of different ones at present. I do most development on a Mac, because I can then compile an app for OSX, iOS, Android, Windows and linux from the same box using just that single configure command.
I would love to see your configure script and makefile, in particular the iPhone part that builds the application without using Xcode (I assume from your message that you don't have to muck around with Xcode to build the application).
On the Mac are you using VirtualBox or Parallels workstation? There too there is much to learn! For Gambit I have used Parallels workstations to build the Windows releases, but it is done with a very brittle script.
Marc
I'm afraid the autoconf script is not very exciting. There is not much "auto" about it for one, and it's long. I've tried to extract the gambit related essence of it and made a little independent gambit build system to illustrate how it works. The attached setup will allow you to build gambit-c on a mac for five different platforms; OSX, Linux, Windows, iOS and Android (library only). In order to make use it you just need to drop the latest gambit-c non-development source tarball (gambc-v4_6_0.tgz) into the directory and install the compilers. The windows and linux cross-compilers can be found pre-made for example from here:
http://crossgcc.rts-software.org/doku.php
and the rest are included in their respective SDK. In this simple setup the android NDK will build the gambit library but not the gsi/gsc executables due to android's nonstandard linking requirements. It's possible to do that, but it's unnecessary trouble if you plan on using gambit from within a "proper" android app anyway. You might need to tweak the paths in the script if the compilers end up in directories different from my own setup, but basically
./configure --with-platform=macosx|win32|linux|iphone|iphone4|android make
will now build gambit for your system of choice. The result ends up in a platform subdirectory. There is no need for a virtual machine on the mac, everything is just cross-compiled directly from OS X. The mobile vendor native SDKs are all instances the gcc cross-compiler, and can be invoked in an almost identical way, as is hopefully clear from the script. The approach should work with any platform that has a gcc based development system. Most do. Notable exceptions are from the vendors that doesn't allow native code, like BlackBerry and Windows Phone 7.
The caveat is that although gambit-c and all the scheme code builds just fine in this way, you still need to jump through the various hoops that vendors have created in order to build an executable that ties into the platform's windowing and event system. This is were that hook I mentioned in the earlier post comes in.
The attached is just a quick hack, your mileage may vary.
Chris
________________________________________ From: Marc Feeley [feeley@iro.umontreal.ca] Sent: Wednesday, February 23, 2011 2:53 PM To: Petersen, Chris Cc: gambit-list@iro.umontreal.ca Subject: Re: [gambit-list] Gambit and oximeter
On 2011-02-23, at 10:06 AM, Petersen, Chris wrote:
The development environment is a standard make/autoconf setup. For example, to build the oximeter (iPleth) for the iPhone you'd do:
./configure --with-app=iPleth --with-platform=iphone make
This invokes gsc+gcc to build the binary, signs it and packages the app as needed for the particular platform. The framework is modular, and allows you to define any number of apps. We are working on a handful of different ones at present. I do most development on a Mac, because I can then compile an app for OSX, iOS, Android, Windows and linux from the same box using just that single configure command.
I would love to see your configure script and makefile, in particular the iPhone part that builds the application without using Xcode (I assume from your message that you don't have to muck around with Xcode to build the application).
On the Mac are you using VirtualBox or Parallels workstation? There too there is much to learn! For Gambit I have used Parallels workstations to build the Windows releases, but it is done with a very brittle script.
Marc