Showing posts with label foss. Show all posts
Showing posts with label foss. Show all posts

Thursday, May 17, 2018

Game Boy Advance Development 101: Compiling Tank Advance

If you've happen to download Tank Advance source code from Loirak Development, chances are you're having a problem compiling a working GBA file with devkitPro.


That's because of the compiler.


The pre-compiled GBA file inside the Tank Advance ZIP file was compiled 2002 -- that's more than a decade and a half.  Last 2002, GCC was just version 3.  As of this writing, devkitPro is using GCC version 7.


Without much further ado, use the following lines in MSYS2:
arm-none-eabi-gcc -c gfx.c -mthumb-interwork -mthumb -O2 -o gfx.o
arm-none-eabi-gcc -c main.c -mthumb-interwork -mthumb -O2 -o main.o
arm-none-eabi-gcc main.o gfx.o -mthumb-interwork -mthumb -specs=gba.specs -o tank.elf
arm-none-eabi-objcopy -v -O binary tank.elf tank.gba



If successful, you should have a freshly compiled Tank Advance and you can start changing the code to understand how it works so you can start writing your own Game Boy Advance game. :)


Happy GBA deving!


~creek23

Tuesday, November 11, 2014

[Android Studio] Error : Failed to find: com.android.support

It's nice that Google is trying to make a full-fledged Android Authoring Software, complete with what is expected from an authoring tool.  But as of now, the tool itself is in Beta which has a few hiccups hidden somewhere, and one of this is not being able to compile an Android Project. o_o

Like, really?

So if you, like me, had encountered this problem saying:
Error : Failed to find: com.android.support
Relax and open SDK Manager then install the Android Support Repository and/or Android Support Library.  Better yet, install those two. :)

Upon restart of Android Studio, that problem should go away.

Happy hacking!

~creek23

Thursday, October 9, 2014

[FFMPEG] Adjust video volume

Before anything else, here's a quick disclaimer:  I do not promote the use of torrent for downloading movies you do not currently own.  Yes, I do download movies but only if I have a DVD/Bluray copy of it.  The only reason I download it so I would have a soft copy -- yes, I suck at ripping DVD/Blurays.

Okay.  Now, onto the issue at hand.

It seems that this torrent group called YIFY is famous among torrent freaks because of quality Bluray rips packed in very small HD files.  Sadly, YIFY configured their rips to lessen the quality of audio.  Which is not a problem for people watching the video on their computers since VLC Media Player can double the movie's volume and everybody's happy.

Well, not quite.

People who have LED TVs happen to enjoy the quality of the movie they downloaded by watching it on their 40~50in TVs.  And it so happen that their TVs doesn't have the feature VLC Media Player has (doubling the volume) -- so they are stuck with the audio quality that YIFY offers with their small-size HD movies.

So how do you fix it?

Have I mentioned my disclaimer, yet?

Anyway, let's use FFMPEG! Just type this into your Command Prompt:

ffmpeg -i "input.mp4" -c:v copy -af "volume=10dB" "thanksToCreekCodes.mp4"

Above ffmpeg command should make sure that you should now have a louder audio while having the same video quality.

I'm pretty sure you understood my disclaimer right?  Well, happy viewing!

~creek23

Friday, February 8, 2013

LMMS: Fixing distorted sound

So I have been casually using Linux Multimedia Studio, or LMMS, since 2010.  It is a really good free and open source alternative to FruityLoops.

I won't go detailing how great this tool is for digitally creating your music as I am assuming you bump onto this post already knowing what LMMS is.

One issue of this tool on Windows is that LMMS keeps distorting your (if I may) compositions, adding buzz and other weirdness to your music.

The problem is even added on its Troubleshooting page but it is still currently unanswered as of this post.

Luckily, the answer is actually already on its Forums posted by a fellow LMMS user, darkill.  And it's just waiting for someone to add it on LMMS' Wiki.

For archiving purposes (just in case the forums and/or the wiki won't be accessible), let me state the steps here on this post.

Open DirectX Diagnostic Tool
  1. Open a Command Prompt
  2. Type-in: dxdiag
  3. Check the tabs with labels "Sound1", "Sound2", etc.
  4. Check for the Driver's name (mine is STWRT.SYS)
  5. Take note of this now do the next steps 
Update LMMS Settings
  1. Run our favorite digital music authoring tool called LMMS :)
  2. Go to Edit -> Settings
  3. Now goto Audio Settings
  4. Change the Audio Interface to SDL (Simple DirectMedia Layer)
  5. Then specify your Driver's Name of your Audio Device on Settings for SDL
Now restart LMMS and hope that the distortion and other weirdness on your music is gone.

