Hacking devices can/will void your warranty and can turn your expensive consumer electronics into worthless trash if you don't know what you're doing. This blog is for information purposes only, and if you try to hack into your own consumer electronics, you do so at your own risk. The device I'm currently hacking is the Canon SX10 IS camera.

Friday, March 5, 2010

RootApp and Wifi

Played around with the RootApp. Noticed that if you run RootApp with a -1 DvdPlayer then it will execute the specified program once, go to sleep after the program exits, then when you turn it back on it will resume and exit the RootApp watchdog program. Also, if you do RootApp -s then it won't execute any program, but will immediately put the player to sleep. When you power on, it wakes up and...reboots. But if you combine them doing -s -1 then when you power back on, it will resume and exit from RootApp.

I've also worked on trying to understand the wifi. When you disable the DvdPlayer from starting up, it doesn't mount the media partition or link the media drive to /tmp/hddmedia. It also doesn't configure the network/netmask and gateway for the wired or wireless connection.

At the beginning of the rcS file in the /usr/local/etc is the instructions for doing the network config, so I just adapted it for mine and added drive mounting and linking.

ifconfig eth0 192.168.0.2 netmask 255.255.0.0
route add default gw 192.168.0.1
mount /dev/ide/host0/bus0/target0/lun0/part4 /usr/local/etc/dvdplayer/hdd/volumes/HDD1
ln -s /usr/local/etc/dvdplayer/hdd/volumes/HDD1 /tmp/hddmedia

And of course I took out the RootApp DvdPlayer command so that it wouldn't activate the DvdPlayer. This has left two things for me to solve. #1) How to control the blue light. It continues to flash after booting, and the bootscreen stays up. Well, the HelloWorld can take care of the bootscreen, but figuring out what controls that power light has been more difficult. #2) Wifi does not get set up.


First run
/usr/local/etc/dvdplayer/script/run_tail
which installs the ehci-hcd and ohci-hcd modules using modprobe.

I think it also needs:
/sbin/modprobe ieee80211-rtl
/sbin/modprobe ieee80211_crypt

I found this info in the Main DvdPlayer as well:
/bin/echo nameserver 127.0.0.1 >> /etc/resolv.conf
ifconfig wlan0 up
wpa_supplicant -P/var/lock/wpa_supplicant.pid -D ipw -c /tmp/net/wpa.conf -i wlan0 -B
wpa_cli -p /tmp/net/wpa_supplicant status > /tmp/net/WPA.STATUS;touch /tmp/net/WPA.OK

The /tmp/net/wpa.conf file is added when DvdPlayer runs, but it looks something like this:

ctrl_interface=/tmp/net/wpa_supplicant
ctrl_interface_group=root

network={
ssid="MySSId"
proto=WPA RSN
key_mgmt=WPA-PSK
pairwise=TKIP CCMP
group=TKIP CCMP
psk="your wifi passphrase"
}


I've extracted information and found a webpage about setting up which has helped.
http://wiki.archlinux.org/index.php/WPA_supplicant

But I'm actually stuck at ifconfig wlan0 up. wlan0 isn't there. The light doesn't come on in the wifi adapter so I think the port needs to activate power or recognize the device or something similar. NetworkSet.cpp (can be found in Conceptronic sources) gives some hints but I haven't understood it yet. Anyway, that's what I'm working on now.

Saturday, February 27, 2010

Cursor, Navigation, Free Memory w/o resetav

Tonight I figured out how to set the graphics of the cursor. According to a system .x file in the common directory, the cursor is 32 x 32 x 2 bit color. So while I was direct drawing on the screen, I told it to use the same memory for the cursor. And it sure did. Color still seems limited to shades of green. But who knows, it may come in handy somewhere.

Also figured out how to navigate through a movie. I found out that the very routine that gives you how much time has elapsed in the movie also gives you the amount of time in the movie. Was able to jump around to the menu, move the menu selection, and activate it. All done through commands, not via the remote. Should be pretty easy to hook up to the remote once I want to, since I've previously figured out how to interact with the remote.

I was very concerned about calling the resetav all of the time. It would take the video bios and audio bios and put the information back in flash memory. Well, that's a problem if you do it too often. yet, it was the only way I could figure out how to recover once I displayed information on the screen. Well, that's no longer a necessity. It is still required if another program has done it, but mine seems to be able to recover from my own now. Can get all of the layers freed up and shut off.

