Note for C developers on Ubuntu

2008-05-09 11:57:13 PST

Tags: , ,

Right, so when doing C development on Ubuntu I suddenly noticed something was missing in the pan pages department. Like all the C api.

apt-get install manpages-dev

ah that's better. Someone might want to make it part of the 'build-essentials' package.

Aoss matures

2008-04-09 13:56:19 PST

Tags: , ,

So I recall aoss being glitchy at times and generally not working with complex apps. At least that's what I recall.

So what is aoss? It's a program that acts as a wrapper around Unix apps that use the OSS sound system and silently converts their OSS calls to ALSA ones. Why is this useful?
a) I'm pretty sure each OSS app can lock the sound card, which is pretty lame on any modern system.
b) Because for some reason, some apps still use it, or are compile with OSS support instead of ALSA suport, still in this day and age.

Case point: Qemu on Ubuntu hardy still seems want to use OSS. I can't imagine why and I'm pretty sure it should support ALSA. I never had problems with it on Gentoo, but on Ubuntu it initializes it's OSS sound driver, and then fails to lock the sound card and so Qemu runs silently. Since I only use it to emulate Win98 for a few classic games, sound is pretty needed. So today on a lark I thought I'd try aoss.

 
aoss qemu -hda hd/win98.img -cdrom cd/dk.iso -soundhw sb16
 

And what do you know? It worked like a charm. Kudos. I'm impressed, pleased, and thankful.

Reports from the bleeding egde

2008-03-15 11:27:56 PST

Tags: ,

So this has been more or less fun so far. Lots of updates everyday, and it's good to keep up with them and fun. Sure occasionally they break a few things, but more often than not things are getting fixed. Thankfully I missed that libc update that was broken and pretty much disabled systems, not that tossing in a liveCD and copying over a working libc would have been the end of the world.

Over the last week, my sound has gone from not working to working, and my blingy desktop with compiz gained the ability to play movies fullscreen without grinding to a halt, so woo! And things crash less.

Still, there are a few hazards. Hibernating is still kind of a crap shoot. It works, but usually sound and sometimes the wireless won't work when it comes back up. And my 'del' key still doesn't work. But I'm sure that'll get sorted in the next month. Gnome 2.22 was officially released so now lots of the software itself isn't even beta, but official release stuff. Now it's just Ubuntu that's "alpha", meaning the general arrangement of software and configurations. However it's in "freeze" just before the beta is released. So things progress.

I can’t help myself: Ubuntu Hardy (8.04) Alpha 6

2008-03-10 18:26:46 PST

Tags: , ,

So I walked into class today and my buddy waves me over to sit with him. I look over once seated and see a nice brown screen with a progress bar. Apparently that morning he finally had enough of Windows Vista being slow (his complaint) so he decided that class was a good time to install Ubuntu, and he picked the upcoming release 8.04, which is currently in alpha 6. Now I know since I've been using Ubuntu on my laptop I've been a little less on the bleeding edge than I was when using Gentoo, but I didn't feel like being out done, so I decided to upgrade my nice stable Gutsy (7.10) to Hardy right then and there.

Easy really. Open '/etc/apt/sources.list' in your favorite text editor under sudo and comment out the CD source line and search&replace all instances of 'gutsy' with 'hardy'

then

 
sudo apt-get update
sudo apt-get dist-update
 

Apparently you can also

 
sudo update-manager -d
 

and tell it to check for updates and then it will offer you the option to upgrade to the development version, but the console version is slightly more interactive when it comes across system files you modified.

It was a 1.8GB download for all my software, and that might be large compared to some people because I installed a bunch of open source FPS games a bit ago and they do have a habit of taking up lots of space. Thankfully the UBC pipe is very fat and in 14 minutes everything was downloaded and it then went ahead and installed and updated everything.

Reboot.

And volia! Nice stable desktop is now a bleeding edge Alpha quality desktop with all the latest.

The good: My laptop's graphics card, and Intel i965, is 'new' and desktop bling wasn't supported under Gutsy, but it is under Hardy. Awesome. I installed compizconfig-settings-manager and tweaked away for a while. Things are very blingy.

Firefox beta 3 is pretty fine, but my Google browser sync plugin isn't supported for now. Hopefully in a bit.

