NSLU2 Tools: keyevent

Purpose

'keyevent' is a little tool derived from evtest.c
to report keys being pressed or released on a selectable hardware device.
It uses the Linux kernel's event interface, so be sure to load the
evdev kernel module (modprobe evdev) before using keyevent.

Ok, that's nice but not so useful without any application interpreting
the output. The example below implements a shell script to control the
Music Player Daemon (MPD) using just
the MUTE button on the USB sound card mentioned above.

Pressing the button once turns the player on ("PLAY") or, if it is already playing,
skips to the next song in the playlist ("NEXT"). Pressing the button twice within
1 second stops the player ("STOP").

Download

keyevent 0.3 Source Code

keyevent 0.1 Source Code (outdated)

keyevent 0.1 BitBake Package

The packages are also available on my SlugOS/BE 3.10b feed. Follow these instructions (as root):

[1]maybe you could help me with madplay+musicbrowser?
Posted by João on Saturday, 08.23.2008 @ 05:24AM

I have very basic knowledge of linux environment;still, I maanaged to install on my slug (unslung v. 5.5 beta) lighttpd and php-fcgi and then => mpd+madplay and the web front-end musicbrowser (php). It works fine with my usb philips speakers (I bought a sound usb-dongle for use with the slug). I just lack basic control from my laptop, e.g. to adjust the sound volume of the player from the web interface (from musicbrowser)...Is it possible to adapt a script so it could interact with the keyboard of a machine connected to the lan so it would be possible what I want?

If you have a little moment, I will appreciate any hint or sugestion from you
Regards
João

Great setup - I have a very similar home setup with my NSLU2, but haven't yet got the 5.1 sound working on my Trust USB sound card (same as yours). Have you got it working?

Cheers,
Alan

Reply by Thomas: Hi Alan,
a few months ago I moved my sound card from the NSLU2 to the QNAP TS-109 II. However I can confirm the following:

On the slug 2.0 was working fine.

Also on the slug I used dmix to create 2 independent virtual 2.0 sound cards where one was connected to the stereo and the other one to the mini-speaker (shown in my pictures). That also worked fine but create ~15% additional CPU usage by dmix. So after a year I bought a small dedicated CMedia sound card for the speaker.

I just tried "speaker-test" on the TS109 and it works fine in a 5.1 setup. I did not check whether there was an actual signal on the respective outputs though. This is without any /etc/asound.conf or ~/.asoundrc file, the ALSA lib and utils are version 1.0.17, kernel is 2.6.27.

So I would guess 5.1 sound should also work on the NSLU2. Do you use some special ALSA configuration? Is there a meaningful error message when you try something like "speaker-test -D plughw:0 -c 6 -f 48000"?

hi i just wanted to leave you a message saying how much i really appreciate this software. im currently using this on my headless box and im using it with a psone controller to run/kill tasks when i want them to run.

thanks again for your hard work, good effort :)

Leave your comments

Name:

Email:

URL:

Subject:

Comments:

Note: The email address will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text. Examples:[b]bold[/b] ... bold[code]Source Code[/code] ... Source Code

Disclaimer:
The author does not take any responsibility for problems and
damage arising by installing or using this software, use it at your own risk.