Happy composing!

~creek23

Sunday, August 26, 2012

Gimp 2.8 gzdirect problem

This simple solution should fix the problem: "The procedure entry point gzdirect could not be located in the dynamic link library zlib1.dll."

To non-programmers, this error message simply means that your  zlib1.dll is outdated and needs to be replaced.

Somehow, most (if not all) Gimp plugins are using gzdirect which is supposed to be available on  zlib1.dll.

Try checking C:\Windows\System32\ and look for zlib1.dll then rename it to something else, maybe something like  zlib1.dll.old.

So where to get the latest one?  It's actually installed along with Gimp 2.8, but since you have another  zlib1.dll on your Windows' System32 path, Windows is trying to load that copy instead of the copy that Gimp 2.8 has.

Now, re-run Gimp 2.8.

Happy Gimping!

Friday, August 10, 2012

Jenkins: Executing binary from Jenkins script

If anyone of you are having the same problem as detailed on Jenkins forum about not being able to execute any Windows executables from Jenkins Job configuration.  The reason might be that slave-agent.jnlp is running as a service -- and for whatever reason, Windows won't let it run other executables.  To verify if it is the case, try uninstalling the slave-agent.jnlp service -- to do so, use Google -- then try running slave-agent.jnlp as is (meaning, right after executing the code below).

javaws http://yourjenkins.com/computer/yourslaveIP/slave-agent.jnlp

If that didn't solve the problem, sorry but I currently don't have any other solution.

Friday, June 22, 2012

Screencasting with Android

Well, if you are already using the Screencast Video Recorder, there's no use of reading this -- but I'm betting you're not because you stumbled onto this tutorial.

First of all, I am not related to the said screencasting app and I am in no way endorsing it.  I haven't even tried that app yet because 1.) it's not supported on my low-end Android device and 2.) it's a paid app -- yes, I'm cheap, sue me. :P

So this tutorial is about creating a screencast of your Android device using a free and open source tools called Android Screen Capture (or AShot) and FFmpeg.  I should warn you that this tutorial is not for the fainthearted -- it's gonna be messy through setting these tools up, and through creating of the screencast video itself.

I'm going to assume you know what we mean by screencast.  And I'm going to assume you are using Windows on your PC.

To start, download the tools:
AShot - http://sourceforge.net/projects/ashot/files/latest/download
FFmpeg - http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20120620-git-5a90e55-win32-shared.7z

Here's a very detailed tutorial of setting-up AShot, which I'm very glad not to write over again.  It talks about downloading Android SDK, which AShot uses to capture images from your Android device.  One quick note, however, is the copying of the three files, namely:
  • adb.exe
  • AdbWinApi.dll
  • AdbWinUsbApi.dll
from this directory: C:\Program Files\Android\android-sdk\platform-tools

to this directory: C:\Program Files\Android\android-sdk\tools

Again, simply COPY the three files and not MOVE from one to the other.

Lots of troubleshooting is also discussed on that page, so go thoroughly through that page if AShot won't seem to work.



At this stage, I'm assuming you already got AShot working and you're seeing the same image in your PC as what's on your Android device as shown in the photo above.  You might have also tried screencapturing, and saw a tiny little problem -- (aside from the low FPS which is already answered many times on that page mentioned) instead of a video output, AShot outputs a series of PNGs.  Here's where FFmpeg comes in.

The FFmpeg binary download is just a zip file that can easily be extracted by 7zip or WinRAR -- though, I prefer 7zip.

I'm going to assume you extracted it on the root of your computer in such a way that ffmpeg.exe will be in this path: C:\ffmpeg\bin

And I'm also going to assume that you set AShot to output screenshots on this path: C:\ashot\

Now, all you have to do is open a Command Prompt and type this:
cd c:\ashot\
c:\ffmpeg\bin\ffmpeg -f image2 -i screenshot_%05d.png screencast.avi


Then using any movie player -- I use VLC media player by the way -- you can now view your screencast.avi.

Lastly, if you want to adjust the FPS of your AVI, try adding -framerate X when executing ffmpeg, where X is your desired FPS.

Happy screencasting!

~creek23

Monday, March 26, 2012

Jenkins: Setting up Email Notification using Google SMTP

This is just about the same as the earlier post about Setting up Jenkins' Email Notification using Yahoo SMTP, only now it's for Google SMTP.

SMTP server - pop.gmail.com
Default user e-mail suffix - @gmail.com
Sender E-mail Address - Foobar CI <your.email@gmail.com>

Use SMTP Authentication - yes
User Name - your.email
Password - p******d