Surprisingly, my latex plugin for Tomboy still works so awesome!

Everything else so far has more or less worked.

The not so great: Sound initially completely failed to work. No sound card detected, and the sound card module failed to load. Apparently a whoops over at Ubuntu HQ, they'd just compiled it against the wrong kernel. When I checked there was a 2 hour old bug. It was fixed this afternoon, and I got the fix from the update manager. Woo.

So everything so far seems to work. However things do crash every now and again. 'Eh, it's alpha software, everything. I knew what I was getting into, I've done this before.

So rad, I'm pretty pleased and impressed. Such an easy update to the bleeding edge system. And considering it's still all Alpha software, stuff is running fine enough. And I have all the cutting edge toys.

Now the fun will be in the next month as everything moves from alpha to beta to release and all my shiny toys become stable. :D

I heart free software.

Ubuntu 8.04 Hardy: Compiz in action

Update: Oh wow! Firefox 3 finally shows image's full alt over text, which is fantastic because several comics I read have second punch lines there and previously you had to look at the image properties to get the full thing (lame). So awesome they fixed that.

References:

Sound finally works properly on laptop (Intel HDA)

2008-01-24 09:30:02 PST

Tags: ,

Well rock on! So my laptop had two minor driver related glitches that I'd hopped would be fixed in the next release of Ubuntu. But I'm also damn impatient. So I've been bumming around the web a bit looking for a solution every now and again.

One of those problems was that the headphone port was deathly quiet with anything plugged into it, and also it acted independently of the speakers so you had to manually turn them off once a headphone was plugged in. Testing under Vista, the headphones at least turned off the speakers but were pretty much just as quiet, maybe a smidgen louder. Still not really usable in any kind of noisy environment.

Well, I was reading through one of the bug reports about this on Launchpad (there seems to be a couple all roughly about the same thing), Ubuntu's made at home version of Bugzilla. The sound card my laptop comes with is an Intel HDA card and the module is snd-hda-intel. Seems that when Gutsy first shipped sound worked not at all, but there was a backport of the module from a newer kernel. I went to check, but I already had that installed. However lower down was the gem I needed.

 
echo "options snd-hda-intel model=acer" >> /etc/modprobe.d/alsa-base
 

For reference, I have an Acer laptop so you might get better mileage out of your Intel HDA sound card suggesting your laptop's model, but this did the trick for me. I finally get loud volume out of the headphone jack, so the slightest background noise doesn't overpower it, and as a "bonus" plugging headphones in turns off the speakers. Better than Vista now.

Ubuntu breaks xorg-server… again

2008-01-18 19:09:55 PST

Tags:

So Ubuntu has done it again, they're released an update to xorg-server that breaks Xorg for most people leaving them stranded in the console. If you have xorg-server sitting in your update manager but can't update because of a "403 Forbidden" error, this is why, they caught it fairly quickly and pulled it. But this should have never been released. Especially because they already did this last year. I think they at least caught it faster, but they still fail because there is no public mention of this any where. There's some chatter amongst the users on the forums, but no official news from Canonical, which I think is in pretty bad taste because this came out and started breaking people's systems this morning and it's now evening. They should be getting some public word out to the people with busted systems, and letting everyone else know whats up instead of leaving everyone guessing. There's not even any talk of it on Planet Ubuntu. You made a mistake so at least own up to it.

And then go back and try and figure out how this exact same thing can happen 2 years in a row...

Synchronization

2008-01-06 23:53:43 PST

Tags: , , ,

So with a laptop again I'm really keen to find ways of not duplicating data entry and getting weirdness between my computers, so all kinds of synchronization catch my attention. Here's two I've jsut gotten working and love and make my life better:

Google Browser Sync: It lets you sync data from your browser (Firefox) to Google's server and the to other copies of Firefox you're using. I'm only using it to manage my bookmarks but it's wonderful to now have one set of bookmarks across my desktop and laptop.

Tomboy note syncing: Tomboy is awesome. It is my brain dump. I store tons of stuff in there but till now it has been a bit limited because the information in it doesn't follow me around so I can't count on it to be with me when I'm out or at home. Now I can. Since I have a nice reliable server, I just set it up to use sshfs (thanks to fuse) and both my copies of Tomboy (laptop and desktop) sync to a shared dump on my server. On Ubuntu it was super easy and everything was configured to work already, I just had to enable the sshfs sync plugin. On Gentoo, I had to add FUSE support to my kernel, install sshfs-fuse, and then add a fuse group and modify /etc/udev/rules.d/99-fuse.rules to look like