This has all been pushed out to the git repository.

Tuesday, February 23, 2010

MP3 and LED

I've pushed out the changes so that MP3s can now be played, and that recording light was being turned on by the "setAVModeSCART" function, which made it very easy to track down what GPIO was controlling that light. Especially after I noticed that the light came on after the shutdown VideoPlayback process happened. So I just backtracked from the endin gof the program, commenting stuff out and rebooting (to turn off the light) until the light didn't come on.

Monday, February 22, 2010

Direct screen control

I am now able to control every pixel on the screen. Apparently they chose the R5G6B5 bitmap format for a reason -- it's the native storage format for the screen.

DG_GetSurfaceDesc (m_hSurface, &surfDesc);
DG_Lock(m_hSurface, 0, 0, unitRect.width, unitRect.height, 0);
x = horizonal value from 0 - 1920 (for 1080I)
y = vertical value from 0 - 1080 (for 1080I)
*((uint16_t *)((uint8_t *)surfDesc.lpsurface + (y*surfDesc.lPitch)) + x) = 0xffff;
// format is r5, g6, b5
DG_Unlock(m_hSurface);

edit: It was quite easy to switch it to a higher color format by just changing it from Format_16 to Format_32 when the surface was being created. It does not affect the video, it only applies to the overlay surfaces. But the SDK has Format_16 as the default, possibly inserted there by Ellion.

Sunday, February 21, 2010

MPG, Dvd, ISO, and JPG now working

Latest adjustments to the HelloWorld-JC program now include the ability to playback MPG, Dvd files, and automatically mount ISOs. I was also able to extract some code for having the chip render JPG. I was concerned that the method used for decoding the JPG was to pass the information via RPC to the chip. I figured that would interfere with the playback. Turns out, it doesn't! Since all of the decoding is done on the chip, the processor continues to be free to read and unpackage the media it is streaming.

Sunday, February 14, 2010

After nearly a month of having to work until late night to finish my project at work until I finished it Friday, I finally got a chance last night and tonight to continue hacking on the ScreenPlay. And the verdict? Success!

It's pretty limited right now. I've added several files and I'm still very dependent upon the library...For simplification, I've got only the AVI file types working right now (with corresponding audio). I now have the Hello World start up with a hard coded AVI filename that it launches and then it overlays the video screen with a translucent "Hello World", along with the cursor that continues to display as a green block (and the graphic structure still mystifies me).

Right now, it plays the video for about 10 seconds and then kicks out. Look at the main2.cpp program for more info. As always, I have checked this into the git repository on opensphd.sourceforge.net.

Monday, January 25, 2010

Dvdplayer, additional progress

Most of what I have been working on lately has been trying to understand the DvdPlayer program from Ellion. I've posted the source so far at opensphd.sourceforge.net in the HelloWorld git repository. Presently, I have it able to display a PNG and BMP on NTSC, PAL, and HDMI 720p and 1080i on the Iomega ScreenPlay Pro. I'm attempting to understand the video streaming. A99 has successfully added audio streaming to his version of the Hello World program.

In the meantime, Iomega has released r1.96 of the firmware. I have not investigated it yet, and quite frankly I don't have an interest in doing that because once I get my own DvdPlayer program written, I won't need their new firmware.

Superberney has also run out of time for maintaining IomTools, so he has agreed to open source it. I placed it out on the SVN repository in the opensphd.sourceforge.net, along with the changes I made to get the VSFTP and BFTP stuff working. I have not compiled and done any testing on it yet.

So there is plenty of stuff to do, and plenty of stuff in progress, just no discoveries to report right now. It's very interesting to see how Realtek constructed this. What I have learned from this is that the DvdPlayer program has plugin modules for pulling the data from files, http internet, streaming, transcoding server, etc, all which it puts in line to choose where the data comes from. It then analyzes it to determine what type of package the information is in, AVI, MPG, MPV, RM, etc. Again, all of those are put in line to choose which format applies. Then it unpacks and I believe at that point it sends the corresponding audio and video streams to the 1282 chip. They also have a module for picking out the SPU stream (subpicture unit, the subtitles). Anyway, I'm not getting any hacking done by posting this, so I'll end this post for now and hopefully my next post will be about playing a video.