Use SSL - yes
SMTP Port - 995
Reply-To Address - noreply@gmail.com
Charset - UTF-8

To try if it's really working, type-in your email address and click Test Configuration, then you should be able to receive something like: "This is test email #1 sent from Jenkins"

Alternatively, you can also use smtp.gmail.com as SMTP server then use the SMTP port, 465. (Big thanks to Anthony Panozzo for sharing and Julio Carrettoni for confirming)

Jenkins: Setting up Email Notification using Yahoo SMTP

NOTE: This tutorial is for developers who are using Jenkins installed on their local server (with Internet Connectivity).

So you want to setup Jenkin's Email Notification but you don't have email server?

Assuming you have Yahoo Email account, that will work just fine. We just have to configure the Email Notification of Jenkins.

Under Manage Jenkins, go down to E-mail Notification then set these following information:
SMTP server - smtp.mail.yahoo.com
Default user e-mail suffix - @yahoo.com
Sender E-mail Address - Foobar CI <your.email@yahoo.com>

Use SMTP Authentication - yes
User Name - your.email
Password - p******d

Use SSL - yes
SMTP Port - 465
Reply-To Address - noreply@yahoo.com
Charset - UTF-8

Optionally, you might want to try if it's really working. Type-in your email address and click Test Configuration.

You should be able to receive something like: "This is test email #20 sent from Jenkins"

Below is what your configuration should look like.

Happy spamming! :P

Thursday, July 28, 2011

How to Real-time Scan with Clamwin

Clamwin is a free and open source Anti-virus for Windows -- thus the suffix "win". This means that the community provides the developers tons and tons of possible virus infected files thus making Clamwin more efficient in tracking new virus than any other proprietary anti-virus. But there's a catch.

With its large database of virus definitions, Clamwin cannot do a real-time or active scan of your computer. It will not detect a virus-infected file from being copied to and from your computer. Although it does offer a scheduled scan, we know that a real-time scan if far safer.

As quoted from Clamwin's homepage,
Please note that ClamWin Free Antivirus does not include an on-access real-time scanner. You need to manually scan a file in order to detect a virus or spyware.

So how do you make a real-time scan with Clamwin? First, download and install Clamwin if you haven't done already.

Next, download and install complimentary free and open source software called Clam Sentinel.

Clam Sentinel detects file system changes like when some unauthorized program copy, or modify a file. Each file being accesed is thrown to Clamwin to do some virus-checking. This is a good thing if you want to keep your computer safe from unwanted virus. The down side however is that you computer will run slower each time you launch an application, copy files, and such. But this would not be a problem if you are already used to Norton's behavior.

Saturday, February 12, 2011

MSYS pr not found

Ever got the pr not found error on MSYS?

Not sure why the packages made pr command to be obsolete. But compiling FFMPEG on Windows using MinGW and MSYS requires pr in the toolchain.

Do not worry, it is still on MinGW's download page though not easily accessible. It's hidden inside MSYS/BaseSystem/msys-core/obsolete

But be careful, you will only need the PR.EXE, everything else is unnecessary.

UPDATE: Updated link.

Tuesday, January 11, 2011

Open source Matroska MKV converter

It's been a long time since I blogged about anything.

Is your hard drive (the one where you save you files and all that -- not the other one, if you know what I mean ^^) getting all spaced up because of your video file collections? Despite the number of hard disks in your PC?

Don't sway there's an open source MKV converter that will take care of your AVIs.

As of this post there's simply no better compressed video format than Matroska. Sad as it may be, but MKV is not an open format.

Enter HandBrake, an open source (GPL-licensed) multiplatform video converter available for Mac OS X, GNU/Linux and Windows.

Remember. I'm just showing you a tool to help you get more disk space. I am not telling you to download pirated Hi-Def DVD rips out in the Internet and have the file size get shrank by this tool. Also, what I just said is not a reverse psychology thingy. ;)

EDIT: Been using MKV for more than a year and I never had the slightest idea that MKV was indeed an open format. Thanks robux4!

Friday, July 9, 2010

Problem with Red5 - SLF4JLogFactory does not implement LogFactory

I'm currently working on a team of more at least 16 developers -- the largest team I worked with on a very complicated project.

The setup is a central J2EE application that runs on JBoss, web application that written in PHP (powered by Apache web server), and a rich internet application written in ActionScript (yep, a Flash application). This Flash application communicates to Red5 server which runs on Tomcat.

If that's not complicated enough for you, continue reading.

The Flash application is a sub-application of the PHP web application. Both the PHP and Flash applications communicates to J2EE application. The PHP uses WSDL and the Flash uses Axis.