KERNEL=="fuse", NAME="%k", MODE="0666", OWNER="root", GROUP="fuse"

and then add myself to the fuse group. Once that was all done, Tomboy on Gentoo was syncing too and now my notes will follow me around where ever I am. This is truly amazing and takes Tomboy from a neat app, to an incredibly useful app.

I'm feeling the synchronizational love tonight!

New laptop (Umbriel)

2008-01-05 20:52:27 PST

Tags: , , , ,

So in September, my laptop Nika died of an electrical system failure. Going through a semester of university without a laptop was a hassle, but I waited and on Boxing Day I picked up a new laptop for $600 CDN ($300 off!). So what does one get for about the cheapest laptop in the store? Well, I got an Acer Extensa 5620 equipped with a Core2 Due 1.6GHz cpu, a pleasing 2 GB ram and a 250GB harddrive. It also had a Intel X3100 video card. So really, I couldn't have asked for any more in laptop. I'm pretty pleased. I named it Umbriel.
Then I threw Ubuntu 7.10 on it.

First, a few install details. I decided to save Vista since a) I paid for it and more importantly b) I might need it for Starcraft 2. Vista did at least come with a nice partition+filesystem resize tool that shrank it right down. So that was nice. And then Ubuntu installed smoothly onto the rest of the disk and setup Grub to dual boot them flawlessly. So that was all nice.

So what are the good and bads?

The goods: All the open source Intel hardware I could want, including a surprisingly good built in web cam. The Ubuntu install went without a hitch and everything worked. Popped in media and it went out in search of codecs and installed them. Cool.

The medium: I did have to manually install DVD support. But it took like 1 minute so whatever. Same for enabling CPU scaling control from the Gnome panel applet (and I understand the rational for that).

The bad: Even though the graphics drivers for the newest Intel video card are open source and Intel backed no less, I can't have desktop bling AND video playback. One or the other. That's kind of lame. But will probably be fixed, and I'm really hoping by the time Ubuntu 8.04 comes out.

More annoyingly, the sound situtation. The speakers are way to quiet in some situations, like playing a DVD and only acceptably loud other times. Ditto for the headphones. The only minor saving grace is that this is also the case in Windows Vista which the laptop came with. That the computer industry as a whole is shipping laptops with crippled gimpy sound like this is a little discouraging and amazing. Does no one test the hardware and software they ship? Max sound on both headphones and speakers should be better than a whisper. Also, some weird regression in Ubuntu in that when I plug headphones in the speakers don't turn off. Awesome. I though we had that licked like YEARS ago. It worked on my old laptop :p

Still, as a work and school machine the laptop is wonderful and more than sufficient. Additionally it can smoothly play UT2004 with all the features turned to low (which is really a a nice bonus) and I'm hopeful that with in a year it'll handle video and audio just fine. And lets face it, $600 is pretty damn cheap :)

Conectivity the old school way: Toshiba laptop modem (intel) and dialup

2007-07-26 13:56:53 PST

Tags: , , ,

So you might be noticing a theme emerge between this and my last post. Yes, after watching terrible movies and reading some books, some of which are sub optimal, and then generally immersing myself in the internet, I decided I needed to be more connected. So I have several projects on the go to fix that. The earlier post of getting GPRS internet on my laptop from my cell via bluetooth was one such project. But it's also financially impractical. However, my Telus ADSL package comes with 40 hours a month of dialup included. So I thought it was time to turn my attention to that. I'd ignored the old technology of modems forever, not thinking that they can still come in handy in pinch until the city is covered in municipal WiFi. Phone lines are often more prevalent then unsecured wifi in the city, especially in buildings or houses.

So, first, I hopped over to the Telus website and found that the Vancouver dial in number is 604-280-9000. Next, I had to determine the modem that my Toshiba Satellite m40x has. As it turns out there are tools for that: scanModem, a little shell script that does the trick. Downloaded it, unzipped it and ran it. It told me I had an Intel/Alsa modem. So I loaded up the snd-intel8x0m kernel module. Then I installed the sl-modem-daemon package that uses the module and provides the rest of the softmodem. It neede to be setup:

 # dpkg-reconfigure sl-modem-daemon -plow

