December 7, 2008

mplayer remote control with k750i

mobile phone + bluetooth = remote control

In order to pair my phone with computer I've used "Bluetooth Applet" that comes with Ubuntu Desktop. Of course, I was dreaming that everything will work form that point: I will move joystick on the phone to the right and mouse cursor will move to the right too. But of course it didn't.

I've been looking through Google search results and realized that a bunch of programs were written to perform this task. I don't remember all of them, but I chose anyRemote and it had the work done.

I've installed java client on my phone. Just used Bluetooth Applet to send /usr/share/anyremote/client/anyRemote.jar to my phone.

Then I've run
anyremote -f /etc/anyremote/Server-mode/mplayer.cfg

From my phone I've started anyRemote, searched for any server and connected.

Thats all. Now I am using my phone as remote control for my PC. I can control video playback, toggle fullscreen mode and open new video files.

October 24, 2008

Building Ion3 under Cygwin

You'll need Ion3 sources, Lua sources.

Building and installing Lua
$ make generic
$ make mingw
$ make install
$ cp src/lua51.dll /usr/local/bin/lua51.dll


Building and installing Ion3
First you need to configure system dependent parameters.
Uncomment following lines in system.mk file:

BIN_SUFFIX = .exe
...
PRELOAD_MODULES=1
...
EXTRA_LIBS += -lintl
...
DEFINES += -DCF_NO_GETLOADAVG


And comment this line:
EXTRA_LIBS += -lrt

Now we are ready to compile and install Ion3 under Cygwin
$ make && make install

Since symbolic links in Cygwin replaced with Windows shortcuts, Ion3 cannot find look.lua and will start without decorations.
To fix this you can copy look_newviolet.lua file in look.lua:

$ cd /usr/local/etc/ion3
$ cp look_newviolet.lua look.lua




Running X server with Ion3
To run X server with Ion3 as window manager I used this bash script:

X -nodecoration -keyhook -clipboard > /dev/null 2>&1 &
ion3 -display :0.0

October 8, 2008

mkfifo в помощь онлайн радиолюбителю =)

Решил я тут как-то записать он-лайн радио, чтобы потом послушать в машине, но столкнулся с такой проблемой: магнитола не очень хорошо работает с файлами больших размеров (~700 мб).

Потом подумалось мне - может можно сразу записывать в маленькие последовательные файлы? mplayer мне в этом не помог - он просто пишет в файл и всё. Думал, можно было бы сделать "mplayer ... -dumpfile - | split -". Но mplayer покорно создал файл ``-'' и ничего не получилось.
Тут я вспомнил, где-то прочитанное: "в линуксе всё - есть файл".
- Но может есть какой-то такой файл, в который пишешь что-то, а оно там не задерживается и выходит тому, кто читает, или в никуда.
Погуглив на тему "linux special files" я быстро наткунлся на mknod и потом на mkfifo.

mkfifo создаёт как раз такой файл - данные вошли и вышли. mknod тоже так умеет, но там параметры какие-то надо указывать.

И того:
mkfifo ~/tmp/fifo
mplayer -nocache -playlist http://www.triplag.com/webradio/darkpsy/triplag-darkpsy.php -dumpaudio -dumpfile ~/tmp/fifo &> /dev/null
split --bytes 10M --numeric-suffixes --suffix-length 3 ~/tmp/fifo triplag


В результате получил файлы по 10 метров с записью радио, чему чертовски рад, т.к. городские радиостанции выносят мозг.

А можно такое сделать в Windows?