The PHP application gives data to the Flash application to let the Red5 server communicate with the J2EE application-- again, via Axis.

To make matters worse, the JBoss, Apache, and Tomcat servers are running on three different machines.

Now, when something in the process broke, it's up to the lead developers to debug it.

As I am the lead on the Flash application that communicates on Red5 server, I am oblige to find the solution.

How on Earth are you going to debug which caused which bug?

Well, the good thing in this complicated project is that it uses free and open source software and open data -- except for Adobe Flash specifics, that is. (For the record, I'm using the open source Flex SDK with FlashDevelop -- it's the Flash' SharedObject-thingy that Red5 uses I'm worried about not being open format/data)

Step-by-step, it boiled down to Red5 and Axis.

Another good thing is, a good person with a good heart by the name Jim O'Halloran, blogged about his same experience, six months earlier.

It turns out that Axis uses commons-logging.jar, which contains same classes (but not same version) of what Red5 uses. This makes the error that Red5 kept whining about:
Caused by: org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4JLogFactory does not implement org.apache.commons.logging.LogFactory

As O'Halloran suggested, removing the JAR file for commons-logging then restarting Red5 will solve the problem. And it did!

If this helped you too, thank Jim O'Halloran. Send him beer or pizza if you could. ^^

Wednesday, May 5, 2010

GTK#: How to Change Font of Entry

This tutorial assumes that you are using MonoDevelop and created a C# GUI application using GTK#.

Supposing you already have a Window with an Entry, named txtSource, this is how you change the Font.

First, include Pango in imports.
  • using Pango;

Second, use the FontDescription class and instanciate one.
  • FontDescription fontDesc = new FontDescription();