And it just asked the county I was in, and the set things up. The modem was then controllable from '/etc/init.d/sl-modem-daemon' and could be started and stoped accordingly. The device that was created was /dev/ttySL0 but /dev/modem was also turned into a symlink that pointed to it so either was usable. With the modem setup and on, I then needed a dialer to connect me to my ISP.

First, a simple but verbose and command line dialer: wvdial. To set it up I ran

# wvdialconf /etc/wvdial.conf

It worked and the config file was created. But it needed editing. So I loaded it up in a text editor and uncommented the phone number (one number, no dashes or spaces), username, and password fields and filled them out accordingly. Lastly, for this modem, I needed to add the 'Carrier Check = no' line at the end of the file for it to connect properly. Then everything was in order and connecting was as simple as

# wvdial

Success. I had dailup internet. Ctrl-C in the terminal to disconnect.

The softmodem is flaky though and its often a good idea to restart it between dials

# invoke-rc.d sl-modem-daemon restart

Still, command line isn't as sexy as GUI, or at least not as convenient. So I then installed gnome-ppp and found it in the Applications->Internet menu. I put in the pertinent information again (phone number, username, password) and then tweaked a few options in it's setup window like device in the Modem section, and turning on 'Dock in notification area', and turning off 'Check carrier line' in the Options section. Then I hit the connect button and it connected and minimized to the notification area. Beautiful slow internet was mine!

Reference

Getting my Ubuntu laptop and Sony Ericsson k510a cell phone to talk to each other with Bluetooth: file sharing and internet over GPRS and ppp

2007-07-26 08:23:38 PST

Tags: , , , ,

Well, I taught my laptop a new trick.

I went out and bought a DLink DBT-122 Bluetooth adapter (USB). Cheapest one they had, plugged it into my laptop (Ubuntu Feisty) and it was recognized right away. Installed bluez and bluetooth related packages and started to play.

First thing I did was enable the bluetooth applet that runs in the notification area. It can also be accessed from System->Preferences->Bluetooth Preferences. Once that was on and my cell phone's (Sony Ericsson k510a) bluetooth was on I was able to use nautilus' sendto to send files via bluetooth to my cell phone. Then after turning on Applications->Accessories->Bluetooth File Sharing, which starts an applet in the notification area, I was able to send files to my laptop from my cell phone via bluetooth. So that was all cool, but it was also just warm up.

Next I wanted to get internet on my laptop through my cell phone. While impractical in the areas on cost and speed, it does have far greater coverage than random unsecured wifi access points around the city (especially as of late as people are finally starting to use WEP and WPA) and it's coverage out of city is of course no contest either.

So I installed a few more tools, ppp (Point to Point Protocol) related, like ppp and pppconfig.

The first tool I used was 'hcitool' which is used for establishing bluetooth connections and other bluetooth related issues.

# hcitool scan
Scanning ...
         00:17:B9:DA:E4:F2       phone.mindstab.net

This will scan for all bluetooth devices in range and return their name and MAC address. Next I had to connect to the phone and laptop or 'pair' the devices. For my phone, the Sony Ericsson k510a, I had to do this on the phone's side. I went to Settings->Connectivity->Bluetooth->My Devices. Then I selected New Device and after it scanned, I selected my laptop. It then bid me enter a 'password' so I choose a few numbers, and then the bluetooth manager on my laptop notified me a device was trying to 'pair' and asked me to enter the number there. That done my cell phone accepted my laptop. I selected my laptop/device on my cell phone and told it to always accept connections from that device. Also, to be safe, I put the password/number in '/etc/bluetooth/pin' although I'm not really certain if that was necessary.

Now the devices were set to connect to each other on a regular basis so back to hcitool to handle that. The 'cc' argument establishes or breaks a connection and the 'auth' argument authenticates the connection.

# hcitool cc 00:17:B9:DA:E4:F2
# hcitool auth 00:17:B9:DA:E4:F2

Now a bluetooth connection with the phone was established. Next up it was time to configure the ppp connection that would run from my laptop, over bluetooth to the cell, and from there over GPRS (or possibly EDGE?) to the internet.

