Insert those modules:
insmod /lib/modules/2.4.30/input.o
insmod /lib/modules/2.4.30/evdev.o
insmod /lib/modules/2.4.30/hid.o
Download HERE
To compile those modules yourself, you need to enable the following kernel option:
Input core support --->Input core support
< > Keyboard support
< > Mouse support
< > Joystick support
Event interface support
< > User level driver support
USB support --->
--- USB Human Interface Devices (HID)
USB Human Interface Device (full HID) support
[*] HID input layer support
[*] /dev/hiddev raw HID device support
Info: I couldn't use the keyboard module (keybdev.o), when i inserted this module he complained about undefined references:
unresolved symbol handle_scancode
unresolved symbol keyboard_tasklet
unresolved symbol kbd_ledfunc
I guess this is because the keyboard.o module doesn't exist.
Now create a new modules.d config file, /etc/modules.d/61-usb-hid with this content:
input
evdev
hid
Insert the modules manually or reboot your OpenWrt box.
Syslog when you connect the usb keyboard:
Jan 1 00:01:45 OpenFoensi kern.info kernel: hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik
Jan 1 00:01:45 OpenFoensi kern.info kernel: hid-core.c: USB HID support drivers
Jan 1 00:01:51 OpenFoensi kern.info kernel: hub.c: new USB device 01:03.0-2.3, assigned address 8
Jan 1 00:01:51 OpenFoensi kern.info kernel: input: USB HID v1.11 Keyboard [04d9:1203] on usb2:8.0
Jan 1 00:01:51 OpenFoensi kern.info kernel: input: USB HID v1.11 Device [04d9:1203] on usb2:8.1
Now there should be 2 input devices:
/dev/input/event0 /dev/input/event1
Now we need to handle these keyboard events, its time for cmdpad (http://cmdpad.sourceforge.net/). this app will listen to a /dev/input/eventX device (i our case a USB keyboard) and execute a program for each key pressed/released/keep pressing.
there seems to be a similar tool called mpc keyboard daemon, http://simon.arlott.org/sw/mpckbd/, but i didn't test it.
I compiled cmdpad for OpenWRT, but I didn't manage to create an ipkg package. You can get my poor ipkg attempt here or download just the binaries here.
install cmdpad to /usr/bin/
install cmdpad.conf to /etc/
install S70USBKbd to /etc/init.d/
the startscript looks like this:
/etc/init.d/S70USBKbd
#!/bin/sh
/usr/bin/cmdpad --quiet
SOUND
Install modules, source: http://sokrates.mimuw.edu.pl/%7Esebek/openwrt/ (http://sokrates.mimuw.edu.pl/%7Esebek/openwrt/packages/), extract them to /lib/modules/2.4.30/
Create /etc/modules.d/72-snd-usb-audio:
soundcore
snd-page-alloc
snd
snd-rawmidi
snd-hwdep
snd-timer
snd-pcm
snd-mixer-oss
snd-pcm-oss
snd-usb-lib
snd-usb-audio
install alsa-lib ipkg
install alsa-utils ipkg
install mpd / mpc ipkg
Configure mpd:
I mount a usb stick to /mnt/stick1, where the _mp3 subdirectory contains all my mp3's.
My mpd configuration, /etc/mpd.conf:
##################### REQUIRED ###########################
music_directory "/mnt/stick1/_mp3/"
playlist_directory "/mnt/stick1/_mp3/playlist"
db_file "/mnt/stick1/_mp3/.mpd/mpd.db"
log_file "/mnt/stick1/_mp3/.mpd/mpd.log"
error_file "/mnt/stick1/_mp3/.mpd/mpd.error"
pid_file "/mnt/stick1/_mp3/.mpd/mpd.pid"
##########################################################
#audio device
audio_output {
type "oss"
name "my OSS sound card"
device "/dev/dsp" # optional
format "44100:16:2" #optional
}
# OSS Mixer
mixer_type "oss"
mixer_device "/dev/mixer"
mixer_control "PCM"
state_file "/mnt/stick1/_mp3/.mpd/mpdstate"
buffer_before_play "0%"
Don't forget to create those directories:
mkdir /mnt/stick1/_mp3/.mpd
mkdir /mnt/stick1/_mp3/playlist
Start mpd, this will create the db and searches for all mp3 files.
Now add all mp3 files to mpc:
# mpc listall | mpc add -
WARNING for asus wl500 users, DO NOT INSTALL the package "kmod-usb-ohci" or your usb subsystem will get messy, for example my usb 2.0 stick didn't work anymore, error: usb.c: USB device not responding, giving up (error=-145)
DISPLAY
First I wanted to use a "regular" LCD display, but compared to a palm device on ebay, they are way too expensive. I bought some palm devices on ebay and the best device I think is the palm 3c. Nice color display and a rechargeable battery. I modded a palm 3x device, so I don't need batteries anymore but take the power from the usb port. This has a big drawback, when the device loose power, all installed applications are gone. You could copy some apps to the internal ROM but there is just 50k free space.
PalmORB (http://palmorb.sourceforge.net/) is your friend, this application emulates an Matrix Orbital LK204-25 LCD. My palm use a serial connector, so I need an usb/serial convertor. I had trouble with an FTDI adapter, now I use an PL2303 adapter. It looks like you only can go up to 9600bps, else the connection gets fluffy, but this should be enough for our display.
On the Openwrt you need to install LCD4Linux, I've patched the mpc plugin, check this article for a how-to.
CONCLUSION
There is still much to do here's a small list...
Current Issues:
- My cheap USB sound card seems to buffer the sound, when i want to pause a song, the device keeps playing for about 4 seconds.
- I need to write some scripts for mount / dismount the USB stick, rescan the music source.
- Currently I'm working on a gps plugin for LCD4Linux.
- ...
Feel free to support me, contact me at michu at neophob dot com.
0 comments:
Post a Comment