Third, set the Family property of FontDescription object to any font family you want (ex, "Arial", "Tahoma", "Courier).
  • fontDesc.Family = "Courier";

Lastly, set the FontDescription object to Entry using ModifyFont method.
  • txtSource.ModifyFont(fontDesc);

The whole code should look something like this:

using System;
using Gtk;
using Pango;

public partial class MainWindow : Gtk.Window {
  public MainWindow () :base(Gtk.WindowType.Toplevel) {
    Build();

    FontDescription fontDesc = new FontDescription();
    
    fontDesc.Family = "Courier";
    
    txtSource.ModifyFont(fontDesc);
  }
}

Sunday, March 21, 2010

AS3 and Red5

There seem to be not enough documentation about Red5 and AS3, especially on properly creating a new application, so I thought of writing one.

SOSampleAS3 is a simple Remote SharedObject demo app.The code is a modified Red5's SOSample demo which was written in Adobe Flash IDE and AS2. This is written in pure AS3 on FlashDevelop. Also, it demonstrates remote call using Shared Fridge Magnet tutorial.

How to install the demo webapp?

  1. Extract SOSampleAS3.zip.
  2. Then extract SOSampleAS3-src.zip.
  3. Copy bin directory to C:\Program Files\Red5\webapps\root so it will be:
    • C:\Program Files\Red5\webapps\root\bin\
    • C:\Program Files\Red5\webapps\root\bin\expressInstall.swf
    • C:\Program Files\Red5\webapps\root\bin\index.html
    • C:\Program Files\Red5\webapps\root\bin\SOSampleAS3.swf
    • C:\Program Files\Red5\webapps\root\bin\js\swfobject.js
  4. Extract SOSampleAS3-webapp.zip.
  5. Copy SOSampleAS3 directory to C:\Program Files\Red5\webapps so it will be:
    • C:\Program Files\Red5\webapps\SOSampleAS3\
    • C:\Program Files\Red5\webapps\SOSampleAS3\META-INF\MANIFEST.MF
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\classes\org\red5\server\webapp\elcMagnets\Application.class
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\lib\elcMagnets.jar
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\red5-web.properties
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\red5-web.xml
    • C:\Program Files\Red5\webapps\SOSampleAS3\WEB-INF\web.xml
  6. Restart your Red5 Server.
  7. Open your browser and set address to http://localhost/bin/.

That's it!

Fixing NetConnection.Call.BadVersion

After trying out AMFPHP 1.9 (yep, 1.9 -- although it's also called 2.0) that came out stable last 2nd of February 2010, I was almost ready to give up because of the "NetConnection.Call.BadVersion" errors that I'm getting when I try even a simple HelloWorld call. Followed every suggestions found on the Internet but none fixed the problem.

Then I tried checking out the AMFPHP code. I started with gateway.php. On line 106, changing PRODUCTION_SERVER to false fixed the problem.

It turns out that PRODUCTION_SERVER is set to true by default now.

Tuesday, March 16, 2010

Open Source Alternative to Daemon Tools Lite

It was cool to know that there is something like of Daemon Tools Lite that runs on Ubuntu GNU/Linux -- that is GMount ISO. Sadly, it only runs on GNU/Linux platforms.

Getting back on Windows, I wondered if there is other open source Daemon Tools Lite that runs on Windows. Luckily, there is one -- it is called WinCDEMu. Go try it for yourself.

Thursday, March 4, 2010

Getting Started with GTK on Windows

I am assuming that you already know GTK+ and wanted to try it out for the first time. This article will discuss how to setup your development environment to start writing GTK+ based applications.

First things first, download everything you need.

Download GTK from GTK.org -- I downloaded gtk+-bundle_2.18.7-20100213_win32.zip.

Optionally, download libiconv from GTK.org -- as of this writing libiconv is version 1.9.1.

For C editor, I am using MinGW Developer Studio. It is the easiest to setup in compiling GTK+ applications since it already works well with MingGW, the recommended toolchain when using GTK. Sadly, the developer's website is somewhat down or possibly currently doing a revamp. But you can easily get version 2.0.5 from list of mirrors courtesy of TextEditors.org.

Setting them up

Install MinGW Developer Studio.

Extract gtk+-bundle_2.18.7-20100213_win32.zip then place content in C:\Gtk+\{here}

Same with libiconv, extract libiconv-1.9.1.bin.woe32.zip then place all contents in C:\Gtk+\{here}

Configuring MinGW Develop Studio.
  1. Launch the editor
  2. Click Edit -> Options... to open the Option dialog box.
  3. Click the Directories tab
  4. On Show directories for,
    • select Include files then add the following paths:


      • C:\Gtk+\include
      • C:\Gtk+\lib\glib-2.0\include
      • C:\Gtk+\lib\gtk-2.0\include
      • C:\Gtk+\include\cairo
    • select Library files then add this path:


      • C:\Gtk+\lib
Testing it out.
  1. Launch MinGW Developer Studio
  2. Click Project -> New Project to open New dialog box.
  3. Select GTK+ Application and indicate HelloGTK as Project Name
  4. Click OK to create new project.
  5. Click File -> New to open New dialog box.
  6. Select C/C++ Source File and indicate hellogtk.c as File name.
  7. Click OK to create new file.
  8. Type in the code below then press F5 to compile and run the program.

If you are having problem running you hellogtk application, you might need to install GTK+ runtime. I use GIMP, which installs the runtime -- try to download and install a copy of GIMP for Windows.

Where to go from here? Read the official documentation and tutorials.

Thursday, February 18, 2010

How to svnsync on Windows?

One of the most powerful tool in subversion is the ability to transfer repository from one server to another.

That tool is called svnsync. There are some documentations around but not much tutorial.

Let's pretend that your project's source code is currently hosted at https://svn.old.com and wanted it to transfer at https://svn.new.com.

So, how do we migrate the source code? Simple. First, install Slik-Subversion from Slik-SVN.com. Now, follow the next procedure.
  1. Run a Command Prompt
  2. Type-in: svnsync initialize https://svn.new.com https://svn.old.com/trunk/
  3. Then type-in: svnsync synchronize --source-username mynewsvn_usr --source-password mynewsvn_pwd --sync-username myoldsvn_usr --sync-password myoldsvn_pwd https://svn.new.com
Viola! You are done!

Of course, you will have to edit the following to apply on your situation.
  1. mynewsvn_usr to your real username at your https://svn.new.com site
  2. mynewsvn_pwd to your real password at your https://svn.new.com site
  3. myoldsvn_usr to your real username at your https://svn.old.com site
  4. myoldsvn_pwd to your real password at your https://svn.old.com site
Not to mention, change:
  1. https://svn.old.com to your real old project repository
  2. https://svn.new.com to your real new project repository
Enjoy migrating!

Wednesday, February 17, 2010

Blender: Export 3D Model for Flash

I did a demo of my WIND library late January this year and I was having problem exporting the 3D model from Blender, properly.

The screen resolution of the laptop I'm using went to 640 by 480 upon attaching the LCD projector. I was having a hard time figuring the problem out. Until the demo ended, and I detached the LCD projector cable and *poof* -- I know what I've been missing.

Below is the screenshot of how to properly export 3D model for use of Papervision.
  • Make sure the model is exported in Triangles -- not Quads.
  • Obviously, export only the model -- not the whole scene.
  • Make sure the texture path is Relative to the Collada file path.
  • Then finally, to have a deformed model (aka posed model), toggle on Apply Modifiers.

The demo went okay until the exporting problem -- sheesh...