First, I needed to further setup Bluez (Bluetooth handler on Linux) to facilitate this by creating a /dev/ entry for the connection. And I needed a bit more info. The command 'sdptool' delivered this to me. It can be used to list all the supported features of a device and their details. I was specifically interested in the 'Dial-up Networking' section.

# sdptool browse 00:17:B9:DA:E4:F2
...
Service Name: Dial-up Networking
Service RecHandle: 0x10002
Service Class ID List:
  "Dialup Networking" (0x1103)
  "Generic Networking" (0x1201)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Profile Descriptor List:
  "Dialup Networking" (0x1103)
    Version: 0x0100
...

In there I found the 'Channel' that the protocol was operating on, in this case '2'. Now I opened up '/etc/bluetooth/rfcomm.conf' and setup the device.

/etc/bluetooth/rfcomm.conf

rfcomm0 {
        bind yes;
        device 00:17:B9:DA:E4:F2;
        channel 2;
        comment "Bluetooth PPP Connection";
}

Then I restart bluetooth. On newer Ubuntu versions the service is just called 'bluetooth' but on older versions it's apparently called 'bluez'.

# invoke-rd.d bluetooth restart

Now I had setup a connection to my cell phone and created '/dev/rfcomm0' for it. I was now ready to setup a ppp connection over bluetooth.

pppconfig thankfully does most of the hard work here. It configures the ppp/peer files and the even more convoluted chatscript (some kind of text file that contains the initial connection protocol text that is used to establish the connection).

# pppconfig

pppconfig gives you a menu. I chose 'Create Connection'. Called it whatever, I chose 'gprs'. Next I selected 'Dynamic' (for DNS). Then I selected 'Chat' for the Authentication Method. I entered no password or login, and then deleted the text when it asked for a User name and another password. The default speed of '115200' baud was fine. 'Tone' is the choice for the 'Pulse or Tone' section. The number to dial was a bit tricky. It's in the form of something like '*99***slot-of-internet-on-cell#' so for me '*99***2#' was what I entered but others might try '*99***1#' or possibly '*99#'. I entered the port to use manually and entered '/dev/rfcomm0'. Then it gave me a chance to review and then write the file. I did so.

The two main files it creates are '/etc/ppp/peers/gprs' and '/etc/chatscripts/gprs'. If you are lucky you should just be able to connect now, but I had problems, so I had to tweak the files a bit. In '/etc/ppp/peers/gprs' I had to comment out the 'remotename' and 'ipparam' lines with hashs [#].

/etc/ppp/peers/gprs

...
user ""
#remotename gprs2
#ipparam gprs2

and in '/etc/chatscripts/gprs' I had to comment out the 'ogin:' and 'ssword:' lines again with hashes.

/etc/chatscripts/gprs

...
# ispname
#ogin: ""
# isppassword
#ssword: ""
# postlogin

Now all the ppp config files were properly configured to work with my phone, so it was time to try the connection out. Before that though, I turned other networking off, which is easy enough with NetworkManager, I just right clicked on it and unchecked 'Networking'. Then to turn on the connection over bluetooth, ppp, and gprs, I just used the 'pon' command.

# pon gprs

and gave it a few seconds. My cell lit up and told me it was connecting and then it connected. Then I was good to go. Sadly gprs internet rates are expensive here at $0.05 / kB. Also, it's a bit firewalled so the standard ping google.com test to see if the connection is working fails. I just loaded a small web page in my browser. It worked! Then tried to 'ssh' to my server, and that also worked! When I was done, I just

# poff gprs

to turn the connection off.

And that's it. Now I can get files to and from my cell phone and get internet from it for my laptop as well.

When I was having trouble, I looked in '/var/log/syslog' to see where the trouble was coming from.

Also, for some reason, the next day, 'sdptool' was reporting that the 'Dailup Networking' service had moved to channel 2 so I had to change '/etc/bluetooth/rfcomm.conf' file to represent that and restart bluetooth with 'invoke-rc.d bluetooth restart', so keep an eye out for that if your connection starts failing later for no reason.

References

Valid XHTML 1.0!
Valid CSS!
Mindstab.net is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
18 queries. 0.582 seconds.