Rockbox Technical Forums

Rockbox Development => New Ports => Topic started by: reabsind on April 27, 2007, 03:47:42 PM

Title: Cowon D2
Post by: reabsind on April 27, 2007, 03:47:42 PM
Basic Hardware info,

System-On-Chip: Telechips  TCC7801 [Core: ARM926EJ-S]
Codec: Wolfson WM8985
Memory:
   Internal: Samsung K4M56323PG  
   Storage: Samsung K9LAG08U0M-PCB0 (2GB)
Power Mgmt: Philips PCF50606

Source:
1) http://www.enet.com.cn/article/2007/0131/A20070131415958_6.shtml
2) http://www.anythingbutipod.com/archives/2007/02/cowon-iaudio-d2-disassembled.php#more

Title: Re: Cowon D2
Post by: reabsind on April 27, 2007, 05:34:41 PM
Firnware,

Before disassembling, need to understand the layout of the bin file.

Conclusions on just scanning the binary and strings
1) Layout of D2 firmware similar to U3
2) Layout of D2 firmware similar to M-bird rom !!!!

The firmware for M-bird XY-22 Player can be downloaded here
http://www.m-bird.se/software/XY-22/XY22SMV1320.rom

Further,
M-bird XY-22 based on TCC76x (ARM 940T core)
Cowon U3 based on TCC77x (ARM 946 core)
Cowon D2 based on TTC78x (ARM 926/946 core)


My analysis suggest this is 'coz all three use a common format created by Telechips SDK for ARM. Possibly even the preloader is the similar for all three :) These are encouraging signs....crack one and we are close to all!
I am sure many telechip licencees that are looking for smaller time to market will use their reference solution as is (including IRiver??)


I suggest the U3 progress ought to be relooked and taken forward 'coz my current knowledge (from iaudiophile forums) tells me that there is
*****             NO RECOVERY MODE      *****
in D2

U3 Page --> http://www.rockbox.org/twiki/bin/view/Main/IaudioU3Info



Title: Re: Cowon D2
Post by: music065 on May 04, 2007, 05:59:52 PM
processor info:

http://www.telechips.com/product/p_025.htm#

Successful rockbox of this unit would be a breathrough appreciated worldwide.  

This unit and its progeny, with its support of SDHD expandable flash memory, have the potential to make much of the current hard-drive based devices obsolete with the next few years.
Title: U3 Recovery Device
Post by: Michalaq on May 12, 2007, 08:19:07 PM
Cowon were recently forced to release a recovery tool for their U3.
It was mentioned here that the D2 and U3 have very similar architectures.
Perhaps this recovery tool could be used for recovery of the D2.

This has been suggested by NeoDeever over at the iaudiophile.net forums (http://www.iaudiophile.net/forums/showthread.php?t=14750&page=5).
He seems to have had some success with this utility (only the device addresses and the firmware files to be written had to be changed).

The D2 is a unique device, both because of its innovative processor and its touchscreen. A rockbox mod would be absolutely amazing.
Title: Re: Cowon D2
Post by: zivan56 on May 15, 2007, 12:49:02 AM
This player apparently has the same FM chip that the Sansa e2xx  series have, the Sanyo LV24020LP.
Title: Re: Cowon D2
Post by: slack on May 18, 2007, 07:33:11 AM
it seems as if someone has managed to get hold of recovery drivers. Users are reporting of a successful recovery on a faulty D2. This is pretty gd news.

Page 9 and on wards:

http://iaudiophile.net/forums/showthread.php?t=14750&page=9
Title: Re: Cowon D2
Post by: torrentseed on May 20, 2007, 01:38:08 PM
I can provide the recovery driver if anyone is willing to port Rockbox to Cowon
D2
Title: Re: Cowon D2
Post by: punit on May 31, 2007, 10:00:18 AM
I'm a 3rd year eng. student with some experience in digital processors, hardware & coding. I also have a colleague who is 3rd year electrical eng, so that oughta help too.
I have a feeling it's gonna be a lot of work...
http://www.rockbox.org/twiki/bin/view/Main/NewPort

After posting I did a bit of research - going through the datasheets of various ICs and all that. One thing I am not sure is how different the Telecips TCC7801 is from the ARM926EJ-S reference manual. I couldn't find the datasheet for TCC7801  :(.

I think there are two plans of action we can take - please feel to add or suggest better ways -
1. Try to understand the structure of the firmware binary - organisation and disassembly.
2. Try to trace the schematics and connections of the circuit board.

I found a few forum posts via google on some south east asian (thai I think) forums which had the disassembly pictures. Also the iRiver Clix uses the TCC7801 (again through SE Asian forums).

What's your take on the issue?
Title: Re: Cowon D2
Post by: man.dovvn on June 02, 2007, 11:44:14 PM
anythingbutipod has a disassembly set of pics. We'll have to take a look at any progress made on the clix that we can transfer over, I'm not expecting much though. If we have recovery drivers, we can write test programs for the D2 according to the ARM926EJ-S manual and see what works. If we trace the schematics we can use a program to simulate the hardware, making testing & design a much easier and faster process. & I haven't any experience in decompiling/reverse engineering firmware. I am pretty good with coding though, & I have had some experience with ICUs & the coding limitations of hardware.
Title: Re: Cowon D2
Post by: punit on June 05, 2007, 11:27:08 AM
Even if we can trace the schematics we still have no way of knowing the internal topology of the 7801. If I understand correctly it contains two processors - ARM926EJ-S and ARM946E-S and many peripheral controllers - LCD, Touch scree, SD card, USB etc.

To understand all these we'll have to reverse engineer the firmware. And possibly probe the pins when we can get a program running on the processor.

I also don't have much experience with reverse enginneering so am struggling a bit. Current plan is to get the recovery drivers and snoop at the USB traffic to see what commands are being sent. Am also trying to get hold of an ARM simulator which we can simulate the firmware in. Do you know of one?

Did you try anything since your last post?
Title: Re: Cowon D2
Post by: punit on June 05, 2007, 08:00:29 PM
I was studying the firmware for the D2 and noticed that the firmwares started with a string "Ver:0071".

The same was the case with the other firmwares mentioned near the top of this thread too. I was wondering if anybody had an idea as to what format this is?

Another thing I noticed was that certain strings appeared more than once in the firmware. "Pure virtual fn called" for example. My hypothesis is that the bin files are actually packed file containing multiple files (possibly the flash filesystem) with individual binaries stored within them.

Would anybody know anything about this string 'Ver:0071" and the file format used? Or alternately is there a way to detect if the bin files are image of filesystem?

Would really appreciate any help I can get.
Title: Re: Cowon D2
Post by: punit on June 18, 2007, 03:31:12 PM
An update on my last post - I tried a few things and had the scare of my life.

Currently there are two unidentified fields in the header - at address 10h and 18h. In order to know more about them, I changed a character in a string in the firmware binary and tried loading it on the D2. On reboot of the D2, a firmware update screen shows up, but the progress bar reaches about 1/5th and then straight goes to the opening menu. The file is deleted from the root directory of the D2.

This points to a checksum which fails and prevents D2 from updating the firmware.

Next I tried to change the unidentified fields in the firmware header on an original firmware binary. On changing the field at 18h I got similar results with the firmware being rejected (i.e., not loaded and deleted from root directory).

After this things got a little hazy. I lost patience and didn't document the changes I made in the binary. From memory, I kept the field at 18h unchanged and zeroed the four bytes starting at 10h. And next I know, the D2 is not booting.

Oh shit. I am glad I had the recovery drivers. But it is a windows application and I am not very good with windows. After a couple of tries and lots of tense moments I am able to use the recovery drivers to get the D2 back from the land of the dead.

My thoughts from these fiddling is that the field at 18h is a 32bit checksum. No idea what format. Still don't know what the field at 10h is or could be.

A few things I failed to notice -
1. After installing the firmware update from the recovery drivers whether the same upgrade bars shows up or not.
2. I chickened out after the recovery but a worthy thing to try would be try loading a modified firmware from the recovery software. Would give a clue as to the firmware checksum being checked even after loading via the recovery software.
3. Using a USB snooper to monitor the data and command sent over the USB during the recovery procedure.

I would appreciate if somebody could provide a confirmation of the results - the ones related to field 10h and 18h.

I will continue to fiddle around, but my knowledge of reverse engineering is small. So if there are others interested we could pool our resources and hopefully make faster progress.

[Reposted from iaudiophile forum]
Title: Re: Cowon D2
Post by: man.dovvn on June 19, 2007, 02:52:14 AM
I say we continue trying to reverse engineer. The first thing we can try is simply decompiling the firmware files into some common languages. After that fails (hopefully not but...) our main problem will be the checksum. If we can crack that we can modify the firmware, load it up and docment changes. Hopefully we'll work out what to do from there. Check out http://iaudiophile.net/forums/showthread.php?t=14618 as well. It looks like we're gonna have some trouble with telechips. Perhaps someone on the inside of a company could pass on the manuals.
Title: Re: Cowon D2
Post by: man.dovvn on June 19, 2007, 03:19:49 AM
http://forums.rockbox.org/index.php?topic=3320.180

someone mentions using ms visual studio debugger, analyisng the recovery program could prove useful.
Title: Re: Cowon D2
Post by: Taustin Powers on October 17, 2007, 08:27:01 AM
Seems like the folks at iaudiophile.net made some interesting progress:

http://www.iaudiophile.net/forums/showthread.php?t=15966&page=2

"Tried testing out the CRC generating method in the link given in my last post. I modified firmware 3.51 (just changing a couple of strings), re-generated new checksums and loaded the custom firmware onto the D2. Works perfectly.

Have to explore the firmware file in more detail now to figure out how stuff works..."
Title: Re: Cowon D2
Post by: man.dovvn on October 18, 2007, 10:13:19 AM
 :o

Nifty, but decompiling/decyphering the firmware is still potentially a huge task.

If we've got it in assembly... hmmm... I've only done one semester of assembly, but if I can deterimine the subroutines for common tasks I can be writing custom programs in hours.

I'll keep an eye on all this but it's coming up to exams for me, so I'm unlikely to have any time for a bit.
Title: Re: Cowon D2
Post by: shotofadds on October 19, 2007, 12:27:41 PM
Apologies, I was referring to this post:

http://www.rockbox.org/mail/archive/rockbox-dev-archive-2007-07/0081.shtml

which has datasheets for the TCC76x - I'd misread this as directly relating to the D2. Hopefully there is some common ground, however. As for the other components, your guess is as good as mine.
Title: Re: Cowon D2
Post by: linuxstb on October 20, 2007, 05:19:06 AM
Would someone be able to make a usb log of the recovery mode driver working with the D2 and make it available to me?

There are various USB sniffers, I've used usbsnoop with success - http://sourceforge.net/projects/usbsnoop/

With this information, I should be able to add support for the D2 for uploading code in USB boot mode to tcctool, which I've just committed to Rockbox SVN:

http://svn.rockbox.org/viewvc.cgi/trunk/utils/tcctool/

Title: Re: Cowon D2
Post by: dalmane98 on October 20, 2007, 01:31:52 PM
Would someone be able to make a usb log of the recovery mode driver working with the D2 and make it available to me?

I do not know how to do what you are asking for, but I can provide you with a link to the recovery files.
Title: Re: Cowon D2
Post by: linuxstb on October 20, 2007, 03:48:38 PM
I'm asking for someone with a D2 and the recovery tool to use it to recover their D2, and to make a log (using usbsnoop or another usb logger) of the resulting USB communication.

I don't own a D2, so the recovery tool is no use to me.
Title: Re: Cowon D2
Post by: dalmane98 on October 20, 2007, 04:06:43 PM
I have a D2 and the files.

I downloaded usbsnoop and got it installed for the D2 and got a log file from an unbricked D2. Not sure how long I should let it capture data, though.

I am willing to use usbsnoop and the recovery files, but I am not sure how to brick my D2 or at least configure my computer so that it will not recognize the player. Can you help me out here?

My OS is windows XP w/SP2.

Could I just load the USB driver files that the recovery files come with and then try and use them by installing and restarting them using usbsnoop?

I just need a little guidance. I am comfortable with hardware, but not programming.

Someone at  iAudiophile posted his lsusb output for the D2, but it was not bricked:

http://iaudiophile.net/forums/showpost.php?p=149740&postcount=26

Not sure if that will help.

I am willing, just need help.

Title: Re: Cowon D2
Post by: linuxstb on October 20, 2007, 04:58:17 PM
Thanks for the link to the lsusb output, but that's not useful at all.

I've now been given a copy of the recovery application, and the documentation that it came with gave me the info I need.

To give some background, I'm working on a port to the Logik DAX DAB/MP3 player - a cheap 1GB flash player with DAB radio.  It has a TCC773L processor, so similar to the D2.

All Telechips CPUs have a "usb boot" mode.  When a device in USB boot mode is connected to a PC, a firmware binary can be uploaded to the device's RAM and executed - this is a safe way to test-run a new firmware before flashing it.

The recovery mode tool uses this boot mode to upload a small "recovery firmware" to the device, which then continues to talk to the host PC via USB and perform the actual recovery firmware upgrade.

tcctool is a relatively simple tool which implements the PC-side of a USB boot - this is how I've been testing code on my device, and how someone wishing to port Rockbox to the D2 can also safely test code.

If there are any Linux users that would like to test tcctool with the D2, please visit the #rockbox IRC channel and talk to me.  It requires libusb, and hence isn't trivial to get to work in Windows (and I can't help with that).  Hence my request for a Linux user.
Title: Re: Cowon D2
Post by: Yeeze on October 20, 2007, 08:19:25 PM
I posted the lsusb output over at the iaudiophile forum!
I am pretty new to linux, and I don't have the recovery drivers for the D2...
But I want to help!
So if someone can give me the recovery driver, I can see what I can do...
At first I will try to install tcctool... [Done]
Title: Re: Cowon D2
Post by: linuxstb on October 21, 2007, 05:05:54 AM
Unless my tcctool changes don't work, I don't need anyone to test and log the recovery tool.

Can a Linux user do the following:

1) Download the tcctool source from the Rockbox SVN?  You'll need the "subversion" tool installed:

svn co svn://svn.rockbox.org/rockbox/trunk/utils/tcctool tcctool

2) Type "cd tcctool" followed by "make" to compile tcctool.  You'll need libusb installed (including the libusb-dev package).

[NOTE: For the following steps, you will need to become root]

3) Connect your D2 to your PC in USB boot mode - hold the MENU button as you switch the D2 on.  The LCD won't display anything, but typing "lsusb" should show a device with IDs 140e:b021.

If it shows as 140e:b011, then let me know - tcctool won't work if that's the case.

4) If your device is showing as 140e:b021, then you can test tcctool by uploading the "d2N.bin" file from the original firmware.  You should test with the d2N.bin file from the same version of the original firmware that is installed on your device:

./tcctool -d cowond2 /path/to/d2N.bin


This will take a few seconds to upload the firmware file, after which you should see the original firmware run.
Title: Re: Cowon D2
Post by: Yeeze on October 21, 2007, 06:16:24 AM
The D2 boots automatically when conected to the USB...
So I pressed the Menu button and connected the D2, the screen remained black.
When I typed in lsusb it took like 3 seconds longer than normal, but it did not show the D2...
I tried it with sudo lsusb and with lsusb logged in as root, but same result...

Do you know what I did wrong?
Title: Re: Cowon D2
Post by: linuxstb on October 21, 2007, 06:39:40 AM
Can you try typing "sudo lsusb -t" when your D2 is connected in recovery mode and post the output?

Title: Re: Cowon D2
Post by: Yeeze on October 21, 2007, 06:46:15 AM
Yep that worked:

Code: [Select]
Bus#  5
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#  22 Vendor 0x140e Product 0xb011
Bus#  4
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  3
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  2
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   2 Vendor 0x0db0 Product 0x6982
Bus#  1
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   4 Vendor 0x046d Product 0xc01d
Title: Re: Cowon D2
Post by: linuxstb on October 21, 2007, 06:55:42 AM
OK, so we know it's using product id b011, rather than b021 like the other Telechips devices.

Unfortunately, it seems the D2 is exhibiting the same behaviour in Linux as my Logik MP3 player, a problem I haven't solved.  tcctool is only actually working under Mac OS X for me - I don't know a solution.

However, tcctool is working fine with the iaudio 7 under Linux, which is why I thought the D2 may also work.

What happens with my Logik player is that the device appears in /proc/bus/usb/devices (which is what the lsusb -t option is parsing), but it's not actually accessible as a usb device, and hence isn't showing up in a normal lsusb - the device times out during the get_configuration() call.

Strangely, I don't get the same problems when running tcctool under Mac OS X.

So there's probably nothing more that can be done unless you're a Linux developer willing to investigate the USB connection issues...

If by any chance, a D2 owner with Mac OS X is reading this, you could try the same test.  I will update tcctool to also look for product ID b011 for the D2.
Title: Re: Cowon D2
Post by: Yeeze on October 21, 2007, 07:14:16 AM
I only got windows XP and linux...

So the problem here is how linux handles usb devices with product ID b011?
And there is nothing that can be done about that?

I will ask over at the iAudiophile forums, I know some people got macs there...!
Title: Re: Cowon D2
Post by: punit on October 22, 2007, 07:34:54 PM
If by any chance, a D2 owner with Mac OS X is reading this, you could try the same test.  I will update tcctool to also look for product ID b011 for the D2.

I couldn't find lsusb on Mac. I tried searching for it on fink but couldn't find the package. Where did you install it from?

Title: Re: Cowon D2
Post by: GodEater on October 23, 2007, 02:57:53 AM
I could be wrong - but I don't think linuxstb meant for you to run lsusb on your Mac - that's not part of the test. I'd very surprised if there's a port of it for OSX, as the USB stacks are utterly different, and I doubt OSX presents it's USB devices in the same device tree as linux does.
Title: Re: Cowon D2
Post by: man.dovvn on October 23, 2007, 04:35:56 AM
Huge help if we have the chip's manual.
Please keep poking around and I'll be in to help when I can.
Title: Re: Cowon D2
Post by: Yeeze on October 23, 2007, 05:51:36 AM
@punit:
When I understood this right, with a mac, you can access the D2 in USB-boot mode (When you connect it and hold the Menu button down), and then you can use Tcctool, to comunicate with the D2, while installing the firmware...

I hope linuxstb reads this, so he can tell you, what you need to do, and what he exactly needs!!
Title: Re: Cowon D2
Post by: GodEater on October 23, 2007, 06:29:15 AM
I hope linuxstb reads this, so he can tell you, what you need to do, and what he exactly needs!!

He's in France this week, so probably less active than usual. Have patience :)
Title: Re: Cowon D2
Post by: linuxstb on October 23, 2007, 12:13:57 PM
Here is what a Mac user needs to do to test tcctool (as GodEater speculated, lsusb isn't needed):

1) Download and install libusb.  I've put the packages I've used here (I've forgotten the original URLs):

http://www.davechapman.f2s.com/rockbox/libusb-10.4u.sdk.pkg.tar.gz
http://www.davechapman.f2s.com/rockbox/libusb.pkg.tar.gz

2) Download the tcctool source from the Rockbox SVN.  You'll need the "subversion" tool installed:

svn co svn://svn.rockbox.org/rockbox/trunk/utils/tcctool tcctool

3) Type "cd tcctool" followed by "make" to compile tcctool.

[NOTE: For the following steps, you will need to become root]

4) Connect your D2 to your Mac in USB boot mode - hold the MENU button as you switch the D2 on.  The LCD won't display anything.

5) Test tcctool by uploading the "d2N.bin" file from the original firmware.  You should test with the d2N.bin file from the same version of the original firmware that is installed on your device:

./tcctool -d cowond2 /path/to/d2N.bin


This will take a few seconds to upload the firmware file, and if tcctool is working, you should see the original firmware run.

I'm aware that the D2 firmware comes in two folders - "0" and "1".  I've no idea what the difference is, but I would probably try the one in "1".

Title: Re: Cowon D2
Post by: dalmane98 on October 23, 2007, 08:11:15 PM
I am doing some speculating here about folder 0, but I believe I am close to what happens when you update the firmware.

Folder 0 contains files that are similar to the recovery program (FWDN). I say this because in some of the firmware updates Cowon did not have you use the contents of folder 0 unless you were using an older firmware version. You also did not lose any files you had transferred to the D2

i.e. if using 2.24 use folder 0, if using 2.26 use the contents of folder 1 and then apply the contents of folder 2. Just using folders 1 and 2 normally does not erase any of the data you have loaded on the D2.

The use of folder 0 always erases your data. Cowon has a warning that "all data in D2 will be deleted, so please back up your data." Here is a link to Cowon’s instructions:

http://www.cowonglobal.com/zeroboard/zboard.php?id=C08&page=1&sn1=&divpage=1&bmenu=download&sn=off&ss=on&sc=on&select_arrange=headnum&bmenu=download&desc=asc&no=281&bmenu=download

Almost all the D2’s that have been bricked are bricked after applying the contents of folder 0. The D2 is no longer recognized by the computer and the New Hardware Wizard appears.

The most recent updates have required that you use all 3 folders.

After dropping the contents of folder 0 into the D2, disconnecting it and turning it on to install the file, the D2 will display a firmware version of 0.00 if you turn it on after it shuts off as part of the firmware upgrade, without connecting it to the computer (this is not part of the upgrade process).

Folder 2 contains the files that are modified for themes and to apply a patch that makes the fonts larger on the D2.
Title: Re: Cowon D2
Post by: linuxstb on October 23, 2007, 08:25:56 PM
dalmane98,

So if I'm understanding what you're saying, the "0" firmware is just a temporary firmware which is only needed in some circumstances in order to be able to upgrade to the "1" firmware?

In all cases, "1" is the final firmware file installed?

This would imply that the "1" firmware is definitely the one to use with tcctool.
Title: Re: Cowon D2
Post by: shotofadds on October 24, 2007, 04:26:04 AM
Having had a poke around with the disassembler, on a first glance both images look like executable-type image to be loaded into RAM (they're both unpacked and unencrypted for the curious).

I doubt very much that either of these images are flashed to ROM, given that (certainly in the case of the "1" image) the code needs read/write access to the data sections within it.

The "1" image certainly seems to contain the main software for the D2 - there are a LOT of useful strings in there....
Title: Re: Cowon D2
Post by: linuxstb on October 24, 2007, 05:16:30 AM
Having read/write sections doesn't prevent code being flashed to ROM - it's common for code to be stored in flash ROM, and then copied to RAM and run from there.

On the Telechips devices I know about (which excludes the D2), the firmware appears to be stored in a "hidden" (i.e. not exposed via UMS) part of the main NAND flash disk.  It's then loaded to RAM by the small boot-ROM embedded in the telechips SoC and executed - "NAND boot mode".

So the installation of a new firmware involves writing it to this hidden part of the main NAND disk.  If this part of the NAND disk gets corrupted, or the firmware stored there is bad, then you need to use the recovery tool, which uses the "USB boot mode" to load and execute code via USB, instead of the NAND disk.
Title: Re: Cowon D2
Post by: dalmane98 on October 24, 2007, 06:26:08 AM
dalmane98,

So if I'm understanding what you're saying, the "0" firmware is just a temporary firmware which is only needed in some circumstances in order to be able to upgrade to the "1" firmware?

In all cases, "1" is the final firmware file installed?

This would imply that the "1" firmware is definitely the one to use with tcctool.

You are understanding me just fine.

Here is a link to instructions from Cowon that show it in more detail:

http://www.cowonglobal.com/zeroboard/zboard.php?id=C08&page=1&sn1=&divpage=1&bmenu=download&category=21&sn=off&ss=on&sc=on&select_arrange=headnum&bmenu=download&desc=asc&no=273&bmenu=download

I can send you detailed user observation (what happened at each step) for upgrading from to 2.46 and then to 2.50.
Title: Re: Cowon D2
Post by: Yeeze on October 24, 2007, 07:24:54 AM
I made some tests with the "0" firmware, and it is actually a basic firmware, I can play music and browse the content, but it is quite messed up, there are a lot of bugs with rendering, and not all features work...
Since I installed the resource file from 3.51, not all pictures are loaded, but I think, the the file in folder "1" only updates the firmware(installs the new features and stuff), so isn't the file in folder "0" the important one?

Anyways next I will see if a formated D2 can install only the file from folder "1", I'm just a little scared that this could brick my D2, what do you think?
Title: Re: Cowon D2
Post by: linuxstb on October 24, 2007, 10:00:35 AM
Yeeze,

If I was you, I wouldn't play too much with the firmware updates, although the recovery tool looks like it should help you recover from any mishaps.

In terms of porting Rockbox (which after all is the subject of this thread), the most important thing is being able to test-run code without permanently installing it on the device (so you can easily recover when it inevitably crashes) - which is what tcctool should hopefully do.

Title: Re: Cowon D2
Post by: punit on October 24, 2007, 12:50:34 PM
Following linuxstb's instructions, I was successfully able to upload firmware d2N.bin from the "1" folder.

The D2 started successfully, after the upload.

I had to change tcctool.c to increase the maximum size of allowed firmware.

Hurray!

Now that we can upload programs to the D2 and transfer control to it - What's next on the agenda? Anybody have a working toolchain and a rockbox compiled binary for testing?
Title: Re: Cowon D2
Post by: saratoga on October 24, 2007, 01:09:19 PM
Probably figure out how the LCD works and then write a driver for it so that you can print things to teh screen.
Title: Re: Cowon D2
Post by: Bagder on October 24, 2007, 03:54:14 PM
For toolchain, run the tools/rockboxdev.sh script in the rockbox source tree to get that setup.

Most often, we first work on getting the bootloader to build and run, and it more or less implies working LCD and button drivers, together with the ability to read the nand flash (so that rockbox can be read from it).
Title: Re: Cowon D2
Post by: Yeeze on October 25, 2007, 09:20:07 AM
I think I found some useful information about the display...
I hope it is actually about the display of the D2, I found it through the number on it:
(http://s6.directupload.net/images/071025/spoumt6m.jpg)
Its an adobe reader document, I found it here (http://www.neodns.co.kr/sub_tft(1).htm), choose the first one
If you want to download it directly from rapidshare, click here (http://rapidshare.com/files/65070213/LTV250QV-F0B_070105_.pdf.html)
I hope it helps when writing the driver for the LCD Screen.
Actually, I would like to help writing a driver, but I never did this, I got programming experience in c, c++ and java...
Title: Re: Cowon D2
Post by: LambdaCalculus on October 25, 2007, 09:49:41 AM
Actually, I would like to help writing a driver, but I never did this, I got programming experience in c, c++ and java...

Rockbox is mostly written in C, with touches of assembler here and there. You've got C experience, so you're good to go. Grab the source and start reading it to see how it's structured.
Title: Re: Cowon D2
Post by: mkdf on October 27, 2007, 04:32:18 AM
Just tried to load firmware with tcctool under linux - and it works. Firmware was successfully loaded, but after restarting all my settings were destroyed :(
Interesting that after executing "lsusb -v" which gives error "cannot read device status, Connection timed out (110)" tcctool no longer works: "[ERR]  usb_set_configuration failed (-110)".
BTW, I'm using gentoo linux, kernel 2.6.22-gentoo-r8. D2 shows as 140e:b011.
Title: Re: Cowon D2
Post by: linuxstb on October 27, 2007, 09:10:07 AM
Just tried to load firmware with tcctool under linux - and it works. Firmware was successfully loaded, but after restarting all my settings were destroyed :(
Interesting that after executing "lsusb -v" which gives error "cannot read device status, Connection timed out (110)" tcctool no longer works: "[ERR]  usb_set_configuration failed (-110)".
BTW, I'm using gentoo linux, kernel 2.6.22-gentoo-r8. D2 shows as 140e:b011.

Good to know that it's actually working under Linux as well - to some extent...

Did you use tcctool to load the same version of the firmware that you currently have installed on your device?  A version mismatch would probably cause the settings to be reset.
Title: Re: Cowon D2
Post by: mkdf on October 27, 2007, 10:11:42 AM
Did you use tcctool to load the same version of the firmware that you currently have installed on your device?  A version mismatch would probably cause the settings to be reset.
Yes, that was the reason.
Title: Re: Cowon D2
Post by: Yeeze on November 03, 2007, 07:08:14 AM
So it seems it got a little quiet around here...

First of all, I got the recovery drivers, so if anybody already bricked their device tell me =)

Further more, after mkdf posted he got the firmware loaded on the D2 using tcctool with Gentoo linux I tried to get it working under ubuntu, but no luck, do I need to change the value in the source of tcctool, or what did you do to make it work?

And what can I do, if I got tcctool working?

I looked over the rockbox source code and WOW, I mean I wrote some programs, but I never programmed a driver, and that looks kinda wired for me, are there any tutorials for writing drivers, or how to get the values for the buttons?
(for example the 0x10 for the left button on the iPod)

Another thing I am interested in, could it be possible to implement multitouch? Or is this an issue of the hardware? I mean when I use the paint program on the D2, I can see when I press with two fingers on the screen, it will paint exactly between them, and it is even pressure sensitive... But maybe it would just be too cool to have multitouch... ::)

Is the document about the screen, I posted the other day, useful at all?

One more thing, how a bout an entry in the wiki for the D2? I never did this, and I don't know how to do this, but I think then it is easier, to see the progress.
I found a lot of pictures of the inside on the internet, are those useful, or is it thwe best to take those by ourselves?
Title: Re: Cowon D2
Post by: AlexP on November 03, 2007, 07:55:36 AM
As regards the touch screen you probably want to talk to JDGordon on IRC.  He is currently working on the first touch screen target rockbox has, the M:ROBE 500 and has done some work on adapting rb for it.  None of the existing targets are touch screen
Title: Re: Cowon D2
Post by: linuxstb on November 04, 2007, 05:52:04 AM
Yeeze,

Nice find with the LCD - that PDF is indeed very useful, as it's a datasheet including programming information for the LCD.

That's only half the story though, you also need to determine how the CPU communicates to the LCD controller.  I've just had a quick look at a disassembly of v2.20 of the D2 original firmware, and you can see a function (at offset 0x6b404) which implements the Power On sequence of the LCD as described on page 22 of the datasheet.  (I found it by searching the firmware for constants used in the power-on sequence).

[EDIT: This datasheet doesn't appear to be as useful as first impressions would suggest - it refers to the datasheet for the "S6F2002 IC" for detailed information on the command list and instruction description.  So more googling is needed.]

The purpose of tcctool is to implement the PC side of the Telechips "USB boot mode".  Basically, this means that you can safely upload test code to the D2's RAM and execute it.  When this code inevitably crashes, you just power-cycle/reset the D2, and it will be back to normal.

The tests people have done so far is just to upload the original firmware to the D2.  Its real use is for developers to upload test code.

Yes, a wiki page is very useful for gathering information about a port (this forum thread should be considered temporary, and used for discussion only).  Regarding photos, remember to respect the copyright of others, so yes, it's best to only upload your own photos to the wiki.
Title: Re: Cowon D2
Post by: punit on November 04, 2007, 09:05:32 AM
Couldn't find the datasheet on a quick google search. But came across the LCD driver in the Linux kernel. Here are the links. Maybe prove useful for somebody writing LCD driver for rockbox -

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/video/backlight/ltv350qv.h;h=189112e3fc7aedf5532364c783011f7cdf804607;hb=HEAD
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/video/backlight/ltv350qv.c;h=2eb206bf73e65fb54026d318f281107ab601ec3f;hb=HEAD

linuxstb: Nice trick of finding the function in the disassembly. I guess that'll give some idea about the board layout and connections in the D2.
Title: Re: Cowon D2
Post by: linuxstb on November 04, 2007, 09:27:35 AM
I've started a wiki page for the D2 here:

http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info

Everyone should feel free to edit it and add more info.

Regarding the S6F2002, I found a Linux driver as well, and the comments in it refer to the datasheet being available on the "AVR32 Linux BSP CD".

A quick google shows that CD iso image being available here:

http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918

[EDIT: No, it's not there...]
I'm currently downloading it, and will post here to say if the datasheet is in fact there.
Title: Re: Cowon D2
Post by: shotofadds on November 06, 2007, 05:28:51 PM
I'm sure one of you guys has figured this already, but looking at the firmware disassembly, the SPI interface to the LCD is accessed by writing the following bits to either 0xF005A028 (to set the pin low) or 0xF005A02C (to set the pin high):

bit 24 = /CS
bit 25 = SCL
bit 26 = SDI

Register and data pairs can then be written as per the diagram in section 6.1 of the LCD datasheet. This would allow us to perform the power-on and power-off sequences given in section 9.

Establishing how RGB data is transferred is another matter entirely though...
Title: Re: Cowon D2
Post by: Malle on November 10, 2007, 09:48:42 AM
So it seems it got a little quiet around here...

First of all, I got the recovery drivers, so if anybody already bricked their device tell me =)

Further more, after mkdf posted he got the firmware loaded on the D2 using tcctool with Gentoo linux I tried to get it working under ubuntu, but no luck, do I need to change the value in the source of tcctool, or what did you do to make it work?

And what can I do, if I got tcctool working?

Hello,
first of all thanks for the efforts already done by so many people. For me as a 'beginner' reading your posts is entering a different world behind the UI.
Neverless I have a bricked D2 (4GB) as well. After a failed F/W upgrade (-> 2.51) it doesn't start up anymore. It also not recognized by my Ubuntu system or windows. But I can find the bugger with lsusb -v, as it is mentioned earlier in this post.
As I mentioned I'm running Ubuntu and therefore I couldn't so far get tcctool working as well. Is there any update?
@Yeeze: can you provide me the recovery drivers as back up, in case there is no running tcctool in the near future? Thanks.
Perhaps this is not the right place to ask for this, but this post is the best I could find, which might help me out.

Thanks anyway for sharing the knowledge.

Malle
Title: Re: Cowon D2
Post by: linuxstb on November 10, 2007, 04:52:48 PM
Please don't turn this thread into a general D2 troubleshooting discussion - it should be limited to discussion related to porting Rockbox.

Discussion of the use of tcctool to help recover broken D2s is happening here:

http://iaudiophile.net/forums/showthread.php?t=17680
Title: Re: Cowon D2
Post by: Malle on November 10, 2007, 11:11:17 PM
ok, thanks for the notice

Malle
Title: Re: Cowon D2
Post by: dalmane98 on November 11, 2007, 11:25:42 AM
Tcctool works on a bricked D2.

I bricked my D2 on purpose and was able to recover it using Tcctool.

I used the Windows version.

Thanks Linuxstb for a great tool.
Title: Re: Cowon D2
Post by: shotofadds on November 12, 2007, 04:34:51 AM
Good stuff. Just out of interest, how did you build tcctool for Windows?

I've been spending a bit of time cross-referencing various similar/identical routines in the M:Bird XY22 (TCC767 - which we have a datasheet for), Logik DAX (TCC773) and D2 (TCC7801)firmwares - particularly routines like the ARM IRQ/FIQ vectors.

This has allowed me to identify a fair number of port-mappings (eg. IRQ controller, timers, digital audio in/out, ADCs). Of course this info is nowhere near complete, but I'll post what I have on the wiki sometime this week.

Yeah, I had a lot of time on my hands the last few days ;)
Title: Re: Cowon D2
Post by: Bagder on November 12, 2007, 05:28:34 AM
linuxstb's windows build of tcctool is now available on the rockbox download mirrors:

http://download.rockbox.org/utils/tcctool/
Title: Re: Cowon D2
Post by: linuxstb on November 12, 2007, 05:53:16 AM
Good stuff. Just out of interest, how did you build tcctool for Windows?

I added instructions for building tcctool on Windows to the README file in the tcctool source directory a couple of days ago.
Title: Re: Cowon D2
Post by: shotofadds on November 15, 2007, 05:23:05 AM
As has already been stated, there are instructions for recovering bricked D2s here:

http://www.iaudiophile.net/forums/showthread.php?t=17854
Title: Re: Cowon D2
Post by: shotofadds on November 24, 2007, 07:34:26 AM
Just to let you guys know, I'm still working away on the firmware disassembly, but it's slow progress.

From what I've identified so far, some areas (eg. timers/ADC controller/SDRAM controller/audio in-out) seem to be practically identical to the 76x datasheet, but using a different I/O base address. Things like the IRQ/FIQ controller are almost the same, with subtle differences (eg. IRQ numbers are different and what looks like a prioritisation mechanism).

Unfortunately I'm still some way off understanding the LCD controller, it seems quite different to the previous generation (76x).
Title: Re: Cowon D2
Post by: shotofadds on December 04, 2007, 11:02:28 AM
Some good news and some bad news...

The good news is that I think I've written enough rudimentary startup and LCD driver code to power on the screen, which should eventually allow a simple "Hello World" type program to run (compiled as a bootloader build).

The bad news is that I haven't tried it yet. I'm not 100% convinced that the D2's reset button is actually a hardware reset that can revert my player to the stock firmware. For instance, nothing at all happens if you press reset when the USB cable is connected. That said, it'd be a pretty stupid reset button if it needed software to drive it...

I guess I can always disconnect the battery internally, but I was hoping for something easier!
Title: Re: Cowon D2
Post by: man.dovvn on December 04, 2007, 11:55:54 AM
Awesome, so I take it you got the LCD controller working? Full functionality or limited?
Have you any idea how to get input from the touchscreen?
Title: Re: Cowon D2
Post by: shotofadds on December 04, 2007, 12:29:18 PM
All I've done is hack together some code that mimics the original firmware's LCD initialisation and power-on code, and added this to my local build tree so that the telechips.c bootloader test program will compile.

What this should do is allow us to write debug text to the screen - a huge help when trying to work out how the rest of the player works internally (eg. buttons, touchscreen).

That is, if I even get that far  ;)
Title: Re: Cowon D2
Post by: linuxstb on December 04, 2007, 12:33:11 PM
My Telechips player will always take power via USB - even if I remove the AA battery it runs on, it will boot if I insert the USB cable.  Maybe this is why the reset doesn't work when you're attached to USB.

If I was you, I would risk it - you won't be able to work on a Rockbox port if you don't have an easy way to reset, so you may as well find out now...

Nice work with the LCD - I hope it works!
Title: Re: Cowon D2
Post by: shotofadds on December 04, 2007, 02:12:24 PM
I took the plunge and uploaded some of my own code. Again, there is good news and bad...

Good: I can confirm that the reset button does work once the USB cable is disconnected, and I can confirm that I have had code running on the device (rather than being rejected by the boot ROM). Phew!

Bad: It doesn't switch the LCD on. Bah.

I know that at least some of the code did run, as I performed two tests:

1. I uploaded a correctly formatted firmware file containing nothing but an infinite loop. As expected, nothing happens whatsoever.

2. I uploaded my test program. Nothing happens, except that with this binary, pressing reset results in a bright white screen for a fraction of a second.

One possibility is that I did manage to enable the LCD controller, but haven't powered on the screen properly...
Title: Re: Cowon D2
Post by: man.dovvn on December 04, 2007, 03:25:45 PM
White screen - Could be the controller powering on or a break in power causing...well...the controller to power on. Is there documentation on the LCD controller hardware?
Title: Re: Cowon D2
Post by: shotofadds on December 04, 2007, 05:21:57 PM
It's pretty likely that the LCD panel physically has no power, so no matter what control instructions I send, it's not going to do much.

The D2 has the same power management chip as some of the other Rockbox targets (PCF50606), and there are a mountain of what I believe to be I2C writes in the original firmware - so I'll see if there's anything identifiable there. That, however, may take some time!

The LCD controller is part of the Telechips CPU so there is no public info - my code simply tries to mimic that in the original firmware. Documentation for the actual Samsung panel is linked from the wiki, but that is only half the story.

EDIT: Not sure how I missed them originally, but one of the first actions in the original firmware is to send a whole stream of commands to I2C address 0x10 - ie the PCF50606. I'll investigate and try doing something similar in a day or two...
Title: Re: Cowon D2
Post by: stephenp on December 07, 2007, 05:40:02 PM
Hi

Recently got one of these ...
some linux programming experience ..
what can I do to help with the porting effort?

Title: Re: Cowon D2
Post by: shotofadds on December 11, 2007, 09:22:24 AM
At the moment it's very much a case of trying to figure out, from a disassembly of the original firmware, how to use the hardware - eg. how it powers on the lcd and writes to the screen, how the buttons/touchscreen work etc. For that you need a decent disassembler, some knowledge of ARM code and an awful lot of time and patience.

Then once these basics are done, we need to figure out how everything else works - the flash filesystem, usb, audio, battery level/charging, coprocessor, radio etc etc will all need to be covered eventually. The Rockbox GUI will need adapting for touchscreen use (I think some work is underway on this for another port) and 24-bit colour is not currently supported (IIRC) - but I can see from the D2 firmware that the LCD can be driven in 16bpp mode for the time being.

What I would suggest is fetching a copy of the current Rockbox build (see http://www.rockbox.org/twiki/bin/view/Main/DocsIndex#For_Developers) and familiarising yourself with its structure.

When I have a bit of spare time, I'll do some more work on the LCD and try to get an extrememly basic "Hello World" type program running. This could then be used as a platform for debugging the buttons/touchscreen etc.  If/when I get to that point I'll submit an initial D2 patch to the Rockbox build, as linuxstb has done for the Logik DAX player.

Hope that hasn't scared you off....
Title: Re: Cowon D2
Post by: stephenp on December 11, 2007, 08:00:10 PM
Do you know where I could get a copy of the tcc7801 datasheet?
Thanks
Title: Re: Cowon D2
Post by: GodEater on December 12, 2007, 04:19:43 AM
Telechips choose not to make it publicly available I'm afraid.
Title: Re: Cowon D2
Post by: stephenp on December 13, 2007, 03:25:09 PM
Someone might have a copy they could privatey email me though
Title: Re: Cowon D2
Post by: AlexP on December 13, 2007, 08:58:24 PM
Then they would be breaking a NDA, and we could not use the resulting code.
Title: Re: Cowon D2
Post by: shotofadds on December 14, 2007, 04:50:13 PM
A little teaser:

(http://img143.imageshack.us/img143/4492/img4764ky8.th.jpg) (http://img143.imageshack.us/my.php?image=img4764ky8.jpg)

Amazing what a bit of reverse-engineering can do! Unfortunately this isn't working reliably yet, and I've only seen this once out of about 20 attempts with the current code - but I thought it was worth capturing ;D

(for the curious, the counter runs up at about 100 iterations a second - seems a bit slow, but I don't know how to control the CPU speed yet)
Title: Re: Cowon D2
Post by: GodEater on December 15, 2007, 04:49:11 PM
Congratulations :)
Title: Re: Cowon D2
Post by: man.dovvn on December 15, 2007, 05:14:08 PM
Congrats! It doesn't make sense that the code would work erratically, were you modifying the code each time?
Title: Re: Cowon D2
Post by: Bagder on December 15, 2007, 06:06:32 PM
Very very cool shotofadds!

Do consider to reveal some funky source code once you have something fairly reliable so that others can start poking on this as well!
Title: Re: Cowon D2
Post by: terrence1019 on December 15, 2007, 11:04:53 PM
So does shotofadds get promoted to level of a Rockbox Dev now?  ;D
Title: Re: Cowon D2
Post by: saratoga on December 15, 2007, 11:05:44 PM
So does shotofadds get promoted to level of a Rockbox Dev now?  ;D

That happens when your first patch gets accepted into SVN.
Title: Re: Cowon D2
Post by: terrence1019 on December 16, 2007, 11:30:28 AM
So does shotofadds get promoted to level of a Rockbox Dev now?  ;D

That happens when your first patch gets accepted into SVN.

Excellent! I'll be happy for him
Title: Re: Cowon D2
Post by: shotofadds on December 16, 2007, 12:11:53 PM
Heh, I need to make it work properly first ;)

There will of course be a patch submitted when I've had a chance to tidy up the code and hopefully figure out what's preventing the LCD from powering on 99% of the time. I can see that the code executes properly each time regardless, since the "Hello World!" and counter text do now flash up for a fraction of a second when the reset button is pressed.

The current code is equal proportions of black magic and trickery - probably fair to say it isn't quite SVN material just yet.
Title: Re: Cowon D2
Post by: GodEater on December 16, 2007, 02:28:46 PM
That happens when your first patch gets accepted into SVN.

Hasn't happened to me yet, and I've had a few accepted ;)
Title: Re: Cowon D2
Post by: saratoga on December 17, 2007, 02:18:22 PM
That happens when your first patch gets accepted into SVN.

Hasn't happened to me yet, and I've had a few accepted ;)

You probably have to complain to Llorean then.  He doesn't always notice.
Title: Re: Cowon D2
Post by: soap on December 17, 2007, 02:29:02 PM
Not to drag this more off topic - but isn't the "Developer" badge to signify commit access, while the "Coder" badge signifies code accepted into SVN?
Title: Re: Cowon D2
Post by: AlexP on December 17, 2007, 10:13:55 PM
Not to drag this more off topic - but isn't the "Developer" badge to signify commit access, while the "Coder" badge signifies code accepted into SVN?

I believe so, yes.
Title: Re: Cowon D2
Post by: linuxstb on December 18, 2007, 03:35:22 PM
Have you enabled the cache yet?  I had similar very slow speeds before enabling the cache on my Telechips port - and about a 15x increase in speed when it was enabled.

Maybe the unreliability you're experiencing are due to timing issues - maybe they will fix themselves if you clock the CPU the same way as the original firmware, and also enable the cache.
Title: Re: Cowon D2
Post by: shotofadds on December 18, 2007, 05:51:39 PM
You're more than likely correct. I've been looking at the OF again and the PCF50606 init sequence does happen after the cache has been enabled. Its I2C timing mechanism is a simple null loop, so I suspect my rudimentary attempt at mimicking it is quite some degree out with the cache turned off.

I think a problem with the LCD panel startup is less likely as I've set up a simple 1ms timer for those (timers on the 7801 look to be the same as 76x with a different base address). It should be fairly straightforward to verify the timer works, as I can see printf output when I press the reset button.

My biggest challenge is to find some free time over the Xmas period though...

EDIT: Enabling the cache makes a significant difference (at least 10x speedup), but I still can't make the LCD come on. More investigation required methinks.
Title: Re: Cowon D2
Post by: shotofadds on December 20, 2007, 04:34:14 AM
Problem solved - I was sending the wrong command to initialise the backlight. I'll get the code tidied up and submit an initial patch, though I doubt this will happen before 2008 :(

This provided some enlightenment (thanks Bagder for the pointer):
http://svn.openmoko.org/trunk/src/target/kernel/patches/gta01-pcf50606.patch
Title: Re: Cowon D2
Post by: sastraxi on January 02, 2008, 01:52:41 PM
shotofadds, if you're willing, I would love a copy of the register/interrupt address information you've already gathered from your D2 to help with the reverse-engineering process. I couldn't find this information on the wiki so I suppose you're pretty busy.
Title: Re: Cowon D2
Post by: shotofadds on January 02, 2008, 03:47:01 PM
I haven't added anything to the wiki yet, since those details will eventually be available by reading the source code. Having said that, I'm about to add a section describing some of the GPIO ports as I think that's best documented on the wiki. Check back soon, there should be some info for you to digest.

EDIT: I've spent the last hour or so doing a brain-dump into the wiki. Enjoy!
Title: Re: Cowon D2
Post by: sastraxi on January 03, 2008, 10:48:06 AM
That's amazingly helpful, thanks. However looks like I'm running into the time wall as well -- I'll see if I can't make this sucker output something in the form of sound in the next few weeks, though. Let us know when you submit the patch; I'd love to have a base to work on rather than doing the work you've already done over again!
Title: Re: Cowon D2
Post by: paradox on January 03, 2008, 11:34:20 AM
Hi,
do you think the Telechips docs and SDK could be useful?  ;D
They seems to be freely available on the web:  ::)
(here TCC77x, TCC78x and TCC82x, TCC76x on request...)

 TCC77X.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=7&file_url=/webupload/data_board&file_name=TCC77X.pdf)
 TCC7821_chipspec_r0.03.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=134&file_url=/webupload/data_board&file_name=TCC7821_chipspec_r0.03.pdf)
 TCC7801_chipspec_r0.03.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=127&file_url=/webupload/data_board&file_name=TCC7801_chipspec_r0.03.pdf)
 TCC7820_chipspec_r0.05.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=126&file_url=/webupload/data_board&file_name=TCC7820_chipspec_r0.05.pdf)
 TCC7821_chipspec_r0.01.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=125&file_url=/webupload/data_board&file_name=TCC7821_chipspec_r0.01.pdf)
 TCC7830_chipspec_r0.11.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=124&file_url=/webupload/data_board&file_name=TCC7830_chipspec_r0.11.pdf)
 TCC7831_chipspec_r0.03.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=123&file_url=/webupload/data_board&file_name=TCC7831_chipspec_r0.03.pdf)
 TCC780_DataSheet_r0.09.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=122&file_url=/webupload/data_board&file_name=TCC780_DataSheet_r0.09.pdf)
 TCC8200A specification r0.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=82&file_url=/webupload/data_board&file_name=TCC8200A%20specification%20r0.pdf)
 DMP77X_1800_Utility.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=715&file_url=/webupload/tech_board&file_name=DMP77X_1800_Utility.zip)
 DMP77X_1800_Manual.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=713&file_url=/webupload/tech_board&file_name=DMP77X_1800_Manual.zip)
 DMP77X_1800.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=711&file_url=/webupload/tech_board&file_name=DMP77X_1800.zip)
 TCC77x_PWS_ADS_V100.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=618&file_url=/webupload/tech_board&file_name=TCC77x_PWS_ADS_V100.zip)
 DMP77x_Audio_Codec_Manual_v1.2.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=596&file_url=/webupload/tech_board&file_name=DMP77x_Audio_Codec_Manual_v1.2.zip)
 TC-TCCxxx-ALL-AG-1000-1.00-ADS Compiler Patch Guide_Eng.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=422&file_url=/webupload/tech_board&file_name=TC-TCCxxx-ALL-AG-1000-1.00-ADS%20Compiler%20Patch%20Guide_Eng.pdf)
 DMP77x_1200 DAB patch V0.01.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=331&file_url=/webupload/tech_board&file_name=DMP77x_1200%20DAB%20patch%20V0.01.zip)
 DMP77x_DAB_API_manual_r0.01.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=328&file_url=/webupload/tech_board&file_name=DMP77x_DAB_API_manual_r0.01.pdf)
 DAB_1027_patch.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=297&file_url=/webupload/tech_board&file_name=DAB_1027_patch.zip)
 DAB.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=223&file_url=/webupload/tech_board&file_name=DAB.zip)
 TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=695&file_url=/webupload/tech_board&file_name=TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf)
 TCC78XX SUB Board.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=694&file_url=/webupload/tech_board&file_name=TCC78XX%20SUB%20Board.zip)
 TCC7820_30 Mobile.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=693&file_url=/webupload/tech_board&file_name=TCC7820_30%20Mobile.zip)
 TCC78xx_MultiMedia_Application_SDK_v044_release.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=626&file_url=/webupload/tech_board&file_name=TCC78xx_MultiMedia_Application_SDK_v044_release.zip)
 Mobile Manual.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=452&file_url=/webupload/tech_board&file_name=Mobile%20Manual.zip)
 TCC7820-7830 Hardware Data files.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=270&file_url=/webupload/tech_board&file_name=TCC7820-7830%20Hardware%20Data%20files.zip)
 readme.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=871&file_url=/webupload/tech_board&file_name=readme.zip)
 MAP78X_NUCLEUS008_NFS059_V0709281579.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=870&file_url=/webupload/tech_board&file_name=MAP78X_NUCLEUS008_NFS059_V0709281579.zip)
 TCC78xx_DMP_PortableManual.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=869&file_url=/webupload/tech_board&file_name=TCC78xx_DMP_PortableManual.zip)
 SDK_Before02.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=868&file_url=/webupload/tech_board&file_name=SDK_Before02.zip)
 SDK_Before01.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=788&file_url=/webupload/tech_board&file_name=SDK_Before01.zip)
 TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=695&file_url=/webupload/tech_board&file_name=TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf)
 TCC78XX SUB Board.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=694&file_url=/webupload/tech_board&file_name=TCC78XX%20SUB%20Board.zip)
 TCC7801 Portable.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=692&file_url=/webupload/tech_board&file_name=TCC7801%20Portable.zip)
 SDK_Before.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=446&file_url=/webupload/tech_board&file_name=SDK_Before.zip)
 TCC7801 Hardware Data files.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=269&file_url=/webupload/tech_board&file_name=TCC7801%20Hardware%20Data%20files.zip)
 TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=695&file_url=/webupload/tech_board&file_name=TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf)
 TCC78XX SUB Board.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=694&file_url=/webupload/tech_board&file_name=TCC78XX%20SUB%20Board.zip)
 readme.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=914&file_url=/webupload/tech_board&file_name=readme.zip)
 DMP78X_NUCLEUS009_NFS064_V071130641.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=913&file_url=/webupload/tech_board&file_name=DMP78X_NUCLEUS009_NFS064_V071130641.zip)
 TCC78xx_DMP_PortableManual_DMP641.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=912&file_url=/webupload/tech_board&file_name=TCC78xx_DMP_PortableManual_DMP641.zip)
 DMP_SDK_Before_02.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=911&file_url=/webupload/tech_board&file_name=DMP_SDK_Before_02.zip)
 DMP_SDK_Before_01.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=910&file_url=/webupload/tech_board&file_name=DMP_SDK_Before_01.zip)
 TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=695&file_url=/webupload/tech_board&file_name=TCC78XX_4CS_NANDBoot_HW_AN_8723_V0.10_ENG.pdf)
 TCC78XX SUB Board.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=694&file_url=/webupload/tech_board&file_name=TCC78XX%20SUB%20Board.zip)
 TC-TCC82x-DMP-AM-1000-1.00-TCO(PWM) Errata.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=918&file_url=/webupload/tech_board&file_name=TC-TCC82x-DMP-AM-1000-1.00-TCO%28PWM%29%20Errata.pdf)
 DMP82X_2200.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=854&file_url=/webupload/tech_board&file_name=DMP82X_2200.zip)
 DMP82x_DOC_v2200.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=852&file_url=/webupload/tech_board&file_name=DMP82x_DOC_v2200.zip)
 TCC82x_PWS_ADS_V100.a  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=619&file_url=/webupload/tech_board&file_name=TCC82x_PWS_ADS_V100.a)
 TCC8200_DEMO_DED_AM_2715_V0.13_ENG.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=553&file_url=/webupload/tech_board&file_name=TCC8200_DEMO_DED_AM_2715_V0.13_ENG.pdf)
 TCC8200_DEMO_DED_V0.13.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=552&file_url=/webupload/tech_board&file_name=TCC8200_DEMO_DED_V0.13.zip)
 TC-TCCxxx-ALL-AG-1000-1.00-ADS Compiler Patch Guide_Eng.pdf  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=421&file_url=/webupload/tech_board&file_name=TC-TCCxxx-ALL-AG-1000-1.00-ADS%20Compiler%20Patch%20Guide_Eng.pdf)
 TCC8200_DEMO_DED_V0.12_SCH.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=416&file_url=/webupload/tech_board&file_name=TCC8200_DEMO_DED_V0.12_SCH.zip)
 TCC8200_πË∆˜øÎ_PDF.zip  (http://www.telechips.com/kor/inc/download3.asp?file_gbn=D&board_id=415&file_url=/webupload/tech_board&file_name=TCC8200_%B9%E8%C6%F7%BF%EB_PDF.zip)

Happy new year and happy hacking!
Looking forward to have Rockbox on the D2 soon :)
--
Security through obscurity is a great idea
Title: Re: Cowon D2
Post by: LambdaCalculus on January 03, 2008, 11:37:34 AM
Holy crap, paradox... that's a mountain of information!

Can you post all of that to the wiki (http://www.rockbox.org/twiki/bin/view/Main/WebHome?topic=TelechipsInfo) so it won't get lost, please?
Title: Re: Cowon D2
Post by: paradox on January 03, 2008, 11:46:07 AM
Sure, but I need a wiki account first...
Is there some webspace where we could mirror those files?
We certainly don't want to slashdot their website?

Title: Re: Cowon D2
Post by: LambdaCalculus on January 03, 2008, 11:48:45 AM
You can set up a temporary FTP account and host them there.

Actually, don't post them to the wiki... legal reasons, you see.
Title: Re: Cowon D2
Post by: shotofadds on January 03, 2008, 12:04:49 PM
I suspect these links will stop working very shortly if/when Telechips catch wind of the leak. If you're going to risk uploading them you'd be better using something like rapidshare or yousendit rather than here.

Given that these docs are currently available in the clear from Telechips' own website (albeit unintentionally by the looks of it) - does that mean were are technically 'allowed' to use them?

EDIT: sastraxi, if you wish I'll make you an initial patch to get you started. At this stage it's nowhere near ready for SVN - there's a lot of hackiness and issues to be worked out - but it'll give you a good solid starting point.
Title: Re: Cowon D2
Post by: paradox on January 03, 2008, 12:12:06 PM
Actually, what's the legal situation here?
Many relevant files don't contain any legal disclaimer (e.g, the TCC7801 specs)
others state "No part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of Telechips, Inc. "

It should be legal to at least post the links, shouldn't it?
Title: Re: Cowon D2
Post by: saratoga on January 03, 2008, 07:03:14 PM
If they're publicly distributing the documents with no license, then its generally assumed you are allowed to read them and produce code based on the information in them.  If they're distributing them with a license, then you must not do things prohibited by the license.  
Title: Re: Cowon D2
Post by: Llorean on January 03, 2008, 07:04:53 PM
The important thing about copyright though, is "no license published means all copyright rights reserved." That means we cannot copy them into the wiki or redistribute them ourselves.
Title: Re: Cowon D2
Post by: shotofadds on January 03, 2008, 07:19:06 PM
Ugh, my haste in playing with SVN to create a patch has resulted in a horribly broken build (ie. it builds but no worky!). I have backups but it's going to take some time to figure out what went wrong :(

EDIT: I restored the contents of firmware/* and it makes no difference. I still get a rockbox.iaudio that's 200 bytes larger than my old build and still does not work... very odd, will have to investigate later.
Title: Re: Cowon D2
Post by: shotofadds on January 05, 2008, 05:04:31 PM
A first attempt at a patch for the D2 is at FS#8420 (http://www.rockbox.org/tracker/task/8420) (thanks, saratoga). Once applied, configure should list a new target (33: Cowon D2) and its bootloader build should generate a rockbox.iaudio file suitable for uploading with tcctool. This consists of a simple test program with basic LCD, button and I2C drivers. Happy hacking!

EDIT: changed link to Flyspray.
Title: Re: Cowon D2 (how to proceed with patch
Post by: jarivk on January 09, 2008, 09:56:38 AM
Hi,
I have some doubts.
please bare with my lack of knowledge.
How to proceed with the patch provided?
I mean how to build? which tool chain? from where?

Also i tried tcctool with my D2. I used a .bin file (2.50) with some theme for testing.  Tcctool says application patched successfully. after that i had expected it to boot automatically or something..but nothing happened. Can somebody guide me?
Title: Re: Cowon D2
Post by: saratoga on January 09, 2008, 10:29:11 AM
http://www.rockbox.org/twiki/bin/view/Main/DocsIndex#For_Developers

Specifically the " First Time Guide to Rockbox Development" and "Working With Patches" page.
Title: Re: Cowon D2
Post by: shotofadds on January 09, 2008, 10:47:23 AM
Regarding tcctool, if it reported that the upload was successful, the .bin should execute automatically. For example, I if I upload the "d2.bin" (or "d2N.bin") from the '1' folder of a firmware download from Cowon, the D2 will boot into that firmware straight away.

(..but for safety, try to make sure the firmware version you upload is the same as the version present on your player)

Also, regarding the patch - it is necessary to apply the bugfix mentioned in comment #3 of the flyspray entry otherwise the compiled image will noot boot the player. I will upload a new patch later today.

EDIT: You're not trying to upload a d2_rs.bin or d2_font.bin, are you? That won't work since those are resource (graphics) files. Tcctool should only be used to upload executable firmware code.
Title: Re: Cowon D2
Post by: luck3r on January 09, 2008, 06:25:33 PM
Great, I can't wait until Rockbox is working on this player!

Here's a picture of what the test program displays, for those who can't compile it or don't want to:
(http://www.abload.de/thumb/p101000548u.jpg) (http://www.abload.de/image.php?img=p101000548u.jpg)

Keep up the good work!
Title: Re: Cowon D2
Post by: shotofadds on January 09, 2008, 06:52:20 PM
Excellent, it's good to see that it works on another D2 besides my own :)

btw. Which version of the D2 do you have? Mine is a 4Gb DAB, though I suspect the only hardware difference we really need to worry about at the moment is the 2/4/8Gb flash.

At the moment I'm concentrating on making stubs for various drivers, to allow compilation of a 'Normal' (not bootloader) build. There's a bit more work to do on this, then I hope to commit an initial revision in SVN to allow others to work on it. Also I've got the dual-boot function (mktccboot) working properly now as well.

I think the next major hurdle is the flash driver...  :o
Title: Re: Cowon D2
Post by: luck3r on January 09, 2008, 06:59:06 PM
I've got a European D2 4GB. No DAB stuff.
I noticed something with GPIOB:
After starting the test app, GPIOB is 0x3DE6000<2 or 6 if a button is pressed>. As soon as the screen is touched, it changes to 1DE6000<2/6>, the 1 doesn't change anymore. Is this useful information? Maybe something like a "Cursor position" being set at another position? I really don't have a clue of programming...

Edit: I think there's only a difference between the 2/4G versions and the 8G version regarding the flash memory, I just barely remember some guy's post about having firmware issues with the 8G version on iaudiophile.net forums.
Title: Re: Cowon D2
Post by: g00ey on January 09, 2008, 08:18:51 PM
Thanks for the telechips documentation paradox!
By the way; the following links are broken:

board_id=914: readme.zip
board_id=913: DMP78X_NUCLEUS009_NFS064_V071130641.zip
board_id=912: TCC78xx_DMP_PortableManual_DMP641.zip
board_id=911: DMP_SDK_Before_02.zip

Title: Re: Cowon D2
Post by: shotofadds on January 10, 2008, 04:29:55 AM
As soon as the screen is touched, it changes to 1DE6000<2/6>, the 1 doesn't change anymore. Is this useful information?
Yep that is useful, I hadn't spotted that yet.  I know how to read the touchscreen (via the PCF50606 I2C interface) but haven't implemented anything yet. The GPIOB bit is most likely signalling that an interrupt from the PCF chip is waiting to be read (ie. the touchscreen press event).

Great, I can't wait until Rockbox is working on this player!
Do remember that even if/when a full port happens, it might not be very usable - remember the Rockbox UI is not designed for a touchscreen (yet) so will be restricted to the -/M/+ buttons and the power switch for the time being...
Title: Re: Cowon D2
Post by: n0tHl33t on January 10, 2008, 09:24:58 AM
Do remember that even if/when a full port happens, it might not be very usable - remember the Rockbox UI is not designed for a touchscreen (yet) so will be restricted to the -/M/+ buttons and the power switch for the time being...

I am no real coder but I think that the new viewports-system would be a much better basement for touchscreen-use than the actual wps-system. but this is only only my unqualificated opinion and i know that viewports is also far away from being useable.

But maybe there is the possibility to use the Hold-Switch as a modificator and you could use the touchscreen as one big button.

For example:

Hold Switch off:

+/- = Volume (Playback-Screen) / menunavigation (Menu)
M (short button press) = Switch to Filescreen (Playback-Screen) / Select (Filescreen and menu)
M (long button press) = Switch to menu-screen (Playback-Screen) / Playlistoptions (Filescreen)
Touchscreen = Just touch anywhere on the screen to Play/Pause

Hold Switch on:
+/- (short button press) = Next/previous Track
+/- (long button press) = FFW/RW
M (short button press) = Play/Pause
Tochscreen = not used

And one idea: It is only an idea and I dont know if it is realistic but it would be worth to think of to turn the whole thing 90° for usage.

I am really thankfull for your work, shotofadds. I don´t know if it really helps but i will test your patch on my 8GB D2-non-DAB when it comes back from repair. And do you have a paypal-account? I would be willing to donate you for your work so far (not much as i don´t have much by myself but enough for a beer.  ;D).

Cheers

n0tH
Title: Re: Cowon D2
Post by: luck3r on January 10, 2008, 01:30:22 PM
Or do something like gestures.
Tap the screen = Play/Pause/Select item (at tapped position, if possible)
Move Stylus from left to right = Skip forward
Move Stylus from left to right and hold it there = FF
Move Stylus from right to left = Skip backwards
Move Stylus from right to left and hold it there = REW
And move up and down for menu navigation
So I think the touch screen could be used like 4 arrow keys, this would also make doom playable.
The buttons can be used like n0tH suggested.

I must say I only used Rockbox with the Cowon X5 simulator, so I don't know whats possible and whats not.
Title: Re: Cowon D2
Post by: Llorean on January 10, 2008, 01:34:57 PM
For me, I've always thought that if you wanted to divide the thouchscreen, rather than requiring movement of the stylus, you could just divide it into virtual "buttons".

Basically, take the whole rectangle of the screen, and cut two diagonal lines across it (from corner to corner). You get four triangles, these are the up, down, left, and right buttons. Basically, as long as your stylus is at the edge of the screen you're going left/right/up/down. Then, in the center there's a rectangle 1/4 the size of the total screen (so, it's half the screen width and half the screen height) that serves as the select or Play/Pause button depending on
A) which is more suitable
and
B) Which is more appropriate for a physical button (based on labeling of the physical buttons).

Generally, to me I prefer "Select" since this is still a "Navigation" function, which is what touchscreens are for.
Title: Re: Cowon D2
Post by: luck3r on January 10, 2008, 03:54:13 PM
This is good, too.
"Select" is the best choice in my opinion, on stock firmware I always use the M button as play/pause, even if I have to use the hold switch to do that.
Title: Re: Cowon D2
Post by: shotofadds on January 11, 2008, 07:33:20 PM
Yes, I think Llorean's suggestion is very workable (Select in the centre seems most logical) and in fact it's similar to the way cursor keys are implemented in the D2's Flash Player. Certainly it'll be useful for menu/plugin navigation, as I can't see Rockbox having a fully touchscreen-aware UI for quite some time.

The OF also has a nice feature where the +/- buttons can be enabled while the hold switch is on, which can be set to either skip tracks or change volume. On paper it sounds like a bad idea but is actually really useful when using the D2 in a pocket, etc. I think we should try to implement something similar (eventually).

I am really thankfull for your work, shotofadds. I don´t know if it really helps but i will test your patch on my 8GB D2-non-DAB when it comes back from repair. And do you have a paypal-account? I would be willing to donate you for your work so far (not much as i don´t have much by myself but enough for a beer.  ;D).
Thankyou for your kind offer, but I'm doing this for fun, not profit - if you want to donate you can use the Paypal button on the Rockbox homepage, which I'm sure will go towards a worthy cause like server hosting for the project, etc.

I'm off to do some more disassembly to work out how to read the flash drive. I may be some time :-\
Title: Re: Cowon D2
Post by: jarivk on January 20, 2008, 08:28:40 AM
I had a problem in using tcctool. I tried loading file D2N_rs.bin using tool.
It says application patched successfully but D2 doesnt boot up. I had asked this before also. I am using 2.50 firmware 4GB model. I tried removing SD card too. What can be the problem??
Title: Re: Cowon D2
Post by: shotofadds on January 20, 2008, 09:37:27 AM
jarivk, I answered this question in your previous post:

You're not trying to upload a d2_rs.bin or d2_font.bin, are you? That won't work since those are resource (graphics) files. Tcctool should only be used to upload executable firmware code.
If you're trying to apply a modified theme, just put the D2_rs.bin (or D2N_rs.bin) onto the player's root folder, then unplug and restart the player. It'll apply the changes itself.
Title: Re: Cowon D2
Post by: jarivk on January 20, 2008, 09:43:44 AM
Ok... I had a confusion :(. I thought I can load the theme using tcctool and see without actually putting it on to the player. thanks for ur explanation. No problem now  :)
Title: Re: Cowon D2
Post by: Llorean on January 20, 2008, 01:01:53 PM
Please don't use our forums for support relating to simply modifying themes.

This thread should be about, and only about, getting Rockbox developed for the target.
Title: Re: Cowon D2
Post by: n0tHl33t on January 20, 2008, 03:43:00 PM
Sorry but i am so curious. Is there any further development, shotofadds?

By the way... Why don´t you inform the Iaudiophile-Community about your ongoing effort to port rockbox to the D2? Maybe you would find some developers that own a d2 too. Or do you fear forum-kiddies that scream "When-will-it-be-ready-why-isnt-it-ready-is-it-dead-i-want-my-d2-with-gps-and-a-gravity-beam-feature-please"  ;)

Whatever... Cheers

n0tH
Title: Re: Cowon D2
Post by: shotofadds on January 20, 2008, 05:03:48 PM
Or do you fear forum-kiddies that scream "When-will-it-be-ready-why-isnt-it-ready-is-it-dead-i-want-my-d2-with-gps-and-a-gravity-beam-feature-please"
You said it, this forum thread is long enough already...

As for progress, the test program is now committed to the main Rockbox SVN, with some updates to display raw data from the touchscreen. I'm currently working on reading from the flash memory, which is going to take some time to get right. Don't worry about the lack of updates, I'm on the case 8-)

ps. Did you say you had an 8Gb D2? Would you mind running a quick test program to report some values back so I can compare them against my 4Gb? Cheers.
Title: Re: Cowon D2
Post by: Bagder on January 20, 2008, 05:46:52 PM
By the way... Why don´t you inform the Iaudiophile-Community about your ongoing effort to port rockbox to the D2?

I think it's a job for all of us to spread the word to whoever we think should get it and to try to invite more people to work on Rockbox development in general, but on the ongoing ports of course in particular!
Title: Re: Cowon D2
Post by: n0tHl33t on January 21, 2008, 07:00:09 AM
ps. Did you say you had an 8Gb D2? Would you mind running a quick test program to report some values back so I can compare them against my 4Gb? Cheers.

As I also said my D2 is send in for repair as it had an adventure in the dishwasher (yes. dishwasher. dont ask...) but i will test it as promised when its back.

Cheers

n0tH
Title: Re: Cowon D2
Post by: andiator on January 21, 2008, 03:45:07 PM
I have 8GB version too, what values do you need? Is it from rockbox.iaudio file?

Besides, I'm trying to get the simulator for d2 working, man, there are a lot of button defines there. At least one per plugin and there are lots of plugins.
Anyway, I can compile that now, but it's still not working properly.
Title: Re: Cowon D2
Post by: shotofadds on January 22, 2008, 05:40:16 AM
Besides, I'm trying to get the simulator for d2 working, man, there are a lot of button defines there. At least one per plugin and there are lots of plugins.
Are you basing your work on the Flyspray patch (now closed) or a current Rockbox SVN? I'm sure I disabled plugin building before committing the code, so I wouldn't have thought you had to change all those plugin button defines (yet).

Note if you're using the patch: in SVN the button names have been altered to BUTTON_MINUS, BUTTON_MENU and BUTTON_PLUS so that they better reflect the physical layout. I'm intending to use BUTTON_LEFT/RIGHT/UP/DOWN to implement Llorean's suggestion for basic touchscreen navigation (see previous discussion in this thread).

Quote
I have 8GB version too, what values do you need? Is it from rockbox.iaudio file?
I'd like to check the ID codes from the NAND flash chips. The 4Gb D2 uses 2 banks of SAMSUNG K9LAG08U0M - I want to check if the 8Gb version uses 4 banks of the same (using an additional chip select line), or if it is something different entirely.

I'll post some code to read these values later today/tomorrow.
Title: Re: Cowon D2
Post by: andiator on January 22, 2008, 08:02:42 AM
I didn't use any patches, the svn version is from yesterday an the buttons are up/down/left/right/select


I did look in ../tools/configure, it says plugins="no". I choosed target=33 and type = s for simulator and ALL plugins are compiled. Not shure if it is the same with the normal build.
But anyway, as far as I know, the sim is only for button mappings and wps tests.
Title: Re: Cowon D2
Post by: shotofadds on January 22, 2008, 06:41:48 PM
The D2 sim build is now available in SVN - there's no plugins yet, but these can eventually be added one at a time by tweaking the apps/plugin/SOURCES and apps/plugin/SUBDIRS files.

andiator: I'll post another update to read from the flash tomorrow.
Title: Re: Cowon D2
Post by: terrence1019 on January 24, 2008, 04:29:54 PM
Congratulations on becoming a Rockbox Developer, shotofadds  8-)
Title: Re: Cowon D2
Post by: Yeeze on January 24, 2008, 05:48:57 PM
Wow really nice progress!!

I got a 2GB D2 model, bought in USA!

The '?' in the output indicates changing numbers xD
Output:
GPIOA: 0xF7FF0?DF
GPIOB: 0x1DE60002
GPIOC: 0x3B000???
GPIOD: 0x07070000
GPIOE: 0x0FFFFFFF
ADC0: 0x03F <-- The F changes sometimes (1 - 5 times per second) randomly to E
ADC1: 0x027E
ADC2: 0x0341
ADC3: 0x0319


I think this are all the important values. I hope I could help you!

Keep the good work UP!
Title: Re: Cowon D2
Post by: shotofadds on January 25, 2008, 05:09:43 PM
Yeeze / andiator: the latest version of the code in SVN will print out some diagnostics from the D2's flash chips. If you're willing to, could you run this on your D2 and report back some information? I can supply a pre-built binary if you don't have the build environment set up currently.

Four blocks of information should be displayed (NAND banks 0 to 4). Each consits of an ID code (5 hex bytes) and a block of 8 hex words. What is the ID code displayed (are they all the same?). Are the larger blocks of data the same for each bank, or all different? (nb: I don't need to know the numbers for the larger blocks of data, just whether the four banks differ).

After this information is displayed, each key press will scan the memory for the word "TAG" - so it should eventually display some readable song names, in amongst some other junk data. Let me know if this does not display anything readable after a few presses.

Thanks in advance....  ;)

(ps. I should state that I take no responsibility if anything unexpected happens to your player, however I've been running this on my own 4Gb D2 for some time with no ill effects. The D2 is my main day-to-day player so I would have noticed anything wrong by now!)

Yeeze: I /think/ at first glance these are the same values my player reports - thanks for the confirmation! nb: ADC0 represents button presses, and I believe ADC1 is a representation of the battery voltage, though this does not seem to update.
Title: Re: Cowon D2
Post by: andiator on January 25, 2008, 05:29:44 PM
NAND bank 0:
ID: 0xEC 0xD7 0x55 0xB6 0x78
0x5FD600EC 0x3531DE74 0x33323822 0x070A1717
0xA029FF13 0xCACE218B 0xCCCDC7CD 0xF8F5E8E8

NAND bank 1:
ID: 0xEC 0xD7 0x55 0xB6 0x78
0xB80600EC 0x32316BBA 0x35313731 0x070A1818
0x47F9FF13 0xCDCE9445 0xCACEC8CE 0xF8F5E7E7

NAND bank 2:
ID: 0xEC 0xD7 0x55 0xB6 0x78
0x5FD600EC 0x3531DE74 0x33323832 0x070A1717
0xA029FF13 0xCACE218B 0xCCCDC7CD 0xF8F5E8E8

NAND bank 3:
ID: 0xEC 0xD7 0x55 0xB6 0x78
0xB80600EC 0x32316BBA 0x0x35313731 0x070A1818
0x47F9FF13 0xCDCE9445 0xCACEC8CE 0xF8F5E7E7

I hope, I did not do any mistakes, but it seems like the banks 0/1 are the same as 2/3

Pressing a button counts some MB's and shows some stuff. Seems like ID3-tag content.

Cheers,
      Andy
Title: Re: Cowon D2
Post by: shotofadds on January 25, 2008, 06:43:56 PM
Thanks, that's very helpful. The ID codes show that:

a) the 8Gb D2 is comprised of 2 banks of 4Gb flash (since 2/3 are replicated), rather than the 4 banks of 2Gb I was half expecting.

b) but we know the reading code still partially works, since you managed to display some tag information.

The ID codes suggest the 8Gb contains 2x SAMSUNG K9LBG08UOM, which at first glance seems to have the same characterstics as mine except each page is 4Kb in size rather than 2Kb. I'll update the wiki with this information later.

More reports from other D2s are welcome... but please PM them to me to avoid cluttering the forum, thanks.
Title: Re: Cowon D2
Post by: linuxstb on January 26, 2008, 05:24:46 AM
Nice work on getting the NAND working - I'm looking forward to having the time to try porting your code to the TCC77x.

Regarding the block translation, have you looked at the NAND driver for the iFP7xx port?  IIUC, this does something similar, so may be of help/inspiration.  It's in firmware/drivers/ata_flash.c
Title: Re: Cowon D2
Post by: shotofadds on January 26, 2008, 06:49:04 AM
I've looked at the iFP7xx code briefly, but not in much detail yet. My task for the next week is to establish how the OF block translation works, so I don't yet know how similar it may turn out to be.

I also need to update the existing code to detect the different chips used in the 2/4/8Gb models and adjust for the different page sizes, but that should be fairly trivial.
Title: Re: Cowon D2
Post by: Voluspa on January 27, 2008, 08:16:55 AM
More reports from other D2s are welcome... but please PM them to me to avoid cluttering the forum, thanks.

I'm not allowed to PM (too new a user?) but my test confirms andiator's. On a European 8Gb player - Sweden, bought last week, came with 2.51 FW - bank 0 is mirrored on bank 2 and bank 1 on bank 3. The NAND IDs are the same as andiator's as well.

Pressing a button while running rockbox/build/bootloader/bootloader.bin started a memory count (check ?) during which I could make coffee ;-) After ca 10 minutes - the count stopped at 2Gb or so - some dumps were showed when pressing buttons. Then came the "Helo world" screen.

A note regarding tcctool:

I'm always using fresh kernels in linux but tcctool relies on an old technique being present.  So to make it work one has to compile the kernel with this checked:

Device Drivers ->
Title: Re: Cowon D2
Post by: Yeeze on January 27, 2008, 04:52:24 PM
I looked through the I2c code, that is used to receive input from the touchscreen, and noticed that it only receives the x and y position of the "cursor", my question is, is it possible to receive an array of  all actually touched spots on the screen?
Because when I for example touch the screen with two fingers, the position of the "cursor" is in between the two spots I touched...
It would be very convenient, but my guess is it will be very time consuming... But if it is possible it would be nice... Does anybody know?
Title: Re: Cowon D2
Post by: andiator on January 27, 2008, 05:17:48 PM
It seems like D2's touchpanel and PCF50606 are not multitouch able. That's a hardware issue and there is no workaround. The only thing working are the gestures.
Title: Re: Cowon D2
Post by: Yeeze on January 27, 2008, 05:57:36 PM
Would have been nice, but I can live without multi touch...
Title: Re: Cowon D2
Post by: shotofadds on January 27, 2008, 06:40:06 PM
It's only possible to receive the X/Y coordinates and an indication of the size of the area touched (this can be calculated from the P1 and P2 values, somehow). With this information, could "multi touch" be simulated by testing whether the area touched grows or shrinks?

It's a thought for the future, anyway. I personally don't intend to do much with the touchscreen for the moment (priorities are getting the filesystem working, booting the Rockbox menu, and then sound).

On a European 8Gb player - Sweden, bought last week, came with 2.51 FW - bank 0 is mirrored on bank 2 and bank 1 on bank 3. The NAND IDs are the same as andiator's as well.
Thanks for that - I've updated the code in SVN now to detect the various combinations. Could you check it displays "2 banks * 1048576 pages * 4096 bytes" for the 8Gb player and "1 banks * 1048576 pages * 2048 bytes" for the 2Gb?

I'm always using fresh kernels in linux but tcctool relies on an old technique being present.
I avoided the issue completely by building tcctool on Windows XP - I realise that doesn't help you...
Title: Re: Cowon D2
Post by: Voluspa on January 27, 2008, 08:44:57 PM
Thanks for that - I've updated the code in SVN now to detect the various combinations. Could you check it displays "2 banks * 1048576 pages * 4096 bytes" for the 8Gb player and "1 banks * 1048576 pages * 2048 bytes" for the 2Gb?

Confirmation from me on the 8Gb player that it's detected correctly as stated by the above figures (this time I used the rockbox.iaudio file). And I still have time to brew some coffee while it counts memory. After 10 minutes it's at 2.4Gb... Should I walk the dog while it goes to 8 .-) No way to cancel the count, it seems.

/Mats
Title: Re: Cowon D2
Post by: andiator on January 28, 2008, 07:38:51 AM
2 banks, * 1048576 pages, * 4096 bytes per page for 8GB model

Multitouch... yes, I didn't see the plate resistance stuff, so it may be possible to have two finger gestures. But it's a long way to get a good and native support for touchscreens in rockbox. At first let's simulate some buttons. I've found a good description for touchscreen interface under http://www.atmel.com/dyn/resources/prod_documents/doc8091.pdf.

@shotofadds
In open moko project I've found some source code for PCF50606 except touchscreen handling. The first one is a patch file with battery/rtc stuff in it. The second one simulates PCF50606 for qemu. I can pm them if you want.
And besides, can we (the others) somehow help? I'm a software developer so I can code. Is there anything that can be done without deep D2-hardware knowledge?
Title: Re: Cowon D2
Post by: Bagder on January 28, 2008, 09:42:54 AM
Quote
In open moko project I've found some source code for PCF50606

Right and there's also existing Rockbox code for it...
Title: Re: Cowon D2
Post by: Yeeze on January 30, 2008, 05:57:58 PM
My problem: When I compile the bootloader for the D2, and then start the device using tcctool and the newly compiled bootloader, it still runs old code.
For example I add a printf ("test"); to the code, and compile it upload it to the D2 it won't print this line...
I checked the newly compiled bootloader file, it has a different size than the old one that did not have the additional printf ("test");

I tried a make clean, svn update, svn revert, deleting the whole rockbox folder and re downloading the source. Nothing helped.

This was not always the case, I used to be able to make changes compile them and the code worked on the player...
Now the code does only seem to change when I do very sensitive changes like adding a return in the main function...

I don't know where my problem is, but my thoughts are:
 - somehow I am compiling an old version of my code
 - an old bootloader file is uploaded on my player
 - an old version of the bootloader file is run on my player for some reason

Has anybody had a similar problem or has any idea what my problem is?
Title: Re: Cowon D2
Post by: zivan56 on January 30, 2008, 06:09:55 PM
IIRC lcd_update() needs to be called to update the screen.
Title: Re: Cowon D2
Post by: Yeeze on January 30, 2008, 06:21:29 PM
thanks zivan56, but with printf that was only an example, another example I commented out the nand_test () (in ata_init() file: "ata-nand-tcc780x.c") function call, to skip the scanning of the complete flash. Compiled the whole thing uploaded it. But it would still scan the flash...
Title: Re: Cowon D2
Post by: shotofadds on January 30, 2008, 06:37:38 PM
IIRC lcd_update() needs to be called to update the screen.
That won't be the problem - the D2 lcd driver is currently implemented in a slightly hacky manner (the frame buffer is directly read by the hardware, with no copying) so this call isn't necessary at the moment.

Yeeze, I've had a similar problem once or twice - in my case I think this was because I compile under VMware and run tcctool from WinXP (don't ask why :-\) and for some reason WinXP was still picking up an old version of the file from Samba. I haven't seen that problem for a while, though - and your situation might be entirely different of course.

I'm assuming that the compile had no errors, and that the timestamp on the new file has actually been updated?
Title: Re: Cowon D2
Post by: Yeeze on January 30, 2008, 06:51:58 PM
Yes the time stamp updated and the file also changed in size...

I am compiling under ubuntu (7.04) and uploading the file with WinXP emulated with VirtualBox...
I know its complicated, but it works, at least somehow...

I will try to upload the file under a real windows xp...
Title: Re: Cowon D2
Post by: Yeeze on January 30, 2008, 07:44:45 PM
Ok the virtual machine seems to be the problem, in the real windows it worked like a charm... But testing stuff will take really long when you need to reboot every time...

well I will find another way getting tcctool to work under linux...

Under windows I failed, tried cygwin and coLinux...

One question about the input from the touchscreen, what has been done to these values exactly (are they alredy put together out of three measurment's as stated in this document?
http://www.atmel.com/dyn/resources/prod_documents/doc8091.pdf.
What calculations are still needed? I just like to play a little with the touchscreen,
and maybe eventually write a useful driver to get easy to use values (absolute X/Y coordinates)
In telechips.c it said the touchscreen driver cannot be put on a tick task... what is that? Should there be a thread?
Is there something like an API for the I2c code or somewhat to get more information about it?
Title: Re: Cowon D2
Post by: luck3r on January 31, 2008, 04:41:44 AM
Yeeze: tcctool works perfectly on openSUSE and Gentoo with default configuration. I know that Debian based distributions tend to be quite "outdated" or having a strange configuration, so I would recommend you trying another distro. (Yes, I dont like *buntu)
If you want an easy configuration and the system should just work out of the box, try openSUSE.
If you want maximum flexibility and configurability, try Gentoo.
I don't want you to use these, it's just a suggestion.
Title: Re: Cowon D2
Post by: Bagder on January 31, 2008, 04:58:06 AM
I know that Debian based distributions tend to be quite "outdated" or having a strange configuration.

Please. That's your opinion and you will find that a large portion of us Rockbox hackers use Debian or Debian-based distros without sharing your views on them. Debian (unstable) is not more outdated than any other distro really, they all tend to be forward and not so forward on various different aspects over time.

Blaming any of this problem on Debian is barking up the entirely wrong tree.

Now, back to cowon D2 and tcctool. What were you saying again?
Title: Re: Cowon D2
Post by: luck3r on January 31, 2008, 05:17:32 AM
Sorry, I forgot to mention that this is my opinion (I've made some very bad experiences with Debian and *buntu). I didn't want to start a discussion about distros.
So, I was saying that tcctool works perfectly on Gentoo and openSUSE.
By the way, detection of my 4GB D2 works.
Title: Re: Cowon D2
Post by: Yeeze on January 31, 2008, 05:43:24 AM
Right now I am compiling a new kernel with the depreciated options for usb checked as mentioned here before somewhere... I just need to wait... but in 1 - 3 hours I will know if tcctool will work under ubuntu for me as well...
But don't let this thread go off topic, maybe there should be opened up a new thread about tcctool in the compiling forum...
Title: Re: Cowon D2
Post by: shotofadds on January 31, 2008, 06:25:52 AM
One question about the input from the touchscreen, what has been done to these values exactly (are they alredy put together out of three measurment's as stated in this document?
The X/Y positions are calculated by the PCF50606 chip's ADC, which returns values in the range 0-1023 (0x3ff). The screen position can be calculated using X*LCD_WIDTH/1024 and Y*LCD_HEIGHT/1024.

In telechips.c it said the touchscreen driver cannot be put on a tick task... what is that? Should there be a thread?
Is there something like an API for the I2c code or somewhat to get more information about it?
To read values from the touchscreen we need to communicate with the PCF50606 chip via the I2C protocol (the PCF datasheet has a good description of this). The normal button drivers etc are run on a 'tick task' (ie as an interrupt, on a 100Hz timer) which means they can occur at any time - potentially while another thread is making use of the I2C bus. That comment in the code serves as a reminder to find a solution, of which there may be many.

The current I2C calls are really only there for testing purposes, and I envisage them being replaced by a single call to a D2 touchscreen driver, which calls a generic PCF50606 driver, which in turn calls the I2C driver.

But don't let this thread go off topic, maybe there should be opened up a new thread about tcctool in the compiling forum...
Go for it - after all tcctool is not a New Port, is it? ;)

Finally to change the subject entirely, I'm making good progress on the flash driver - I think I've figured out the required block translation, so (in theory at least) it shouldn't be too long before we can read files from the internal memory. I just need to find a few spare hours to sit down and code it...
Title: Re: Cowon D2
Post by: Llorean on January 31, 2008, 11:26:14 AM
tcctool is not used in the installation of any current ports. It is, for practical purposes, a component of a new port, and shouldn't be muddying up the discussion elsewhere when the expert(s) for it only exist in one place. Please keep "installation tools" for a new port in the same thread as that new port until the whole thing is "supported" (documented in the manual is what should be for something to leave the new ports area, once there are instructions in the manual for using tcctool, then people can reasonably find out the basics of using it).
Title: Re: Cowon D2
Post by: shotofadds on January 31, 2008, 12:03:28 PM
Fair enough, though I think Yeeze was referring to problems setting up an appropriate environment to build tcctool, rather than having trouble running it (so the compiling forum seemed to make sense).

If/when the port is "supported" there won't be any need to run tcctool - I wouldn't expect to see it in the manual as it's purely a development tool that allows us to run code without flashing the device. Final installation can be done by using the OF to flash a retail firmware that has been patched to contain a dual boot mechanism & the Rockbox bootloader.

Although having said that, tcctool is proving to be very useful over at iAudiophile, as it can be used to repair botched firmware upgrades. It probably could do with its own Wiki page, at least.
Title: Re: Cowon D2
Post by: Yeeze on February 03, 2008, 10:24:21 AM
After some problems I was able to boot my newly compiled kernel with deprecated usb devices checked...

I am still not able to use tcctool...

here is my setup:
§ uname -a
§ Linux yeeze-desktop 2.6.24 #1 SMP Sun Feb 3 13:35:24 CET 2008 i686 GNU/Linux

$ lsusb -t
$ Bus#  5`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  4
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  3
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   2 Vendor 0x0db0 Product 0x6982
Bus#  2
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   2 Vendor 0x046d Product 0xc01d
Bus#  1
`-Dev#   1 Vendor 0x0000 Product 0x0000
  |-Dev#   4 Vendor 0x154b Product 0x0005
  `-Dev#  11 Vendor 0x140e Product 0xb011 <-- The D2 in recovery mode

Is there anything I missed, or is just not possible to run tcctool under ubuntu?

At the moment I am only able to compile the bootloader under Linux and then upload it under WinXp... And rebooting every time just takes forever....
Title: Re: Cowon D2
Post by: andiator on February 03, 2008, 10:45:20 AM
@Yeeze
I'm using cygwin successfully on Vista and XP. I did exactly what the tutorial said (http://www.rockbox.org/twiki/bin/view/Main/CygwinDevelopment).
Even get it portable  ;) : installed it on an external usb-drive and using it on XP and Vista pc's.
Well, it takes awhile to compile, but it works.
Title: Re: Cowon D2
Post by: Yeeze on February 03, 2008, 11:47:17 AM
Thanks andiator, but the thing is, I tried cygwin and coLinux on my win xp, but somehow there is nothing working...
For example:
bash-3.2$ mkdir
bash: mkdir: command not found
bash-3.2$

I followed the guide on how to setup cygwin exactly...
With coLinux I can't get a connection to the Internet and so on....
I got really frustrated with windows and since I switched from WinXP to Linux a while ago and I am now on windows only once or twice a week, I thought it might be easier to get tcctool to work under ubuntu.... Also does everything compile under linux without any hassle and it compiles much faster
I will keep trying to get it working under windows....
But if it is possible to have tcctool working under ubuntu, I would prefer it this way...
Title: Re: Cowon D2
Post by: andiator on February 03, 2008, 02:20:10 PM
@Yeeze
So your main OS is linux, sorry can't help with that.
But did you tried the debian-vmware image? (http://www.rockbox.org/twiki/bin/view/Main/VMwareDevelopmentPlatform)
Using vmware player 6 on vista I was able to download and compile the source code. And with the net-share (samba) you can acces your home directory. (enter \\debian in windows explorer).
You need about 3 or 4 GB on your harddrive. The virtual debian is configured to have 256 MB RAM, so you don't need a new and powerfull pc.
Title: Re: Cowon D2
Post by: luck3r on February 03, 2008, 03:55:47 PM
Yeeze: Did you try tcctool with sudo? I don't know anything about your system configuration, but for me it doesn't work as a normal user.
Title: Re: Cowon D2
Post by: kugel. on February 04, 2008, 08:12:58 AM
Thanks andiator, but the thing is, I tried cygwin and coLinux on my win xp, but somehow there is nothing working...
For example:
bash-3.2$ mkdir
bash: mkdir: command not found
bash-3.2$

Looks like your PATH variable is screwed up. mkdir shouldn't be "not found".
Title: Re: Cowon D2
Post by: luck3r on February 04, 2008, 11:11:37 AM
Cygwin doesn't have that variable right after installation.
Yeeze: You could try andLinux, it's an already configured coLinux with X server and network.
Title: Re: Cowon D2
Post by: shotofadds on February 05, 2008, 07:16:59 AM
Just a quick update: during the the last few days I've had some success getting the flash FAT32 filesystem working, at least partially. The boot sector, cluster map & root directory all appear to be read correctly, as far as I can tell.

I can open() and read correct-looking data from some files, but there are clearly still some bugs in the block translation, since junk is being returned for certain files. I might just take the hit and dump the whole 3811Mb partition to my HDD and match up the junk vs. the real data...

I'll post some details of all this to the wiki eventually (when I've found the right words to describe the 'interesting' block translation!). I've been concentrating on trying to make it work first :)
Title: Re: Cowon D2
Post by: shotofadds on February 12, 2008, 05:52:46 PM
I've spent the last couple of hours doing a brain-dump into the wiki of the last week or two's investigation into the contents of the NAND flash. Hopefully actually documenting this somewhere other than my head will make coding easier, or at least that's the theory ;D

I have a few code updates that need testing on 2Gb / 8Gb players (partially working FAT32 read support) but it's doubtful I'll have time to get it ready before next week. Real life gets in the way from time to time, I'm afraid!
Title: Re: Cowon D2
Post by: jarivk on February 12, 2008, 11:22:02 PM
hi thats good news  :).
meantime I started working on WM8985 codec. From what i have understood...
We have to use I2C interface to read/write to device control registers.
We have to setup DMA for writing actual PCM samples.
For time being I am trying to just read default value in Left DAC digital volume register (offset of 0xB)
I found I2C base addres for 8985 in wmcodec-telechips.c
#define I2C_AUDIO_ADDRESS 0x34 // in wmcodec-telechips.c
   
I tried
i2c_readmem(I2C_AUDIO_ADDRESS, 0xB, buf, 1);
//int i2c_readmem(int device, int address, unsigned char* buf, int count )

Default value after reset of this register is 0xFF as per datasheet.
But the i2c_readmem is failing. it is not getting i2c_getack() after writing device value.
Do we have to enable the WM8985 chip??

also a wikipage (http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info) says
Audio In/Out  base address for 7801 is 0xF0059000
What is this address?? or we have to use this address to enable the chip??
Do u have any info abt this?

Also in general how are we finding the base addresses of the devices??


Title: Re: Cowon D2
Post by: shotofadds on February 13, 2008, 05:42:25 AM
Hi jarivk, it's good to see someone else taking an interest in the code :)

We have to use I2C interface to read/write to device control registers.
Correct.

We have to setup DMA for writing actual PCM samples.
I'm not sure where that is implied - as I understand it (confirmed by OF disassembly) we need to write data to the DAI (I2S) registers when the appropriate buffer fill IRQ/FIQ is received.

I tried
i2c_readmem(I2C_AUDIO_ADDRESS, 0xB, buf, 1);
//int i2c_readmem(int device, int address, unsigned char* buf, int count )

Default value after reset of this register is 0xFF as per datasheet.
But the i2c_readmem is failing. it is not getting i2c_getack() after writing device value.
Do any of the other targets read from the WM codec - maybe there are some clues there? I haven't tried this yet, so can't say for sure.

Do we have to enable the WM8985 chip??
That's certainly a possibility - I haven't yet disassembled the relevant parts of the OF to determine if this is necessary. However, I do know that it uses the same I2C code for both the WM and PCF chips, so there shouldn't be a problem with the existing code.

Also in general how are we finding the base addresses of the devices??
The addresses in the wiki page were obtained by cross-referencing the D2 firmware disassembly with other TCC 76x and 77x firmwares (where those registers were already known). If you'd been reading this thread the whole way through, you'd have known that.

After I spent a month or two locating those register addresses, somebody helpfully posted a link to the TCC7801 datasheet - it's a few pages back in this very thread. It makes good bed-time reading ;D
Title: Re: Cowon D2
Post by: jarivk on February 13, 2008, 09:13:49 AM
I am using tcctool to test the bin file. every time before loading bin file, i have to disconnect and reconnect D2 in USB boot mode. Is there a way to load the bin file without disconnecting/reconnecting the device everytime?

About the 7801 datasheet. actually have downloaded the pdfs. but somehow i missed it   :-[
will try something tonight  :)
Title: Re: Cowon D2
Post by: shotofadds on February 14, 2008, 04:18:11 AM
I've made some updates to the build in SVN - if possible could people with 2/4/8Gb D2s test the latest code and report the following back:

1) If you see the word *PANIC* it means some assumptions I've made turned out not to be correct. What does the text following it say?

2) The text "nnnn sequential segments found" should be displayed before attempting to mount the partition. What number is nnnn?

3) Are any further errors displayed - eg. after the "mount" line?

If there are no errors the usual screen of diagnostics should appear - I've also updated this to display a crude approximation of the touchscreen position.
Title: Re: Cowon D2
Post by: luck3r on February 14, 2008, 05:44:04 AM
4GB

2044 sequential segments, no errors.
Title: Re: Cowon D2
Post by: shotofadds on February 14, 2008, 06:34:29 AM
2044 sequential segments, no errors.
Hmmm, that's not what I expected (my 4Gb reports 3816). Can you tell me how much free space there is on your internal memory - is it about half full?

Also which firmware version are you running?
Title: Re: Cowon D2
Post by: andiator on February 14, 2008, 07:38:40 AM
8Gb version:

FW 3.54
used 4.03 Gb, 782 Files, 76 directories
free 3.57Gb

1048576 pages
4096 bytes per page
394 sequential segments found (788Mb)

hey cool, I can draw some curves in the lower screen part!
Title: Re: Cowon D2
Post by: shotofadds on February 14, 2008, 08:17:15 AM
394 sequential segments found (788Mb)
Ok, looks like this experiment wasn't quite as successful as I had hoped. I have some ideas about how to fix this, but I might not have time to work on this until next week.

Still, no panics and no 'failure to mount partition' errors is good progress all the same. In the meantime you can play with my replacement for the D2 notepad! ;D
Title: Re: Cowon D2
Post by: Yeeze on February 14, 2008, 01:23:20 PM
Thanks for the update shotofadds !

My 2GB model actually said:
*PANIC*
BMPM tag not prese
nt

Nothing happened afterwards...
Title: Re: Cowon D2
Post by: shotofadds on February 15, 2008, 04:30:40 AM
I guess I spoke to soon about the lack of panics. >:(

Yeeze, would you be able to make a couple of quick changes to your build to enable some diagnostic output?

The following are in firmware/target/arm/tcc780x/ata-nand-tcc780x.c:

- In nand_get_chip_info(), comment out or delete the two "if (....) panicf(....);" statements at line 417/418.

- In nand_test(), change both of the "#if 0" lines (434 & 454) to "#if 1".

Rebuild and run the new image. This time you should see the usual text about banks, pages, number of segments etc; and then about 4 pages of hex numbers.

I appreciate there is a lot of data, and there's no way of doing a cut-n-paste, but would it be possible to note down the data from these pages and send me a PM?   (nb. you don't need to include all the FFFFFFFF's, just replace each one with a . or something so I know how many there are).

Thanks in advance, it's much appreciated!

EDIT: Also which firmware version are you using?
Title: Re: Cowon D2
Post by: ChristianGmeiner on February 15, 2008, 08:02:06 AM
Hi..

I got an D2 (broken touchscreen) to play with. I am not sure who is doing what at the
moment. If nobody else has started before, I want to do the wm8985 driver. As the
datasheet can be found very easily I think it should be okay if we can test sound when
ata and other needed stuff works.
Oh.. and I have fixed the debug_menu stuff so rockbox does compile and ends with this error:

/home/austriancoder/rockbox/d2/libTremor.a(vorbisfile.o): In function `ov_pcm_seek':
vorbisfile.c:(.text+0x21e4): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(vorbisfile.o): In function `ov_read_fixed':
vorbisfile.c:(.text+0x26f4): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(framing.o): In function `ogg_buffer_alloc':
framing.c:(.text+0xa0): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(framing.o): In function `ogg_buffer_dup':
framing.c:(.text+0x140): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(framing.o): In function `ogg_buffer_split':
framing.c:(.text+0x224): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(framing.o): In function `ogg_stream_packetout':
framing.c:(.text+0xf80): relocation truncated to fit: R_ARM_PC24 against `.icode'
/home/austriancoder/rockbox/d2/libTremor.a(framing.o): In function `ogg_stream_packetpeek':
framing.c:(.text+0xf88): relocation truncated to fit: R_ARM_PC24 against `.icode'
collect2: ld returned 1 exit status


greets,
Christian
Title: Re: Cowon D2
Post by: shotofadds on February 15, 2008, 08:09:56 AM
Yes, those linker errors are as far as I've progressed. I haven't worried about fixing them yet as I'm concentrating on getting the NAND driver working in the bootloader.

I haven't seen any code for a WM8985 driver yet, although jarivk did mention he was looking at it a short while ago. I don't know if that has progressed any further.

I'll be away for a few days, but maybe we should catch up in IRC one evening next week? Though I think we might struggle to get Rockbox to a usable point with only three buttons and a broken touchscreen :-\

EDIT: 1) The WM8985 datasheet should already be linked from the CowonD2Info wiki page. 2) Have you tried uploading the latest bootloader.bin using tcctool? Does it mount without errors?
Title: Re: Cowon D2
Post by: ChristianGmeiner on February 15, 2008, 12:03:10 PM
Yes I can run code on the target.. a nice way to develop :)

This is what I get when starting:

ATA
2 banks
* 1048576 pages
* 2048 bytes per page
707 sequential segments found (707Mb)
KEYPRESS
mount
Hello World!
...

Title: Re: Cowon D2
Post by: shotofadds on February 17, 2008, 04:58:33 PM
I'm not convinced that the power-off code is working as intended.

As I understand it, the PCF50606 automatically powers the unit off when a) the power key has been pressed for >1sec and b) its ONKEY1S interrupt has gone unacknowledged for 8 seconds. I think that is the behaviour currently being seen (hence the delay).

Yeeze: I got your PM, thanks for the screen caps. I'm currently digesting the information in there, should be useful. Now I need sleep :P
Title: Re: Cowon D2
Post by: phi on March 01, 2008, 11:50:36 AM
Hi all,

I just submitted a patch to enable ECC in the NAND driver. The error rate on my D2 seems to be fairly low, but I figured we'd need this eventually so here it is.

FS#8669 (http://www.rockbox.org/tracker/task/8669)

You won't actually notice anything different in the bootloader unless you've written code to test file reading.
Title: Re: Cowon D2
Post by: shotofadds on March 01, 2008, 12:01:08 PM
Much appreciated, that was on the to-do list.

I'm currently in the process of re-working the NAND driver to make use of the write cache (block type 0x15) segments. When that is done we should have a reliable read-only filesystem and the 'real' work can begin to boot the main Rockbox image. 8-)

/me kicks himself to update the TelechipsNAND wiki page...
Title: Re: Cowon D2
Post by: shotofadds on March 08, 2008, 11:09:57 AM
There's not much progress to report this week I'm afraid (I've been spending too long killing off my brain cells with beer ;D) but I thought those following this thread might be interested in a quick photo:

(http://img371.imageshack.us/img371/624/img4918gg6.th.jpg) (http://img371.imageshack.us/my.php?image=img4918gg6.jpg)

This is what I failed to show at 'DevConPub' this week: it shows the D2 booting as far as the Rockbox logo and version number, and then freezing soon afterwards.  But it's good progress all the same... 8-)
Title: Re: Cowon D2
Post by: Michael66 on March 09, 2008, 06:52:42 AM
Thanks for the info, shotofadds! I'm following this thread for a while now and really appreciate all the work you guys put into making Rockbox work on the D2. :)
The official firmware releases seem to degenerate by the minute (according to the discussions at iaudiophile.net), so what you do here is probably the only hope left for the D2 community.
Title: Re: Cowon D2
Post by: cybergrind on March 09, 2008, 02:25:08 PM
I'v compiled file with "B" option, copied .bin to device. load:
see :
Code: [Select]
ATA
1 banks
....

when I pressed any-key:
Code: [Select]
*PANIC*
Stkov scroll

I try to comment
Code: [Select]
   if(((unsigned int *)old->stack)[0] != DEADBEEF)
        thread_stkov(old);
in thread.c, to view pre-panic messages, and have:
Code: [Select]
mount
No partition found

2 Gb version.

+P.S. when I removed check in telechips.c:
Code: [Select]
//    if (rc<=0)
//    {
//        error(EDISK,rc);
//    }
All seems work... what i doing wrong?
Title: Re: Cowon D2
Post by: shotofadds on March 09, 2008, 04:24:50 PM
I don't think you're doing anything wrong. Yeeze reported a similar problem on his 2Gb player, but I've not yet had time to investigate the problem. I will look into it, but I may need you to run some tests for me.

In other news, this afternoon I got the Rockbox menu to boot, but nothing is working yet ;D
Title: Re: Cowon D2
Post by: andiator on March 09, 2008, 05:17:11 PM
Added button definitions for plugins, wps and settings menu. The simulator is now usable.
FS#8708 http://www.rockbox.org/tracker/task/8708

@shotofadds:  Coooool
Title: Re: Cowon D2
Post by: shotofadds on March 09, 2008, 08:11:17 PM
Thanks for that, andiator - I'll get those merged in soon. The keymaps will probably have to evolve over time, but it's certainly a good starting point.

Your real name (for the credits) is listed on the tracker, right?
Title: Re: Cowon D2
Post by: andiator on March 10, 2008, 04:03:08 AM
@shotofadds
Yes it's me.
For the WPS and menu are the four direction buttons (up/down...) enough. Some plugins need more. And yes, the mappings have to be altered to be usefull.
Title: Re: Cowon D2
Post by: cybergrind on March 10, 2008, 05:51:56 AM
I tryed add some printf in disk.c and fat.c, and get log:
Code: [Select]
mount
start mounting disks. fat_init. NUM_VOLUMES : 1

start disk_mount(0)

start fat_mount()
fat_mount() - BPB is not sane

start fat_mount()
fat_mount() - Couldn't read BPB (error code -1)

start fat_mount()
fat_mount() - BPB is not sane

start fat_mount()
This is not FAT32. Go away!

No partition foudn, trying to mount sector 0.
start fat_mount()

after this I comment, near 360 line in fat.c:
Code: [Select]
#else /* #ifdef HAVE_FAT16SUPPORT */
//        DEBUGF("This is not FAT32. Go away!\n");
//        printf("This is not FAT32. Go away!");
//        return -2;

above this fragment we have such code:
Code: [Select]
#ifdef HAVE_FAT16SUPPORT
        fat_bpb->is_fat16 = true;
        if (fat_bpb->dataclusters < 4085)
        { /* FAT12 */
            DEBUGF("This is FAT12. Go away!\n");
            printf("This is FAT12. Go away!");
            return -2;
        }
maybe some defines is missed (2 GB model)?
Title: Re: Cowon D2
Post by: shotofadds on March 10, 2008, 07:00:06 AM
The first 4 "start fat_mount()" lines are because Rockbox attempts to mount each partition in the partition table in turn - but the D2 has no valid partition table, since it is formatted in "superfloppy" mode. The code in disk.c and fat.c is fine, don't worry about this.

The last line "No partition found, trying to mount sector 0. start fat_mount()" is the important one - what happens after this?

Are you familiar with the linux 'dd' utility (or it's Windows equivalent (http://www.chrysocome.net/dd))? A dump of the first 512 bytes from your D2 would be useful at this point.
Title: Re: Cowon D2
Post by: cybergrind on March 10, 2008, 07:31:39 AM
Oh I'm sorry, not all log, last message
Code: [Select]
This is not FAT32. Go away!
When I added in config-cowond2.h:
Code: [Select]
#define HAVE_FAT16SUPPORTAll seems ok. Maybe this trouble appeared only in 2 Gb version, because defaulf system is fat16 =)

dump (attached) shows that filesystem is Fat16.

Another problem: something strange with screen during shutdown,
maybe we should add
Code: [Select]
#define HAVE_LCD_SHUTDOWN into config-cowond2.h

and rename:
Code: [Select]
static void lcd_display_off(void)to:
Code: [Select]
void lcd_shutdown(void)in lcd-cowond2.c

and use it during shutdown.

P.S. I didn't familiar with ROCKBOX rules, maybe I should create and commit patches for this issues?
Title: Re: Cowon D2
Post by: shotofadds on March 10, 2008, 07:56:39 AM
I thought that might be the case: the missing log message was the important one ;D. I'll add in HAVE_FAT16SUPPORT next time I update the code.

Shutdown/poweroff does not currently work - this requires some more thought (more than just the LCD driver - powering off the CPU & hardware needs to be done too).

If you make patches, it's best to submit them to the tracker (Flyspray (http://www.rockbox.org/tracker/index.php?type=4)). But if they're just 1-liners like the above, post them here.
Title: Re: Cowon D2
Post by: cybergrind on March 10, 2008, 12:00:37 PM
power off code in SDK:
Code: [Select]
..removed..I tried do almost all of this (except IO_CKC_SetClock), nothing good :\

Question: can we software-disconnect USB?

p.s. some info:
ARM926EJ-S (includes ARM Jazelle technology which enables the direct execution of Java bytecode in hardware)
Title: Re: Cowon D2
Post by: shotofadds on March 10, 2008, 12:50:20 PM
Please do not post copyrighted code here, or in the tracker, or anywhere else - it'll be removed.

It may be the case that power-off does not work because we are running code in usb-boot mode. Until code runs from flash we have no way of knowing. This is something still to be investigated.
Title: Re: Cowon D2
Post by: kalessin on March 14, 2008, 01:10:36 PM
So... I will (hopefully) try to get the toolchain to work this weekend, since my brandnew D2 is begging for a working Rockbox. Don't know how much I will actually be able to contribute, apart from testing (unfortunately I have not much experience on embedded platforms), but we will see. First of all (before I put anything on it) I will read up on D2 desaster recovery, though :)
Title: Re: Cowon D2
Post by: shotofadds on March 14, 2008, 05:32:07 PM
Since you won't be flashing anything to your D2 at the moment (everything is done in usb-boot mode using tcctool), there shouldn't be any disasters to recover from.

I'm frustratingly close to a first working version (ie. booting to the menu with working buttons) but unfortunately I managed to leave my D2 at work and won't be able to make any progress for a few days. Oops :-\

Getting the toolchain to work should simply be a matter of checking out a current SVN build and running rockboxdev.sh - check the wiki for instructions. Hope it goes well!

ps. Experience on embedded platforms is mostly irrelevant, I had none before I started this port. ;D
Title: Re: Cowon D2
Post by: luck3r on March 15, 2008, 08:11:06 PM
Since I've checked out revision 16680, the screen of my D2 stays black with normal build, uploading the bootloader just loads the regular Cowon firmware after a short delay.  Is this normal or am I doing something wrong?
Title: Re: Cowon D2
Post by: shotofadds on March 16, 2008, 08:28:54 AM
Apologies for that, the last commit message read:

Code: [Select]
r16646: Cowon D2: Make the bootloader functional (usage instructions to appear on the CowonD2Info wikipage shortly). Also re-enable IRAM by reducing Tremor's ICODE usage.Of course, I forgot to update the wiki with the necessary instructions - I'll do that later today. ::)

EDIT: I've added some instructions to the wiki page. Let me know if anything is unclear.
Title: Re: Cowon D2
Post by: Yeeze on March 20, 2008, 03:57:37 PM
Wow really nice progress!!

I lost Internet for the last week, but now I'm back online =)

So if there is anything to be tested with a 2GB player I can do it!

And a while back I thought about writing the touchscreen driver, but I must say that I did not get anywhere...
This might be due to my short time of 1 and 1/2 year of programming experience...
I looked through the code, but I only hardly understand anything of the code for threads and stuff which, probably will be needed to have interrupts working... (well that was my guess)

But as soon as it comes to plugins and higher level functions, etc. I want to contribute =)

One question about cygwin...

I came really close to compiling but at one point I get:
Quote
$ make
make[1]: `rdf2binary' is up to date.
make[1]: `convbdf' is up to date.
make[1]: `codepages' is up to date.
make[1]: `scramble' is up to date.
make[1]: `mktccboot' is up to date.
make[1]: `bmp2rb' is up to date.
CC target/arm/tcc780x/ata-nand-tcc780x.c
target/arm/tcc780x/ata-nand-tcc780x.c: In function 'nand_test':
target/arm/tcc780x/ata-nand-tcc780x.c:438: warning: implicit declaration of function 'printf'
target/arm/tcc780x/ata-nand-tcc780x.c:493: warning: implicit declaration of function 'reset_screen'
target/arm/tcc780x/ata-nand-tcc780x.c:553:6: warning: #warning function not implemented
target/arm/tcc780x/ata-nand-tcc780x.c: At top level:
target/arm/tcc780x/ata-nand-tcc780x.c:38: warning: 'next_yield' defined but not used
CONVBDF
CC sysfont.c
/cygdrive/l/home/yeeze/myStuff/programming/rockbox-dev/rockbox/tools/convbdf: /cygdrive/l/home/yeeze/myStuff/programming/rockbox-dev/rockbox/tools/convbdf: cannot execute binary file
make[1]: *** [/cygdrive/l/home/yeeze/myStuff/programming/rockbox-dev/rockbox/buildc/firmware/sysfont.o] Error 126
make: *** [build] Error 2

Does anybody know why this happens? Is it a known issue?
Title: Re: Cowon D2
Post by: andiator on March 20, 2008, 05:31:49 PM
I'm using cygwin too and don't have this problem.
Anyway, tools/convbdf.exe is compiled at some point, not shure when. Perhaps with tools/rockboxdev.sh?
Try to run it (convbdf.exe) in the cygwin console, it should output some help information. If not, you have to rebuild it. Besides, mine is 55.014 bytes big.
"make veryclean" and than "make tools" could help, I think.
Title: Re: Cowon D2
Post by: Yeeze on March 21, 2008, 06:58:55 PM
Yeah that did the trick.... Thx andiator
Title: Re: Cowon D2
Post by: shotofadds on March 24, 2008, 07:30:01 PM
The D2 build has had some pretty substantial updates over the course of the holiday weekend: buttons should now work, meaning the menus are usable (mostly..see caveat), plugins are now built (thanks, andiator) and some of them are usable - eg. fire, plasma, starfield demos and the Invadrox space-invaders game all work without any modification.

I'd appreciate some feedback from you guys - first read the wiki page (http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info), build the bootloader and main builds from source, install and let me know if you have trouble booting to the menu (please don't report any of the "Known Issues" from the wiki page).

If you're stuck with "Bad Checksum" or "File Not Found" errors in the bootloader, copy a few files to the D2 (anything will do, bigger is better), boot the OF a few times, and try again. I'll post an updated ATA/NAND driver later this week that should resolve some of these issues.

Finally, if you're not confident building from source yourself, the port probably isn't mature enough to be of much interest yet. There are no binary downloads available at this point.

Have fun....   8-)
Title: Re: Cowon D2
Post by: cybergrind on March 25, 2008, 09:02:08 AM
I have an another error:
Sometimes boot's started,and thought few seconds lcd off's (i have not time to read any)
Title: Re: Cowon D2
Post by: andiator on March 25, 2008, 09:10:19 AM
For two days I already tried this and had one time "Bad checksum" and three times "Read failed".
With today build is like cybergrind sais:

While holding a key, you can see some lines. Mine sais ...(1850Mb) and I have about 3.74 Gb.
Releasing the key shows some more line and the lcd goes off so fast, you can't read the last lines.
Title: Re: Cowon D2
Post by: shotofadds on March 25, 2008, 09:20:46 AM
As I already mentioned, the "Bad Checksum" and such errors are due to the ATA driver, and I'll post an improved version later.

But if it has passed that stage, you should see the Rockbox logo and then the main menu, or USB logo if the cable is still inserted. I'll check this out later (I'm at work at the moment, sorry...)

Could you try inserting the following two lines before the rc = kernel_entry() line in bootloader/telechips.c? You should then be able to read any text output:

Code: [Select]
while (!button_read_device()) {};
while (button_read_device()) {};
Thanks for your help.
Title: Re: Cowon D2
Post by: cybergrind on March 25, 2008, 09:28:55 AM
last messages:
Code: [Select]
Model name: d2
Loading rockbox.iaudio
Sum: 2D05E29
Then I press key, and LCD off's
Title: Re: Cowon D2
Post by: shotofadds on March 25, 2008, 09:52:03 AM
Ok, that means the load was successful, but booting the actual Rockbox image fails. Could you try 'make clean' and build the Normal build again? Also make sure you are building the Bootloader and Normal build in separate directories (eg. d2_boot and d2_main).

If that still fails, could you find somewhere to upload your main rockbox.iaudio file and its corresponding apps/rockbox.map file? (not here though, the files will be too large to attach)
Title: Re: Cowon D2
Post by: cybergrind on March 25, 2008, 10:31:14 AM
I used rm * -R to clean =) and compiled normal build
and have same problems (lcd off's after I press button)
http://cybergrind.jino-net.ru/rbx.rar - contains files, that you request (~ 200 Kb)
Title: Re: Cowon D2
Post by: shotofadds on March 25, 2008, 05:05:40 PM
Thanks, I get the same behaviour when running your rockbox.iaudio on my D2. Your file looks to have been built ok, and the .map seems fine. It seems I have broken something in the latest SVN build :/

Could you try this version: http://www.megaupload.com/?d=L0WRRFXN

Edit: can you also tell which which version of GCC you are running (arm-elf-gcc --version). Make sure you are using the version installed by the rockboxdev.sh script (4.0.3 plus multilibs patch).
Title: Re: Cowon D2
Post by: andiator on March 25, 2008, 05:42:57 PM
@shotofadds
with yours rockob.iaudio I do see Rockbox and usb logos. I even see some garbage as menu and can navigate up and down in this garbage.
BTW, my rockbox.iaudio is 760 bytes bigger than yours.

[Update] Now I'm setting the vmware image and trying to build on a real linux (not cygwin  :))
Title: Re: Cowon D2
Post by: shotofadds on March 25, 2008, 05:46:02 PM
@andiator, yes the LCD driver is broken. I just spotted that and will fix it later.
Title: Re: Cowon D2
Post by: andiator on March 25, 2008, 07:08:23 PM
After more than 10 tries I've got past "Read failed" and did seen the rockbox logo!
Well. after that got a panic: something reading not aligned ... Yes I know, the ATA driver isn't ready yet  :-[

I build it on the rockbox vmware image (debian), so it seems like the problem is the cygwin environment, although the arm-elf-gcc version is 4.0.3.
(And the compile speed was much more better)
Title: Re: Cowon D2
Post by: shotofadds on March 25, 2008, 07:19:11 PM
The non-aligned read error is also fixed by the new ATA driver - I forgot to mention that, sorry. A temporary work-in-progress version is attached, so try using that instead. Be aware that it is not complete, so it is still not 100% perfect, and there are several compiler warnings (largely because of leftover debug code).

Once you have a working build, you can also try removing all of the code from inside lcd_update_rect() in lcd-cowond2.c, and inserting a single call to lcd_update() instead. That should temporarily fix the garbled display.

At some stage I will also try building with cygwin to see if I can confirm whether that is indeed the problem. I've been using the Rockbox VMware image with no significant problems so far.

Good luck!  :)

EDIT: Removed attachment since this is now in SVN.
Title: Re: Cowon D2
Post by: andiator on March 25, 2008, 09:22:01 PM
That is much better! Thanks shotofadds!
Booting into the menu, even watching some images  ;D
No garbage on lcd without any changes

Besides, the line 33

#include "../../../bootloader/common.c"

should read:

#include "../../../bootloader/common.h"
Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 06:20:37 AM
Well, I did say there was temporary debug code left... ;)

Can you confirm whether any of the plugins work (eg. the game Invadrox should work well without changes)? You may first need to familiarise yourself with the buggy button behaviour in order to navigate the menu, though.

You should also find that things like the JPEG viewer work - eg. go to Files and browse for some .jpg files (it works quite well in slideshow mode). Most other things are unusable at this stage due to the limited button mappings available.

Unfortunately I won't have any more time to work on this until the weekend. :-\
Title: Re: Cowon D2
Post by: andiator on March 26, 2008, 08:02:39 AM
Yes, I confirm that the image viewer and some plugins work.

Do you have a clue why and where this buttons "hopping" happens? I would like to try to fix this, if I only knew where to start from...
button_read_device() in button-cowond2.c seems to be ok.

And now back to cygwin:
Yesterday, I'd started tools/rockboxdev.sh - it took over 4(!) hours, so I was going to bed at about 4 am. Luky me having this week free. (note to me: don't install cygwin on an external usb harddrive, it at least doubles the run/compile time).
Today "make clean" and "make -j": and it did work! I got in the rockbox menu.

But I don't want to use cygwin anymore, it takes too long to compile.
Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 08:26:51 AM
Yes, I confirm that the image viewer and some plugins work.
Excellent. At least I know it's not just me now! ;D

Do you have a clue why and where this buttons "hopping" happens? I would like to try to fix this, if I only knew where to start from...
button_read_device() in button-cowond2.c seems to be ok.
Yes. Reading from ADC 0 appears to return incorrect values if it is read too frequently (I've seen this behaviour before in the old bootloader test program). I need to re-work the ADC driver to be timer driven, so that each adc_read() just returns a cached value, rather than performing a fresh read each time. It's on the TODO list...

And now back to cygwin:
Yesterday, I'd started tools/rockboxdev.sh - it took over 4(!) hours, so I was going to bed at about 4 am. Luky me having this week free. (note to me: don't install cygwin on an external usb harddrive, it at least doubles the run/compile time).
Today "make clean" and "make -j": and it did work! I got in the rockbox menu.
Good to hear it - I wanted to make sure there wasn't a general problem building in cygwin. I found VMware to be at least 2x faster, so I use that now.
Title: Re: Cowon D2
Post by: cybergrind on March 26, 2008, 09:33:49 AM
I am using gcc 3.4.4 with cygwin
with your rockbox.iaudio I still have the same problem (after loading rockbox.iaudio LCD off's)
Title: Re: Cowon D2
Post by: andiator on March 26, 2008, 09:53:54 AM
@cybergrind
I think you typed "gcc --version"? I did the same mistake. It should be "arm-elf-gcc --version".

As it seems it is important to run tools/rockboxdev.sh - beware: it can take a lot of time, so 2 to 4 hours.
And you need to have curl-package installed. Run cygwins setup.exe choose some url and under "Net", I think, is the curl package.

But I would advise to use the vmware image since it much more faster. http://www.rockbox.org/twiki/bin/view/Main/VMwareDevelopmentPlatform
The vmware player can be downloaded for free from http://www.vmware.com. Then do as the first link says plus run the tools/rockboxdev.sh (10 - 30 mins).
The image has already a net drive mounted under "\\debian" with user = "user" und pw = "rockbox", so you can use your favorite editor in windows, build on linux and use the tcctool from your cygwin directory to upload the binaries.
Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 10:13:29 AM
If you're going to run rockboxdev.sh, you only need to select the ARM toolchain - if you choose the other two it'll take three times as long...
Title: Re: Cowon D2
Post by: Yeeze on March 26, 2008, 10:39:36 AM
I compiled a botloader with cygwin and arm-elf-gcc --version said:
arm-elf-gcc (GCC) 4.0.3 [...]

I patched the bootloader into the Cowon firmware and uppdated the resulting image using tcctool.

This was displayed: *PANIC* BMPM tag not present

UPDATE: Ok I tried it with you image from megaupload... But the Screen stayed always just black and I needed to push the reset button...

Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 10:44:56 AM
Yeeze, have you built in the updated ata-nand driver I posted?

If you did, do you remember the nand_chip_select() fix you did a while back? Could you try that again (read a few pages back in the forum if you forget...)

Pesky 2Gb players  :-\
Title: Re: Cowon D2
Post by: Yeeze on March 26, 2008, 10:53:45 AM
Ah I will try that!
Title: Re: Cowon D2
Post by: Yeeze on March 26, 2008, 11:01:32 AM
Well now I have: *PANIC* Unknown NAND: 0x06 0x06 0x06 0x06 0x06

EDIT: You ment this little fix?
Quote
In the nand_chip_select() function (ata-nand-tcc780x.c) could you try changing the "if (chip & 1)" line to "if (!(chip & 1))" and tell me if your D2 still reports 1 bank * .... as it did before.
Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 11:41:27 AM
Yes, I meant that one - I guess it wasn't the problem... I need to think about it and get back to you (like I say, pesky 2Gb players  ;) )
Title: Re: Cowon D2
Post by: carsten on March 26, 2008, 11:52:13 AM
I'm still having the same problems with the new nand-driver. I never got beyond "unaligned read-buffer", most of the time I have a read error... :-/

edit: forgot to mention: 4gb d2
Title: Re: Cowon D2
Post by: stel on March 26, 2008, 05:32:02 PM
Hi,

I've just been trying out andiators d2_patched.bin file with mixed results.
Firstly I tried andiators rockbox.zip - This gave me the black screen after mounting.
Then I tried shotofadds rockbox.iaudio (post#211) and got the same results as andiators(post#212) so I then compiled my own rockbox.zip and now I get the *PANIC* nand_read_raw() non_aligned input buffer message as soon as I disconnect USB

The above info probably doesn't help much but I'm willing to try any suggestions to help out.

I've got a 8Gb D2
Title: Re: Cowon D2
Post by: shotofadds on March 26, 2008, 06:42:33 PM
If you are getting the "non-aligned buffer" error, then the updated ata-nand code (post #215) has not been built in successfully. The new version does not contain that error message - but you may need to alter it slightly in order to build without errors, as andiator reported.

Sorry about this mess - I will update SVN when I get a chance, but I don't have a lot of spare time this week (aka. none at all).  >:(
Title: Re: Cowon D2
Post by: andiator on March 27, 2008, 07:35:42 AM
I was playing with the adc code and I don't think that it causing the button problem. Yes, there is some jitter at the press or release, but it would cause a random behavior. And Yes, we still have to fix this in an extra thread.
The idea is to run a thread with sleep and waiting for() for the stabilized adc value to avoid the transition values from press to release and back

But the actual behavior is too systematic: it seems to happens only with plus and minus buttons and ONLY when you switch to the other buttons. So more investigation needed.
Title: Re: Cowon D2
Post by: shotofadds on March 27, 2008, 08:20:53 AM
Well, probably not a new thread but a tick task (fixed 100Hz timer) which periodically requests a new reading for each of the four ADCs and exits immediately. An ADC IRQ handler would then retrieve the new values when ready, and if they are within some abritrary level of tolerance of the last value read, make the new value available to adc_read(). That is my intention, anyway.
Title: Re: Cowon D2
Post by: andiator on March 27, 2008, 08:43:07 AM
For our three buttons the tick task is fine, but what about the touchpad? I don't think it's a good idea to do longer operations in timer task.
Title: Re: Cowon D2
Post by: shotofadds on March 27, 2008, 09:59:43 AM
I was purely talking about the ADC driver using a tick task. The touchpad is accessed through the PCF50606 (via I2C), and yes that might need some thought about how to implement it correctly. I need to check how other targets do periodic I2C polling.

Edit: This discussion would probably best be held in IRC where devs who know best about such things can comment (but I think it can wait until I've fixed the ata-nand driver and ADCs first)...
Title: Re: Cowon D2
Post by: carsten on March 27, 2008, 11:25:21 AM
If you are getting the "non-aligned buffer" error, then the updated ata-nand code (post #215) has not been built in successfully. The new version does not contain that error message - but you may need to alter it slightly in order to build without errors, as andiator reported.

Yes, I don't get the non-aligned buffer error anymore, but the read error given by the bootloader is still there. Now I got it to boot, but it's still a matter of luck... (and I definitely build it with the new driver...)

andiator: I've a little home-server running on a nslu2 with debian ;) if you just need a little space for things like that, I can arrange that... 512kbits upstream though
Title: Re: Cowon D2
Post by: andiator on March 27, 2008, 01:00:38 PM
Thanks carsten, but one hour before your post there was a parcel delivered to me - and what was inside? nslu2!  ;D and my upload is 1024 Kbit.

But back to topic. Did you rebuild the bootloader with the newer ata-driver? And did you do the ../tools/mktccboot ... stuff?

I played again with buttons and copied/inserted the touchpad test code into button_read_device(). Well, the virtual buttons work normaly, so the problem has to be the adc, but I don't get it since the code is so simple.
I uploaded the new binaries for testing. This touchpad stuff is really only for testing. It will be done right in future, so don't say it works badly  ;)
In bootloader screen simply tip on the screen to get further.
Title: Re: Cowon D2
Post by: stel on March 28, 2008, 04:05:15 AM
I'm up and running now as described in the previous posts and the majority of the demo plugins work fine. The only thing I've come across so far that I don't think has been mentioned is that the lcd seems to cut off a couple of rows from the top and displays them at the bottom.
I'm really impressed, you've done some great work shotofadds.
 I probably won't be able to help much with the coding but I will certainly start taking a look at the weekend.
Title: Re: Cowon D2
Post by: shotofadds on March 28, 2008, 05:30:24 AM
The only thing I've come across so far that I don't think has been mentioned is that the lcd seems to cut off a couple of rows from the top and displays them at the bottom.
Yep, that's a consequence of not fully understanding the LCD controller initialisation. I get the same here (but not every time) - it'll be fixed eventually.  :)

I'll hopefully have more time to work on this next week. My priorities at the moment are fixing the button/ADC code, getting the flash driver into a reasonable state and reducing the compiler warnings so we can get the D2 builds added to the Rockbox build table. Shouldn't take long... ::)

EDIT: The updated NAND driver has now been committed so I've removed it from the previous post. "svn update" is your friend.  :)
Title: Re: Cowon D2
Post by: Llorean on March 29, 2008, 07:21:28 PM
Any particular reason for decreasing the CPU frequency? Seems like it should stay at "max" until scaling works, to maximize the range of things that won't suffer from CPU speed limitations.
Title: Re: Cowon D2
Post by: shotofadds on March 29, 2008, 08:34:09 PM
Well, I looked at it from the other angle and saw nothing in the current build that should demand a great deal of CPU power. The back of the player does get a little warm if left at maximum for long periods, but this can't be any worse than watching videos with the OF.

As it stands things move along quite smoothly at 48Mhz (inc. cube etc) and bootup isn't appreciably slower, so I'd expect this or even less to become the normal unboosted speed. Sure, there's no audio decoding/playback at present, but I suspect scaling will be working properly before that happens anyway. No-one will be decoding insane .APEs for a while, at least. :D
Title: Re: Cowon D2
Post by: Llorean on March 30, 2008, 12:15:55 AM
Ah, well will you at least be changing it back if Audio gets working before you figure out the crash? ;)
Title: Re: Cowon D2
Post by: shotofadds on April 01, 2008, 02:51:30 AM
There's no need - an extra nop is all it seems to take to make the frequency switch stable.
Title: Re: Cowon D2
Post by: Bagder on April 01, 2008, 03:49:49 AM
FYI, we've now added the D2 "normal" and "bootloader" builds to the build table now...
Title: Re: Cowon D2
Post by: shotofadds on April 05, 2008, 07:07:30 AM
The ADC driver is now tick & IRQ-driven, which resolves the strange button behaviour in the menus. I've also implemented adjustable backlight brightness, using a new generic PCF50606 driver (but this isn't reliable when the CPU is boosted - I need to look into the I2C timings).

One thing to note: it's currently impossible to exit the Debug > HW Info screen, so don't enter that unless you want to reset the player (possibly just a keymap issue).

When testing these updates, please ensure that 'svn update', 'make clean', 'make' and 'make zip' are run before reporting bugs, and ensure you are correctly following the installation instructions from the wiki. Thankyou please! ;D
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 05:13:24 AM
It should now be possible to run the Rockbox bootloader from flash, so Tcctool is no longer required to boot (unless something goes seriously wrong..  ;)). See instructions on the wiki for how to do this.

Once you have flashed the patched firmware, the Cowon firmware can be booted by using the power switch as normal. To boot Rockbox, hold the power button for about half a second, then immediately set the HOLD switch - ensuring this is done before the screen lights up. The bootloader will pause after loading the firmware, displaying debug messages until HOLD is released.

NOTE: Ensure that your d2_patched.bin actually works (by uploading it using Tcctool) before flashing it to the player. In case of any mistakes, a 'bricked' player is easily recoverable by using Tcctool to boot the Cowon firmware.
Title: Re: Cowon D2
Post by: Yeeze on April 08, 2008, 08:33:49 AM
Wow thats nice! Nice progress!

Do I still have to patch the code manually for the 2GB player? Or does it not work at all?

EDIT: Okay I compiled the original ata_nand file and there was some output:

Rockbox boot loader
Version r17032M-080408
ATA
1 banks
* 1048576 pages
* 2048 bytes per page
1363 sequential segments found (1363 Mb)
mount
File not found


EDIT 2: Mhh... I think I need to upload all the stuff from the zip file of the normal build.... xD
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 08:59:57 AM
The current build should work without modification on any D2. Try it, and you're still having problems let me know exactly what does (or doesn't) happen.

EDIT: I just saw your edit (fun, this  ;)). Try unzipping the whole rockbox.zip to the root of the internal flash one more time. Boot the OF, then try again.
Title: Re: Cowon D2
Post by: Yeeze on April 08, 2008, 09:11:35 AM
Yeah I will, Im right now running make with Normal... after the zip is finished I will try and give feedback =)
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 09:16:52 AM
Now that plugins are enabled a full build takes quite some time (especially if you're using Cygwin). If you don't want to wait you could try this (http://build.rockbox.org/dist/build-cowond2/rockbox.zip) build.
Title: Re: Cowon D2
Post by: Yeeze on April 08, 2008, 09:29:00 AM
WOOHOOO
I got it compiled and I can see the usb connected screen =)

Browsing menus also works good!

Seems really nice...!
I will backup my player and then try to upload a completely flashed firmware using the usual update method
Title: Re: Cowon D2
Post by: Yeeze on April 08, 2008, 09:51:59 AM
Yeah it works!

Dual booting from flash...

OMG this is just awesome =)

A completely new world...!

Thanks shotofadds really nice work! Also thanks to all other contributors!
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 09:54:03 AM
If you're flashing the same version of the original firmware that you are already running (just patched with our bootloader) then your files & settings shouldn't* be affected. Make sure you only flash the new d2_patched.bin, don't use anything from the Cowon '0' or '2' folders.

*but still, a backup is never a bad idea. ;)

EDIT: Nice to see you got it working after all this time! You'll notice you can't do much at the moment, but still, some of the demos are cool and there's a Space Invaders game to keep you occupied...
Title: Re: Cowon D2
Post by: Yeeze on April 08, 2008, 10:36:43 AM
Yeah I already got caught in the space invaders game for like 20 minutes...
I should actually study history xD

The other demos are really cool too!

I noticed the debug screen got much slower... Is that because of the lowered cpu speed? Or is it that so much stuff is going on that this is fastest speed possible?

And the touchscreen input seems to be off when going near to the edges...
Can this be fixed easily? Well I think I will try play around a little with the touchscreen... Well lets see =)

Btw: Is the touchscreen now also timer driven? Or just the buttons?
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 10:52:25 AM
I noticed the debug screen got much slower... Is that because of the lowered cpu speed? Or is it that so much stuff is going on that this is fastest speed possible?
It's neither: the CPU cache appears to be disabled in the bootloader (when enabled it gives roughly a 15x increase in speed, so that's the effect you're seeing). I added a note about this to the wiki Known Issues list just this morning.

And the touchscreen input seems to be off when going near to the edges...
Can this be fixed easily? Well I think I will try play around a little with the touchscreen... Well lets see =)
There's not actually a touchscreen driver at all really, just a couple of lines of test code in the bootloader. Hence there's no calibration or jitter-correction whatsoever, so you get that slightly odd behaviour.

What you're currently seeing is not timer driven, but when the touchscreen driver is implemented "for real" it certainly will be.
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 12:13:51 PM
The dual-boot mechanism has changed to use the HOLD switch, because it seems the hardware will not boot from flash when any of other keys are pressed.

Press POWER for half a second (or less) then immediately set the HOLD switch. The Rockbox bootloader screen should then appear. If using Tcctool, ensure HOLD is set before uploading d2_patched.bin.
Title: Re: Cowon D2
Post by: cybergrind on April 08, 2008, 12:30:45 PM
sorry, i read about this after my post... :\
great work!

P.s. i think that we should define in config:
Code: [Select]
#define BOOTDIR "/.rockbox"
Title: Re: Cowon D2
Post by: Shady on April 08, 2008, 01:45:49 PM
You are making a great progress shotofadds, keep up the good work!  :o :D Thumbs up for other guys who are helping to make this port!
Last posts got me very excited and I would really like to test it on my D2/2Gb player. Unfortunately I don’t have any means to compile bootloader and patch it into OF. That’d be great if someone could compile bootloader and patch it into D2N.bin  for me. Any version of OF will do(2.5x/3.5x), I'm running v3.55 though. thanks in advance
Title: Re: Cowon D2
Post by: carsten on April 08, 2008, 02:12:20 PM
here you go: 3.55 with newest bootloader http://www.megaupload.com/?d=0281CH8X
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 02:18:37 PM
P.s. i think that we should define in config:
Code: [Select]
#define BOOTDIR "/.rockbox"
Yes, you're correct - I'll fix that. It won't cause any problems at the moment, since BOOTDIR is only used to check if the rockbox.iaudio file has been modified after USB unplug (and we have no USB support yet, so it's irrelevant).
Title: Re: Cowon D2
Post by: cybergrind on April 08, 2008, 02:41:22 PM
Sometimes rockbox is crashed and when I power on player - have error (can't find rockbox.iaudio)

Error with HWinfo: it seems that when we press menu button -- emulates double click: we close HWinfo and then load HWinfo again =) you can see that in txt-file reader (first i see this problem in txt-reader: when you press menu button - reader close, because first menu item - quit) You can close HWinfo if you fast press menu+plusbutton (some trainings help you).

Question: we generate keydown and keyup events? keypress = shoud be keydown + keyup. or keyup shouldn't generate keypress event.

sorry my tangled explanations

Another way: define power button for quit
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 03:10:48 PM
sorry my tangled explanations
No problem, I understand what you mean (in fact I listed the Hw Info problem on the Known Problems list on the wiki page (http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info#Known_Problems)). I fully expect to find more keymap problems like this. They will be fixed eventually.

The target-specific code in button-cowond2.c generates a raw 'snapshot' of the hardware button state at any given time. This is effectively turned into Key-down (press) and Key-up (release) events by logic in button.c, which is common to all targets.

The errors on startup (can't find rockbox.iaudio, read error, bad checksum) are unavoidable at the moment due to the unfinished NAND driver. To fix this, unzip the .rockbox folder to the player again and re-try.

Quote
Another way: define power button for quit
Yes, that is probably what I will do.
Title: Re: Cowon D2
Post by: Shady on April 08, 2008, 03:36:39 PM
Thank you carsten. Wow, it works well. I can navigate the menu, browse files, view images and text files, run plugins, and beside invadrox there’s a chopper game quite playable too!
Title: Re: Cowon D2
Post by: stel on April 08, 2008, 04:15:57 PM
When I try and use invadrox & a couple of the other plugins I'm getting Undefined instruction at 21F84220. Any idea what might be causing this?

Edit1:Also, when I try and run chopper I get Prefetch abort at 4000156A

Edit2: Thanks for the post below shotofadds. I compiled your latest update and installed. Happy to report its working as expected. I'll bare that in mind next time.
Title: Re: Cowon D2
Post by: shotofadds on April 08, 2008, 04:29:20 PM
Try the standard "fix" of unzipping the .rockbox folder again. It's possible that the flaky NAND driver has loaded corrupt plugin data into memory.

EDIT: Also try the pre-built zip I mentioned here (http://build.rockbox.org/dist/build-cowond2/rockbox.zip), just to ensure the problem is not something in your build environment.

EDIT2: I've now fixed the HW Info screen (use the power button to exit, just like every other screen does). And power off should work properly now. 8-)
Title: Re: Cowon D2
Post by: splitsch on April 09, 2008, 03:14:59 AM
Hello !
I'm glad to see that there are a lot of improvements :)

Is it possible to have a couple of screenshot, from text reading, or space-invaders?

You could send it to me, at "splitsch dot spam at gmail dot com".

Thank you very much !

I wrote a news about your progress on my blog (http://www.pastanque.be/splitsch/technologies/rockbox-et-le-cowon-d2.html), so the french community could read it, and I'd like to show people what has been done :)

Splitsch
Title: Re: Cowon D2
Post by: Bagder on April 09, 2008, 03:23:35 AM
You can do screendumps using the simulator as well, and it will show you the exact same screens/look as the actual targets use.
Title: Re: Cowon D2
Post by: shotofadds on April 09, 2008, 06:48:43 AM
In response to a question on IRC (I have no access at work other than reading the logs), here is my current thinking.

a) There is no touchscreen support at all at present, apart from a hacky debug screen.

b) I intend to create a set of 'virtual' keys to emulate a 5-way D-pad using the touschscreen (as per Llorean's suggestion earlier in this thread): BUTTON_TSC_LEFT, BUTTON_TSC_RIGHT, BUTTON_TSC_SELECT etc. These can then be used for plugin button mappings, etc.

c) I think the lists/WPS etc should use 'real' touch buttons if at all possible, which may require some redesign.

Discuss....
Title: Re: Cowon D2
Post by: cybergrind on April 09, 2008, 07:33:42 AM
IMHO:
Adding touchscreen support to themes is more difficult, but I think better than emulating buttons.
Touchscreen-buttons is good for some application - like text-reader, some games.



Title: Re: Cowon D2
Post by: cybergrind on April 09, 2008, 09:51:54 AM
For fixing MENU button change keymap-cowond2.c
Code: [Select]
   { ACTION_STD_OK,          BUTTON_MENU|BUTTON_REL,     BUTTON_MENU },
    { ACTION_STD_OK,          BUTTON_RIGHT|BUTTON_REL,    BUTTON_RIGHT },

    { ACTION_STD_MENU,        BUTTON_MENU|BUTTON_REL,  BUTTON_MENU },
Title: Re: Cowon D2
Post by: Yeeze on April 09, 2008, 03:06:58 PM
Hey there!

I want to coda a little demo plugin...

To test it I want to use the D2 simulator...

I downloaded the already compiled one...

But when I just try to start any plugin (e.g. "fire") I get "The executable or DLL ...\fire.rock is not a valid windows executable..." (This message was in german my translation might not be perfect).
And in rock box the message "Can't open .../fire.rock" is displayed...

How can I run plugins in the simulator?

I also tried to run the simulator under cygwin, but rockbox said "Can't open .../fire.rock"


On the "Rockbox UI Simulator" page it says:
Quote
Goal

To enable Rockbox application and plugin developers to test and debug their code and concepts on a host PC as a complement to running on target.

So it should be possible right?

PS: Right now I try to compile a simulator myself... But I don't think that it will fix it...
Title: Re: Cowon D2
Post by: andiator on April 09, 2008, 03:12:39 PM
I think, the first version should have key emulation only. There is still other stuff to be done.

But on the other hand...  ::)

- The touchscreen support may not affect other non touchscreen targets, so we can only expand existing features.
- In settings there should be an option to switch between virtual keys and direct touchscreen support
- There should be a touchscreen (or mouse?) press/release event with x and y position
- The WPS have to be extended to have interactive tags reacting to events with (x, y) positions with corresponding actions, like stop, start and my favourite ;D: choosing the position within the track. Then a backdrop with drawn buttons at right places - and we have a nice touchscreen support.
- For menu we need the position of the first visible item and the hight of one item.

The navigating in the menu is somewhat tricky. The items should be big enough to be used with fingers - a right theme will do.
Then the menu must be scrolled, for example with +/- buttons, select/open with M and back with power.
Tipp on the menu item would select it.

The simple gesture support would be very nice: moving finger down scrolls the menu down, the same for up direction: so the volume buttons are left for volume.
Moving finger to the right opens/selects the item, the left move is the back action.
Some plugin can have virtual keyboard...

Yeahh... that what I'm thinking/dreaming about at the moment :)
Title: Re: Cowon D2
Post by: Yeeze on April 09, 2008, 03:26:32 PM
I already made a little brainstorming about a keyboard design....

The keyboard consists of buttons with each having multiple charcters on them. To type you push the button and drag your finge in the dirction of the key...

In my example to type 'a' this would be first button second row, toch and drag to the top left side...

To type delete (del) touchvery right button on bottom row and drag to top...

and so on, so you can have big buttons but still all keys on the screen

Here layout examples (5x3 keys):

Code: [Select]
Normal Layout:
|1 2| |3 4| |5 6| |7 8| |9 0|
|q w| |e r| |t y| |u i| |o p|

|a s| |d f| |g h| |j k| |l ß|
|z x| |c v| |b n| |m æ| |, .|

|caps| | space bar | |entr| |del|
|spec| | space bar | |tab| |backs|


Capslock:
|! ?| |" '| |§ $| |& /| || ·|
|Q W| |E R| |T Y| |U I| |O P|

|A S| |D F| |G H| |J K| |L _|
|Z X| |C V| |B N| |M Æ| |; :|

|caps| | space bar | |entr| |del|
|spec| | space bar | |tab| |backs|


Special:
|1 2| |3 4| |5 6| |7 8| |9 0|
|( )| |* /| |% ^| |+ -| |= #|

|Ä Ö| |Ü ×| |{ }| |[ ]| |$ €|
|ä ö| |ü ÷| |< >| |« »| |¥ Ħ|

|caps| | space bar | |entr| |del|
|spec| | space bar | |tab| |backs|


Capslock + Special
|¹ ²|   |³ ¼| |½ ¬|   |Þ Ω|   |↑ →|
|@ ł| |~ ¶| |' `| |þ §| |← ↓|

|Ŋ °| |© Ł| |Ø ¦| |“ ”| |µ Ð|
|ŋ º| |® ª| |ø ĸ| |‘ ’| |ŧ ¢|

|caps| | space bar | |entr| |del|
|spec| | space bar | |tab| |backs|


It could be possible to create different layouts and save them, so every user can have a keyboard which fits their needs and expectations.

Put in code a we would have one button on a free definable x,y position, that can hold 'n' chars... Each char on this buttom has its ASCII value and an integer or float with one angle. This angle defines the dragging direction. In my scenario this would mean :
Example for button with "1, 2, q and w" on it:
Button positon: x,y
Char ASCII: '1' Angle 135°
Char ASCII: '2' Angle 45°
Char ASCII: 'q' Angle 225°
Char ASCII: 'w' Angle 315°

If you understand how I think of this....


But this can be discussed in more detail when the touchscreen is working right...
Title: Re: Cowon D2
Post by: andiator on April 09, 2008, 03:28:31 PM
I've compiled the sim in vmware image - it does work. I could start the "invaders", I only forgott the button mappings  :-[
Title: Re: Cowon D2
Post by: Yeeze on April 09, 2008, 03:39:10 PM
Well the build is finished and it works too!

I dunno why the downloaded version did not work...

Thx andiator for the fast feedback!
Title: Re: Cowon D2
Post by: aidy on April 09, 2008, 03:46:47 PM
I like the four on one keyboard idea, but i'd rather drag up down left and right instead of 45 degrees... I'm fairly sure it'll be much more natural?
could be wrong though :D
great to see lots of progress is made on the port, really can't wait to use rockbox on the d2!
Title: Re: Cowon D2
Post by: cybergrind on April 09, 2008, 03:53:10 PM
how I can define state of LCD (pressen or notpressed)?

Maybe it generates interrupt? or we can get state in memory? I saw example in bootloader, but in it we read x,y state every cycle.
Title: Re: Cowon D2
Post by: shotofadds on April 09, 2008, 03:55:21 PM
The 'touch' event comes as an interrupt from the PCF50606 chip (I believe it's signalled using the EXT3 IRQ, we then need to read the approproate data from the PCF interrupt registers). I'm still working on this, but I have other things on my mind at the moment....
Title: Re: Cowon D2
Post by: andiator on April 09, 2008, 04:46:54 PM
For all who wants to test the current build:

On my ftp server (found in my signature) you can find bootloader.bin to patch your OF version, patched bootloaders for 3.54 and 3.55 (rename those to d2N.bin) and rockbox.zip.
For patching the bootloader see the wiki. http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info
Don't blame me if something goes wrong, I tested it on my D2 8Gb OF 3.55 and had no problem.
Title: Re: Cowon D2
Post by: Yeeze on April 09, 2008, 06:35:24 PM
Is there a way to only compile the plugin I'm currently working on? Espacially for the Simulator!

Because right now I'm running make and afterwards make install, and that takes quite long just to debug...
Title: Re: Cowon D2
Post by: Chronon on April 09, 2008, 06:37:58 PM
I think you can use make rocks to only compile the plugins.

See here: http://www.rockbox.org/mail/archive/rockbox-dev-archive-2007-03/0039.shtml

I'm not sure how to only include just one plugin.  I guess you could just temporarily edit the SOURCES file?
Title: Re: Cowon D2
Post by: cybergrind on April 10, 2008, 07:45:54 AM
shotofadds -> where we defines interrupt handlers? in system-tcc780x.c?
Title: Re: Cowon D2
Post by: shotofadds on April 10, 2008, 08:20:33 AM
Interrupt handlers can be defined in any location, but ideally it should be inside a driver for the related functionality (eg. the ADC interrupt handler is implemented inside the ADC driver code).

Implement a function of type "void NAME(void)", whose name is one of those listed at the top of system-tcc780x.c (EXT0-3, ADC, etc). Assuming you have set the appropriate hardware enable bits (IEN, etc) it should be called automatically. See adc-tcc780x.c for an example.

On the D2 I think the EXT3 interrupt is used to signal events from the PCF50606, but this chip handles both power management and the touchscreen. Since the chip's primary purpose is power management, I think it's interrupt handler should be defined in power-cowond2.c.

I intend to do some work in this area at the weekend, hopefully we won't end up duplicating effort...
Title: Re: Cowon D2
Post by: cybergrind on April 11, 2008, 07:25:59 AM
I read datasheet (something understand =) and test some functions. I could try to implement LCD and Battery driver (both or one of them - choose from you) at this weekend.
I think that NAND driver is more important now.
Title: Re: Cowon D2
Post by: gnu on April 11, 2008, 11:36:35 AM
Is there a way to only compile the plugin I'm currently working on? Espacially for the Simulator!

Because right now I'm running make and afterwards make install, and that takes quite long just to debug...

I don't know how you can only complile one plugin, but you can skip the 'make install' when you write something like this:
Code: [Select]
cp apps/plugin/myplugin.rock archos/.rockbox/rocks/demos/myplugin.rockWith this code you only copy your plugin and not all the 'unchanged' pars of rockbox.
Title: Re: Cowon D2
Post by: shotofadds on April 11, 2008, 12:36:13 PM
I read datasheet (something understand =) and test some functions. I could try to implement LCD and Battery driver (both or one of them - choose from you) at this weekend.
I assume you mean "touchscreen" when you say LCD? The actual LCD driver already works... ;)

I think the battery level can be read using ADC1 (see Debug>Hw Info screen). It is just a matter of working out how to translate this value to an actual voltage.
Quote
I think that NAND driver is more important now.
Yes, it certainly is. You are more than welcome to take a look at that! ;D
Title: Re: Cowon D2
Post by: Yeeze on April 11, 2008, 01:07:06 PM
I don't know how you can only complile one plugin, but you can skip the 'make install' when you write something like this:
Code: [Select]
cp apps/plugin/myplugin.rock archos/.rockbox/rocks/demos/myplugin.rockWith this code you only copy your plugin and not all the 'unchanged' pars of rockbox.

Yeah, copying really saves some time..

But the "make rocks" command does not seem to have much effect on what is compiled... E.g. Codecs are still compiled... now it takes up to 5 minutes to build the simulator..

Well I think I will try to setup a faster environment....

First I need some free space on my disk...
Title: Re: Cowon D2
Post by: cybergrind on April 11, 2008, 01:31:17 PM
I assume you mean "touchscreen" when you say LCD? The actual LCD driver already works... ;)
you are right - touchscreen =)
Quote
Yes, it certainly is. You are more than welcome to take a look at that! ;D
I didn't view NAND datasheet yet =) I sure that i could write some code for pcf50606, but if you want write it - write=)
 cowond2 firmaware require a lot of code and i sure that find place for me ;)
Title: Re: Cowon D2
Post by: shotofadds on April 11, 2008, 01:46:03 PM
I didn't view NAND datasheet yet =)
The NAND datasheet won't help, as it describes the physical hardware only. The problem is understanding the low-level format (ie. the mapping from physical to logical blocks), which is proprietary and undocumented. The existing code is based on guess-work and magic, which is why it is not 100% reliable. :(
Title: Re: Cowon D2
Post by: cybergrind on April 11, 2008, 03:11:16 PM
I think the battery level can be read using ADC1 (see Debug>Hw Info screen). It is just a matter of working out how to translate this value to an actual voltage.

page 73 of pcf datasheet =)

Code: [Select]
int batStatus;
float voltage;
pcf50606_write(PCF5060X_ADCC2, 0x1); //0b00000001
pcf50606_read_multiple(PCF5060X_ADCS1, outStr, 2);
batStatus = (outStr[0]<<2 | outStr[1]& 3); //ADCDAT1H+ADCDAT1L
voltage = batStatus/1024.0*6.0;
snprintf(buf, sizeof(buf), "Battary voltage: %f", voltage);
lcd_puts(0, line++, buf);
But I can't write float, %f is not supports?
Title: Re: Cowon D2
Post by: shotofadds on April 11, 2008, 03:19:29 PM
I'm aware we can read the voltage from the PCF chip. But I think the same value may also be available direct from the TCC7801 ADCs. That way there's less overhead as there is no I2C read/write involved. A few tests will confirm whether this is true...

Remember that DAPs have no floating point hardware, so Rockbox has not been written to handle floats particularly well. It's probably best print the raw value and caculate it manually. ;D
Title: Re: Cowon D2
Post by: saratoga on April 11, 2008, 03:38:44 PM
I read datasheet (something understand =) and test some functions. I could try to implement LCD and Battery driver (both or one of them - choose from you) at this weekend.
I assume you mean "touchscreen" when you say LCD? The actual LCD driver already works... ;)

I think the battery level can be read using ADC1 (see Debug>Hw Info screen). It is just a matter of working out how to translate this value to an actual voltage.

Full charge it and the battery should be at 4.2 v.  Take the value it gives then and divide by 4.2 to get the voltage constant.
Title: Re: Cowon D2
Post by: cybergrind on April 11, 2008, 04:00:14 PM
1 brick in original firmware ~3.65V (if I correct count current value=)
what mean voltage constant? charge in percents (we should subtract minLow voltage, near ?2.7V)?

hacky code for voltage:
Code: [Select]
int batStatus;
int voltage;
pcf50606_write(PCF5060X_ADCC2, 0x1); //0b00000001
pcf50606_read_multiple(PCF5060X_ADCS1, outStr, 2);
batStatus = (outStr[0]<<2 | outStr[1]& 3); //ADCDAT1H+ADCDAT1L
voltage = batStatus*6000/1024;
int rest = voltage%1000;
snprintf(buf, sizeof(buf), "Battary voltage: %d.%d", voltage/1000, rest);
        lcd_puts(0, line++, buf);

I try to test
But I think the same value may also be available direct from the TCC7801 ADCs. That way there's less overhead as there is no I2C read/write involved. A few tests will confirm whether this is true...
it seems that we cannot read voltage wothout start ADC :\
Title: Re: Cowon D2
Post by: shotofadds on April 11, 2008, 05:19:38 PM
Reading the BATVOLT value from the PCF chip (using the simple formula in the datasheet) gives a reading of ~4.6v when charging from the AC adapter, ~4.1 with nothing connected, and ~3.8 when USB is connected. The battery is almost fully charged (full 4 bars in the OF). Can that be correct?

The value read from TCC7801 ADC1 is not affected by charger insertion, but does seem to rise and fall proportionally with the 'not charging' BATVOLT value. Any ideas what that might indicate?
Title: Re: Cowon D2
Post by: wahamir on April 11, 2008, 05:33:06 PM
Just to be sure. I think you don't understand all.

We cannot calculate the level of the battery with volt, because the volt value will always be the same. If you want to calculate the amount of electricity left in a battery, you need to use ampere.  

Hope that will help you still I can't help with the code and good job. I can't wait to have a rockbox firmware for my d2.

Title: Re: Cowon D2
Post by: Chronon on April 11, 2008, 07:23:43 PM
Just to be sure. I think you don't understand all.

We cannot calculate the level of the battery with volt, because the volt value will always be the same. If you want to calculate the amount of electricity left in a battery, you need to use ampere. 

Hope that will help you still I can't help with the code and good job. I can't wait to have a rockbox firmware for my d2.



That is true for an ideal voltage source.  Initially, the voltage of the battery will change very little since it can source enough current to maintain the voltage.  As a battery runs down it will not be able to produce enough electrons to maintain the potential difference for a given load. 

Surely you will agree that as a battery runs down the potential difference across its electrodes approaches zero.

---

I'm not terribly familiar with how the battery state gets characterized here.  I'm only pointing out that a battery is not an ideal voltage source.
Title: Re: Cowon D2
Post by: martink on April 12, 2008, 05:00:48 AM
I think, because the battery is not an ideal voltage source, we can use it for measurement, and we don't have to measure electric current (ampere):

the voltage becomes lower and lower, when the battery turns empty.
Title: Re: Cowon D2
Post by: cybergrind on April 12, 2008, 10:59:34 AM
blinking battery has voltage near 3.500V.

2 wahamir: that opinion not correct, because we use battery input through power supply chip, that controls voltage in player (pcf50606 need only 2.7V for work), and controls battery state using resistive divider (fig 57 in datasheet).

you can view battery voltage in HWinfo with this patch  FS#8878 (http://www.rockbox.org/tracker/task/8878).
I used formula two at page 73, maybe this more precise method. Message your max and min values for more accurate results.

NB! results not correct with usb-cable pluged.
Title: Re: Cowon D2
Post by: shotofadds on April 12, 2008, 12:28:13 PM
I've updated SVN to read the battery status (you can see the voltage in Debug > View battery, and then press +). It's not calibrated yet, so the battery icon may well show incorrect information (and the "estimated runtime" is certainly wrong).

Inserting a USB cable or the AC-adapter will affect the voltage reading. I'm not sure what is the best way to compensate for this.
Title: Re: Cowon D2
Post by: cybergrind on April 12, 2008, 12:45:18 PM
since results of two measurements is too different, we should use average value, for more precise values.

and, maybe, measure in such way:
Code: [Select]
pcf50606_write(PCF5060X_ADCC2, 0x3); //0b00000011 read subtractor
....
current_voltage = adc_val*2400/1024+3000; //with this formula we can't use BATTERY_SCALE_FACTOR

and I didn't sure, that we should get battery voltage, when plugged USB or DC
Title: Re: Cowon D2
Post by: shotofadds on April 12, 2008, 02:20:15 PM
As I understand it, the Rockbox UI already averages the battery measurements. So there's no need to do that inside the driver.

I have no particular opinion on which battery-reading method is best: we could use either of the two values from the PCF, or adc_read(1). I just used the simplest to work out, as I don't think it's too critical at the moment.

Maybe we should do some more tests....
Title: Re: Cowon D2
Post by: JdGordon on April 13, 2008, 12:38:49 AM
hey,
So I've started fiddling with the touchpad on the mr500 and have started working on the touchscreen button keymap. I've split the screen up into a 3x3 grid so we have 9 buttons (I've been told the D2 should be big enough to do the same).

attached is the patch which is mostly mr500 specifc but hopefully shows how I tihnk the touchpads should work...

there is a function set_touchpad_mode() which lets screens change between stylus and button mode. in button mode the regular leymap files will be used. in stylus mode the screen will have to figure out what the user pressed....

for the keymaps would it make sense to use one file for both touchpad targets, although it looks like we will have to add a bit of #ifdeffing for the 2 targets because the mr500 only has one real button while the d2 has 4 (the remote keymap for the mr500 will stay in a seperate file to make it a bit cleaner)?

as for the mappings themselves... this is what I have so far (and from my 30s of testing it seems to work)
up/down is top and bottom center. select is middle. cancel is bottom right, menu is top left, contect menu is hold select


edit: attachment updated to include sim fixes... the numpad buttons are used for the 9 touchpad buttons (D2 sim probably wont ocmpile with this change though....) and the sim will convert mouse -> button depending on the touchpad mode like the target should.
Title: Re: Cowon D2
Post by: shotofadds on April 13, 2008, 08:06:41 AM
Yep, the D2 screen should be big enough for 9 'button' areas, assuming you don't have MASSIVE fingers. ;D

I'm not sure if combining the keymap files is a good idea - for example it should also be possible to use the D2's physical buttons to navigate menus and operate basic screens. IMHO that could lead to a huge mess of #ifdef's if and when any more touchscreen targets come along.

I think all screens (& plugins) should default to 'button' mode unless they explicitly ask for 'touch point' mode, so I'm not sure there's any need for a setting in the menus.

I'll try to concoct a D2 touchscreen driver to work with this patch over the next few days. I'm having some trouble with interrupts from the PCF chip at the moment (it all stops working after ~30 seconds) so I might need to do some creative thinking first...

ps. (minor niggle) doesn't Rockbox generally use UK English? BUTTON_CENTER grates slightly here. ;)
Title: Re: Cowon D2
Post by: JdGordon on April 13, 2008, 08:27:10 AM
well, the D2 only has 4 real buttons right? and the mr500 only has 1, so I dont think the extra ifdefs would be such a big problem (certainly less painful than keeping the touchpad keymaps in sync, which they should be).

yeah, screens should default to setting the button mode unless they are specifically set up for stylus mode.
The lists though could do with a setting to choose which mode (seen as both work now), and the wps would also need a setting (I have an idea how to do stylus mode there, and there is a patch somewhere, but its being held out of svn untill one of the targets gets playback going).

as for CENTER/RE, yes, I couldnt remember which is which... I prefer UK english also, I'll change it.
Title: Re: Cowon D2
Post by: Llorean on April 13, 2008, 12:13:27 PM
Possibly "Touchmaps" should be kept separate from "Keymaps" in some way, so the touchscreen can be kept in sync, but the buttons can be handled independently?
Title: Re: Cowon D2
Post by: JdGordon on April 13, 2008, 08:31:55 PM
not sure what you mean by that...

What I was saying is that we should force touchpad targets to have a common button mapping for the touchscreen to make everything easier.. (1 manual, 1 keymap file, easier to move between targets, etc). sure they will all have differences, but we can either use #ifdef TARGET, or use the keymap system to check for touch buttons first then move to the target keymap.c file for its real buttons (which I don't think is needed while we only have 2 touchpad targets...)
Title: Re: Cowon D2
Post by: Llorean on April 13, 2008, 08:35:58 PM
Your second suggestion is more or less what I was trying to propose. I think it's probably not a bad idea to assume we'll have more touchscreen targets (PDAs if as-an-app happens, for one), so treating the touchscreen controls as something completely separate from the keymap defines (since there's really only ever going to be one set of maps for the touchscreen, while physical buttons will always vary by target).
Title: Re: Cowon D2
Post by: linuxstb on April 13, 2008, 10:22:28 PM
as for CENTER/RE, yes, I couldnt remember which is which... I prefer UK english also, I'll change it.

The convention is to use US English for C symbols, and British English for user-visible text.  So in this case it should be BUTTON_CENTER (but referred to as "centre" in the manual and any LANG strings).
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 03:36:17 AM
did a bit more work on this today.

keymap-touchpad.c is shared and only deals with the touchpad codes.. what should happen is the action code goes through that file, then if the button hasnt been found it goes to the tartgets keymap file.. seems to work but not fully tested.
Title: Re: Cowon D2
Post by: Yeeze on April 14, 2008, 06:33:45 AM
I am not sure but I think when talking about the controls, we might also consider "gesture" support...

There is no need to implement the recognition now, but we should think about the defines to keep them in the keymap or so...
Title: Re: Cowon D2
Post by: Llorean on April 14, 2008, 06:37:39 AM
Rockbox already has the ability for actions to be defined as "one  button preceded by another button" as far as I know. This should at least allow for very simple gestures (center to left, center to right, top-middle to center) with the 3x3 grid style button map, with a lot less work (I would *guess*) than a complex full gesture system would require, and could probably cover the majority of jobs you'd want to do with it.
Title: Re: Cowon D2
Post by: cybergrind on April 14, 2008, 06:55:32 AM
IMHO: we have combinations of two buttons (if you about keymaps), but, maybe we need more (eg. left->right gesture should contain mid-left, mid-center, mid-right or top-... or bottim-...).
more simple method - define gestures like vectors, not combinations of two or more buttons, when we have start point, angle, end-point - in simple gestures.

and conceptions with TS-buttons didn't contain such features as drag-n-drop, selection of item or selection of area... but it more simple in implementation =)
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 07:00:28 AM
the grid buttons are more being used to quickly get the touchpad working in all screens. If gestures happen they would most likly be done in the stylus mode, although depending on a few things simple left<->right and up<->down could work in button mode.
Title: Re: Cowon D2
Post by: Llorean on April 14, 2008, 07:03:57 AM
I think, for example, in the WPS, anything "left center" could be "seek backward" while a gesture from "center center" to "center left" could be "previous track". With a 3x3 grid, you have 12 intersections between the grid blocks. As long as you actually can treat is as _PRE so that going from one block to another works, you can add a lot of "gesture"-like functions.
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 07:09:56 AM
the _PRE stuff shouldnt be a problem at all... I'm more concerned with how offten the touchpad sends its buttons... I think it might actually be too slow to work reliably...

also diagnal gestures are almost certainly out of the question using this method...

shotofadds: (and really anyone i guess)... does this look workable and should it be commited? and should the BUTTON definitions be put in button.h instead of button-target.h to make sure all touchpad targets setup the correct button defines?
Title: Re: Cowon D2
Post by: Llorean on April 14, 2008, 07:13:31 AM
I'm not saying something more complex shouldn't be worked on if there's a real place for it in Rockbox, but at the same time, with 12 additional "buttons" from just the vertical and horizontal gestures on a 3x3 grid, you probably run out of features before you run out of jobs.

As for the touchpad driver being too slow, do you mean you're afraid someone might move the stylus too far, and perhaps go from "Top Right" to "Top Left" without it picking up "Top Center" at all?
Title: Re: Cowon D2
Post by: cybergrind on April 14, 2008, 07:20:52 AM
why touchscreen driver should work slow?
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 08:03:26 AM
As for the touchpad driver being too slow, do you mean you're afraid someone might move the stylus too far, and perhaps go from "Top Right" to "Top Left" without it picking up "Top Center" at all?

yes, well no... umm... how it works on the mr500 is that touchscreen stores each press as they come in, but the actual button driver doesnt poll very often (realtivly), in combination with cpu speed and threading I'm not sure how reliable it will be.. but remember, this is all without doing any testing on either target so I could be wrong.
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 09:04:51 AM
woo :D it works...
the touchscreens now have 21 "buttons" :p

so now lets drop this subject and just deicde if we want this code in or not... we can discuss how to use the buttons in another thread
Title: Re: Cowon D2
Post by: shotofadds on April 14, 2008, 09:34:34 AM
I haven't had time to have a proper read of the code, but if it works I say get it in and tweak later, if necessary.

I spent yesterday attempting to get some sound out of the D2 (unsuccessfully), but I might hold off that for a while and get the touchpad working first.

If the button driver is going to be polling the touchscreen, I needn't worry about having the pen-down event driven from an interrupt. Which is handy, as it doesn't seem to be too reliable. :-\
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 09:43:02 AM
.. sound is more important :p

the button driver calls button_read_device() and yeah when the mr500 port started we were polling the touchpad directly from it, works much better using an interrupt and storing the last press value somewhere and just returning that in button_read_device()
Title: Re: Cowon D2
Post by: JdGordon on April 14, 2008, 10:57:20 AM
very minor update... this has scrolling gestrures which dont work so well if you stop/start in the middle... I'll probably comment them out when its commited though...
Title: Re: Cowon D2
Post by: JdGordon on April 15, 2008, 06:37:43 AM
ok, commited... hope I havnt mangled your local tree too much :) I'll start a thread in UI for discussion on how to actually use the extra buttons.

OH crap... forgot to mention I changed the sim buttons... kp-/+ for -/+... kp_enter for menu and escape for power...
Title: Re: Cowon D2
Post by: shotofadds on April 15, 2008, 07:19:26 AM
Hmmm - maybe I should have held off enabling plugin building... someone's got a large search-n-replace exercise to do now. ;)

I'll have a go at getting the touchpad working later, but it'll probably only be a quick hack as it turns out I don't have much free time this week after all.

(btw. your sim keymappings seem far more logical than the mess I made first time around...)
Title: Re: Cowon D2
Post by: andiator on April 19, 2008, 07:00:49 AM
Hey, I can do this "search-n-replace" stuff! What exactly have to be changed?
Title: Re: Cowon D2
Post by: shotofadds on April 19, 2008, 08:43:02 AM
I've re-opened FS#8708 (http://www.rockbox.org/tracker/task/8708) with a few comments about how I think the plugin button definitions should be implemented.

EDIT: ..and I've added a patch to it as well, which should let you experiment with the touchpad on the device. It's not perfect yet (far from it) but it does mean some more of the games are playable - eg. jewels, brickmania etc.
Title: Re: Cowon D2
Post by: shotofadds on April 22, 2008, 08:03:32 AM
/me wonders if anybody tried that touchscreen patch, it's awfully quiet in here...

EDIT: /me should really learn to type :-\
Title: Re: Cowon D2
Post by: Shady on April 22, 2008, 01:18:52 PM
Could you post here a link to rockbox.zip?
Title: Re: Cowon D2
Post by: shotofadds on April 22, 2008, 01:43:50 PM
Shady, there's a link to the "bleeding edge" build zip (http://build.rockbox.org/dist/build-cowond2/rockbox.zip) on page 17 of this very thread (reply #249). That means it'll be automatically rebuilt whenever the SVN code changes. However, it doesn't include the touchscreen changes yet.

EDIT: I'll add a link to the wiki page shortly. (it's there now).
Title: Re: Cowon D2
Post by: stel on April 22, 2008, 02:31:18 PM
shotofadds, I've just applied the patch. Initial tests tell me its working fine in the menus so far. Sometimes its a bit jumpy (might be I'm catching the wrong button sometimes). I'm just trying some of the plugins now.
Title: Re: Cowon D2
Post by: crashdebug on April 22, 2008, 04:33:38 PM
shotofadds: I've tried the touchscreen patch just after you posted it - I think I can confirm what stel said about the jumpy behavior, for me it seems to register a "left" press when repeatedly touching the "up" or "down" area to scroll a long list (the list of games e.g.). Apart from that it works pretty well and is very useful for playing with the plugins.

Even though this is my first post, I've followed this thread from it's beginning - I'd love to contribute to the D2 rockbox porting efforts, but I'm awfully short of free time at the moment. Need to have a good look at the datasheets if I get some time.
Title: Re: Cowon D2
Post by: shotofadds on April 22, 2008, 06:33:43 PM
I think what I'll do is commit the patch as it stands, then at some point in the future "someone" can write a test_touchscreen plugin (or suitably extend the debug menu) so that these issues can be debugged more easily.

The mis-placed "clicks" are annoying, but not really my priority at the moment. Of course everyone is welcome to take a look ;-)
Title: Re: Cowon D2
Post by: andiator on April 23, 2008, 05:03:40 PM
I am done with replacing the button definitions, at least  :)
It was a little bit more than I thought. I had to think what I'm doing. I mean the mappings should be somewhat usefull  ;D
So a few more plugins are usable, for example blackjack, chessbox, calc and possibly some more. Tested only with sim.
One of the problems is if you control a plugin, the fingers hide some part of the screen  :(
Title: Re: Cowon D2
Post by: shotofadds on April 24, 2008, 03:49:50 AM
Much appreciated, I'll take a look later today.

One of the problems is if you control a plugin, the fingers hide some part of the screen  :(

This is actually a real problem - try playing brickmania (arkanoid) for example. It certainly adds another element to the gameplay! (Although that specific example could probably more easily be mapped to the physical buttons)

The D2 is never going to be much of a gaming platform...  ;D
Title: Re: Cowon D2
Post by: 007quick on April 24, 2008, 05:25:54 AM
could this problem not be fixed by shrinking the screen size of the game itself?  Leaving the outside to be used for buttons.  Great work btw!
Title: Re: Cowon D2
Post by: ThibG on April 25, 2008, 04:30:05 AM
Hello, I have bought a Cowon D2, 1 year ago...
The original firmware is ok, but there is little bugs, and it's not free, so I tried Rockbox.
It's quite impressive to see it working!
The navigation is somewhat strange, but I hope it'll come with the touchscreen support :)
Of course, it'll better with sound output and write access to the flash memory, but it's nice to play some games (those which don't need too many buttons) and watch the demos :P
Unfortunatly I don't think I can help much, but I'll try Rockbox from times to times.
Title: Re: Cowon D2
Post by: shotofadds on April 25, 2008, 04:36:48 AM
Wait a few days and you'll be able to use the touchscreen - then many more of the games will be playable. (Referring to the above posts, of course plugins can be adapted for the touchscreen, but that needs interested people to implement those changes).
Title: Re: Cowon D2
Post by: ThibG on April 25, 2008, 04:51:20 AM
ok, nice!
And will the main UI be adapted for the touchscreen?
I'll read some source code and see if I can understand how it works :P
One other thing, doom didn't work at all (I've put rockdoom.wad and freedoom as doomf.wad): stuck at "Starting Graphics engine".
Title: Re: Cowon D2
Post by: shotofadds on April 25, 2008, 05:10:06 AM
And will the main UI be adapted for the touchscreen?
Eventually, maybe. Right now you can use the touchscreen for up/down/left/right/select in the menus, but that's just about all.

Quote
One other thing, doom didn't work at all (I've put rockdoom.wad and freedoom as doomf.wad): stuck at "Starting Graphics engine".
Not everything can be expected to work right away! ;)
Title: Re: Cowon D2
Post by: andiator on April 27, 2008, 08:48:47 AM
Have troubles applying the d2-touchpad-v2.diff, getting while building the bootloader  :(:

telechips.c:67 error: too few arguments to function 'button_read_device'
telechips.c:195 error: too few arguments to function 'button_read_device'

normal build is ok
Title: Re: Cowon D2
Post by: shotofadds on April 27, 2008, 09:38:35 AM
The touchpad patch defines HAVE_BUTTON_DATA, which means button_read_device() now takes an output parameter. But I forgot to include the necessary bootloader change in the patch...

Anyway, I've committed that patch to SVN now, so there should be no more trouble with that. I'll commit your keymap changes later, too. 8)
Title: Re: Cowon D2
Post by: andiator on April 27, 2008, 09:55:37 AM
Please wait with commitiing my patch for half an hour, I made some changes to get one or two plugins working

Edit: so I'm done with patch. It's nice to see the plugins working with touchpad  :)

Sidenode: HOLD-Button doesn't really hold the touchpad, but changes the behaviour of the plugins, so it is not possible to start brickmania in it's menu  if the HOLD-button is on.

(Updated bynaries on FTP (touchpad-stuff), but again, it's only for testing!)
Title: Re: Cowon D2
Post by: Shady on April 27, 2008, 01:52:45 PM
andiator, can you change button mappings for pacbox plugin? Because it's gamescreen is turned 90 degrees CW, so UP should be LEFT, LEFT -DOWN, DOWN - RIGHT and RIGHT - UP. Its hard to play the game with current key mappings :-[
Title: Re: Cowon D2
Post by: andiator on April 27, 2008, 02:35:45 PM
Hi Shady,
of course I can, but I can't commit the source, would new rockbox.zip be ok?
(Ok, rockbox.zip is updated)
Title: Re: Cowon D2
Post by: Shady on April 27, 2008, 03:02:42 PM
of course it'll be ok, andiator, thanks! Gotta play more with the plugins :)
Title: Re: Cowon D2
Post by: shotofadds on April 28, 2008, 04:59:10 AM
If you make changes to a particular plugin's mappings, upload your patch to a new task on Flyspray so that someone with commit access can get your fixes into SVN. Thanks! :)

(but please don't raise D2 bug reports on the tracker - it's not a supported target yet)
Title: Re: Cowon D2
Post by: splitsch on April 28, 2008, 11:52:55 AM
Hello!
I've downloaded the last *.zip of this fw.

How can I enable it, in dualboot with he existing firmware?

Thanks
Title: Re: Cowon D2
Post by: martink on April 29, 2008, 02:46:55 AM
Look here:
http://www.iaudiophile.net/forums/showthread.php?t=20661&page=4
at 04-10-2008, 10:10 AM
Title: Re: Cowon D2
Post by: JdGordon on April 29, 2008, 02:49:31 AM
why the heck are you linking to iaudio forums to a post which links back to this thread?!
Title: Re: Cowon D2
Post by: martink on April 29, 2008, 03:22:41 AM
Excuse me, but for me the "step by step installation" from Hupy seems to be useful.
Title: Re: Cowon D2
Post by: Llorean on April 29, 2008, 03:24:02 AM
Or you could just link him to the information in our wiki. The information he could've found if he'd searched like required to by the guidelines. http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info
Title: Re: Cowon D2
Post by: Shady on April 29, 2008, 03:11:15 PM
oops! Sorry andiator, guess I've mixed up the controls. They are flipped now, i mean the up is down and the left is right ;D Anyway it is better now than before ;)
Title: Re: Cowon D2
Post by: andiator on April 29, 2008, 04:22:27 PM
Ok, updated rockbox.zip again.
Title: Re: Cowon D2
Post by: JdGordon on April 30, 2008, 07:27:42 PM
shotofadds: I dont think I have your email so ill comment on the touchpad test plugin here...

its more of a general issue than anything for the actual plugin..
1) use SOURCES for hhte #ifdef HAVE_TOUCHPAD instead of wrapping the whole .c file in them
2) always add functions to the end of the plugin api or you break builds unless a full rebuild is done.
3) "intptr_t button_data;   /* why intptr? */"  because void* and int are different sizes on 64bit sim builds, so this stops the warnings
4) there is no way to switch between stylus and button mode?

other than that, it looks good...

http://www.pastebin.ca/1003385 for those having no idea what im talking about
Title: Re: Cowon D2
Post by: shotofadds on May 01, 2008, 06:22:20 AM
As it's a test_* plugin it'll rely on people manually adding it to SOURCES, so I'll remove those HAVE_TOUCHPAD ifdefs - they're rather pointless.

I don't really understand "add functions to the end of the plugin api or you break builds unless a full rebuild is done". Surely the very act of updating plugin.h causes all plugins to be rebuilt?  (but that's rather off-topic for this thread I guess...)

As for the intptr_t, I wasn't sure why button_get_data returns a pointer type at all - surely it's just a 32 bit int (int32_t or somesuch?)

I'll add a switch for the stylus mode (can you suggest a button mapping for the m:robe?) and then we're in business.

This plugin has already shown up a couple of issues on the D2:

1) Touching on/near the 'line' between two areas causes jitter between the two adjacent rectangles. This causes a stream of distinct button presses.

2) Small, slow movements are shown with a fast update rate, but faster movements are shown with a really slow update rate (is this the HZ/5 thing?)

3) A continuous movement of the stylus seems to work fine, but when used for individual button presses I occasionally get a 'random' extra button event, before the actual press.

Do you see any of those things with the m:robe?
Title: Re: Cowon D2
Post by: JdGordon on May 01, 2008, 07:01:26 AM
void* is usually used to just say "random data... no real type.." but yeah, we could have used int32_t or something.. but its there now..
yes, plugins get rebuilt, but there is a mechanism where if you only update the rockbox.target file plugins of older revisions will still load if the API versions are compatible... adding funcitons in the middle of the struct breaks that.

BUTTON_RC_MODE would be ideal...

1) yeah, i noticed that also, i think we need to add a error margin around the joins, or something
2,3) not realy sure what your mean...

I havnt tested the plugin yet and wont be able to till next week unfortunatly.
Title: Re: Cowon D2
Post by: saratoga on May 01, 2008, 10:37:40 AM

I don't really understand "add functions to the end of the plugin api or you break builds unless a full rebuild is done". Surely the very act of updating plugin.h causes all plugins to be rebuilt?  (but that's rather off-topic for this thread I guess...)


I think that since files include headers, rather then headers including other files, changes to .h files do not propagate down to the files that include them automatically. 
Title: Re: Cowon D2
Post by: shotofadds on May 01, 2008, 11:37:39 AM
I think that since files include headers, rather then headers including other files, changes to .h files do not propagate down to the files that include them automatically. 

I don't think that's right, eg. a change to plugin.h causes "make rocks" to rebuild every plugin.

But then again, if there's a "best practise" for this kind of thing, let me know as this is the first time I've done any changes in this area.
Title: Re: Cowon D2
Post by: kugel. on May 01, 2008, 05:32:56 PM
About the plugin API stuff. The plugins get rebuilt, sure, but only if you make a full build.

If you only do "make bin", the plugins are not built.

make bin is very much faster and is very usefull, especially when plugins/plugin api do not change.

The version number is just to make older plugins work with newer rockbox.target files.
So, if you put new functions to the end, old plugins will still work. If you put the into the middle, old plugins will mess up.

To make old plugins work, you need to put it to the end, until you choose to increase the plugin api version number. Then plugins will error and need to be rebuilt. That's allways a good situation to reorganize the api functions.
/me hopes that was correct.
Title: Re: Cowon D2
Post by: shotofadds on May 01, 2008, 06:21:35 PM
Sounds about right. Here's version 2 of test_touchpad, which should address those comments: http://www.pastebin.ca/1004398

jdgordon: I noticed one more thing: in stylus mode, the button_data doesn't seem to contain the x/y values for BUTTON_REL events. Is that intentional? It's not very useful if so...

And no, I don't know why I didn't use the tracker for this patch... ???
Title: Re: Cowon D2
Post by: JdGordon on May 01, 2008, 10:03:09 PM
jdgordon: I noticed one more thing: in stylus mode, the button_data doesn't seem to contain the x/y values for BUTTON_REL events. Is that intentional? It's not very useful if so...

the BUTTON_REL event is not a real one.. its sent from the general button driver... if its really needed we probaly could fix it to include the button data though
Title: Re: Cowon D2
Post by: x5062 on May 07, 2008, 08:36:39 PM
I'm a Korean D2 user,  so I can't English well. I already Installed rockbox in my D2, (my d2 is 2Gb dmb version, 1.55 firmwear.

In my cafe(http://cafe.naver.com/d2d2d2.cafe) , Somebody uploaded the 1.55 firmwear + Rockbox bootloader.

it is 1.55 public firmwear(http://mfiles.naver.net/508765b0abfb9c29055c/data30/2008/5/8/269/d2.bin), about 3.65 mb

and it is patched 1.55 firmwear(http://mfiles.naver.net/6dba588d96c6a1173f5f/data31/2008/5/8/129/d2_patched.zip)about 1.8mb

you know, now rockbox firmwear has a lot of problem(It's not  complete yet?)

1. Can't read SD/MMC card.
2. some plugin is failed. (doom, rockboy, notepad. etc)
3. booting is often show the "file not found", "bad checksum" . bad checksum error's solution = first booting public firmwear, and get off sd card nd put in sd card. so the rockbox booting well
4.Can't save the config-setting.
5. the battery decrease very fast.
6. Can't play the music, movie
7. touch screen often failed
... etc

so I just using rockbox firmwear to confirm the battery ....  :P ...I'm so sad


Ps. oh, I'm sorry, the rink is wrong.
 http://cafe.naver.com/d2d2d2/492390 <- you can see  d2_patched.zip file and d2n_patched.zip file in this rink.
Title: Re: Cowon D2
Post by: davidw89 on May 07, 2008, 10:19:26 PM
Could you install firmware 3.55 and give it a shot?

By the way, what kind of knowledge is required to port Rockbox successful to Cowon D2? Seems like a lot of stuff need to be done in regard to the user interface (being a touchscreen) and themes.
Title: Re: Cowon D2
Post by: Llorean on May 07, 2008, 10:28:38 PM
Themes really have nothing to do with porting.
Title: Re: Cowon D2
Post by: shotofadds on May 08, 2008, 04:20:44 AM
you know, now rockbox firmwear has a lot of problem(It's not  complete yet?)

1. Can't read SD/MMC card.
2. some plugin is failed. (doom, rockboy, notepad. etc)
3. booting is often show the "file not found", "bad checksum" . bad checksum error's solution = first booting public firmwear, and get off sd card nd put in sd card. so the rockbox booting well
4.Can't save the config-setting.
5. the battery decrease very fast.
6. Can't play the music, movie
7. touch screen often failed

It's not complete yet - you can see the current status at the CowonD2Info (http://www.rockbox.org/twiki/bin/view/Main/WebHome?topic=CowonD2Info) wiki page. In particular: "NOTE: The current Rockbox build is not functional - it is not in any way a replacement for the Cowon firmware. The following installation instructions are intended for a developer/test audience only."

But we are working on it (slowly) ;D

By the way, what kind of knowledge is required to port Rockbox successful to Cowon D2? Seems like a lot of stuff need to be done in regard to the user interface (being a touchscreen) and themes.

The user interface is a secondary concern really, it works "well enough" already. The most important thing we need now is a good low-level understanding of the hardware and existing Cowon firmware, so that we can implement a more reliable driver for the internal flash and start working on sound output.

Unfortunately the only way to do this is via experimentation and disassembly of the original firmware. So the key skills are C, ARM assembly and most of all, patience.
Title: Re: Cowon D2 - I have some question
Post by: x5062 on May 08, 2008, 05:30:57 AM
if the rockbox firmwear become perfect, should I using the .bin patch file? or just change(copy) .rockbox folder and file?
Title: Re: Cowon D2
Post by: shotofadds on May 08, 2008, 05:37:36 AM
The patched .bin (ie. the bootloader) only needs to be updated if there are significant changes. For example, if we improve the NAND driver to remove the "bad checksum" errors.

For other changes, eg. plugins and other general updates, just the .rockbox folder should be enough.
Title: Re: Cowon D2
Post by: AlexP on May 08, 2008, 05:58:37 AM
if the rockbox firmwear become perfect, should I using the .bin patch file? or just change(copy) .rockbox folder and file?

When it becomes ready for non-developers, there *will* (:)) appear a manual with full installation instructions.  :)
Title: Re: Cowon D2
Post by: shotofadds on May 21, 2008, 05:34:10 PM
I've made a change to the NAND driver, which may or may not improve reliability slightly (eg. the File Not Found, Read Error, Checksum Failed errors on boot). To test this, you'll need to compile and update both the bootloader and main build.

I'd appreciate if some of you guys could try out the new version over a period of time and report back in a few days whether the latest version is better, worse, or not much different to the existing version. Hopefully we'll see some improvement overall.

With this version I can unzip rockbox.zip to the player and boot into Rockbox straight away, without errors (most of the time!). No messing around 8)

ps. Apologies for the lack of updates recently, I've been rather busy in Real Life(tm) recently and I need a break!
Title: Re: Cowon D2
Post by: adamorjames on May 21, 2008, 10:12:43 PM
I get errors like "File not found" and such when using the new rockbox.zip. It works when I replace the iaudio file the first time usually.
Keep up the great work shotofadds.
Title: Re: Cowon D2
Post by: Bkd11 on May 22, 2008, 02:15:20 AM
Great job shotofadds. Boots everytime for me so far after making the new bootloader (d2_patched.bin), even with the last version of rockbox.zip I have the 8gb version by the way.

I'm still using the build (rockbox.zip) that andiator posted in Reply #352 because is has the correct pacbox control mappings. With svn version, right = down and left = up. Mabey andiator can post a patch so someone can commit it to the svn.

Thanks for all your work.
Title: Re: Cowon D2
Post by: shotofadds on May 22, 2008, 03:35:42 AM
I get errors like "File not found" and such when using the new rockbox.zip. It works when I replace the iaudio file the first time usually.
Did you upgrade the bootloader as well, or just rockbox.zip?

I'm still using the build (rockbox.zip) that andiator posted in Reply #352 because is has the correct pacbox control mappings. With svn version, right = down and left = up. Mabey andiator can post a patch so someone can commit it to the svn.
Yeah, a patch would be appreciated - it'd be good to make sure things like this get committed. I'd fix the pacbox mappings myself, but I don't have the ROMs to confirm they are correct.
Title: Re: Cowon D2
Post by: andiator on May 22, 2008, 05:39:03 AM
It was/is busy time for me too. Too much to do in my project, the next test is in the end of the next week and all people you (me) need have vacation  ???
But well, that's life...

I don't want to post a new patch only because of four lines that are different, so I'm posting it here  :P , could anyone commit this please?

found in apps/plugins/packbox/pacbox.h:142

#ifdef HAVE_TOUCHPAD
#ifndef PACMAN_UP
#define PACMAN_UP       BUTTON_TOPMIDDLE
#endif
#ifndef PACMAN_DOWN
#define PACMAN_DOWN     BUTTON_BOTTOMMIDDLE
#endif
#ifndef PACMAN_LEFT
#define PACMAN_LEFT     BUTTON_MIDLEFT
#endif
#ifndef PACMAN_RIGHT
#define PACMAN_RIGHT    BUTTON_MIDRIGHT
#endif
#ifndef PACMAN_1UP
#define PACMAN_1UP      BUTTON_BOTTOMLEFT
#endif
#ifndef PACMAN_2UP
#define PACMAN_2UP      BUTTON_BOTTOMRIGHT
#endif
#ifndef PACMAN_COIN
#define PACMAN_COIN    BUTTON_CENTER
#endif
#ifndef PACMAN_MENU
#define PACMAN_MENU    (BUTTON_TOPLEFT|BUTTON_REL)
#endif
#endif



[Edit1] updated ftp (new rockbox version + new patched original FW 2.57 and 3.57)
[Edit2] sorry, the ftp update gone completly wrong, I'm on it
[Edit3] the ftp is working again, the problem was, the files had the windows line end character in the names (???) like this: d2N...bin'\r', because I changed my patching script with windows editor...
Didn't know it's possible...
Title: Re: Cowon D2
Post by: shotofadds on May 22, 2008, 06:03:43 AM
It was/is busy time for me too. Too much to do in my project, the next test is in the end of the next week and all people you (me) need have vacation  ??? >:(
But well, that's life...

I don't want to post a new patch only because of four lines that are different, so I'm posting it here  :P , could anyone commit this please?

No problem, I'll commit it later today (assuming nobody else does it first). Thanks!
Title: Re: Cowon D2
Post by: adamorjames on May 22, 2008, 08:11:53 AM
Yeah, I was using an old bootloader. With the newest bootloader it works without error. Also, the plugin Doom doesn't give me lots of  errors anymore (though it stops at "Starting Graphics engine"). Pretty nice. I'm using a 4GB D2 by the way.
Title: Re: Cowon D2
Post by: Bkd11 on May 23, 2008, 10:41:07 AM
It was/is busy time for me too. Too much to do in my project, the next test is in the end of the next week and all people you (me) need have vacation  ???
But well, that's life...

I don't want to post a new patch only because of four lines that are different, so I'm posting it here  :P , could anyone commit this please?

found in apps/plugins/packbox/pacbox.h:142

#ifdef HAVE_TOUCHPAD
#ifndef PACMAN_UP
#define PACMAN_UP       BUTTON_TOPMIDDLE
#endif
#ifndef PACMAN_DOWN
#define PACMAN_DOWN     BUTTON_BOTTOMMIDDLE
#endif
#ifndef PACMAN_LEFT
#define PACMAN_LEFT     BUTTON_MIDLEFT
#endif
#ifndef PACMAN_RIGHT
#define PACMAN_RIGHT    BUTTON_MIDRIGHT
#endif
#ifndef PACMAN_1UP
#define PACMAN_1UP      BUTTON_BOTTOMLEFT
#endif
#ifndef PACMAN_2UP
#define PACMAN_2UP      BUTTON_BOTTOMRIGHT
#endif
#ifndef PACMAN_COIN
#define PACMAN_COIN    BUTTON_CENTER
#endif
#ifndef PACMAN_MENU
#define PACMAN_MENU    (BUTTON_TOPLEFT|BUTTON_REL)
#endif
#endif



[Edit1] updated ftp (new rockbox version + new patched original FW 2.57 and 3.57)
[Edit2] sorry, the ftp update gone completly wrong, I'm on it
[Edit3] the ftp is working again, the problem was, the files had the windows line end character in the names (???) like this: d2N...bin'\r', because I changed my patching script with windows editor...
Didn't know it's possible...
Thanks andiator.
But since you have to turn the screen vertically to play it, shouldn't it be:

#ifdef HAVE_TOUCHPAD
#ifndef PACMAN_UP
#define PACMAN_UP       BUTTON_MIDRIGHT
#endif
#ifndef PACMAN_DOWN
#define PACMAN_DOWN     BUTTON_MIDLEFT
#endif
#ifndef PACMAN_LEFT
#define PACMAN_LEFT     BUTTON_TOPMIDDLE
#endif
#ifndef PACMAN_RIGHT
#define PACMAN_RIGHT    BUTTON_BOTTOMMIDDLE

Anyways the game is pretty unplayable using a touchpad, but still fun to have.
Title: Re: Cowon D2
Post by: shotofadds on May 23, 2008, 11:23:16 AM
Oops, I didn't get time to commit those updates. I'm away for a few days so it'll have to wait til Monday now.
Title: Re: Cowon D2
Post by: andiator on May 25, 2008, 09:49:30 AM
But since you have to turn the screen vertically to play it, shouldn't it be:

You'r right! But the strange thing is it was correct before (see old posts). I think the svn update somehow managed to undo/overwrite my not commited changes (???) or I'm simply too stupid  ;D
Title: Re: Cowon D2
Post by: shotofadds on May 27, 2008, 05:35:29 AM
The Pacbox controls should now be fixed in SVN.
Title: Re: Cowon D2
Post by: Bkd11 on May 28, 2008, 11:25:40 AM
The Pacbox controls should now be fixed in SVN.
Yep! I can confirm it is now fixed.

Title: Re: Cowon D2
Post by: talex on June 04, 2008, 07:01:38 AM
Hi,

I just got one of the new 16GB D2's and have attempted to put rockbox on it (Linux dev environment, compiled sources from the latest zip7 dump, revision 17687)

After patching the firmware with tcctool, I get the error on the player
Code: [Select]
*PANIC*
BMPM total_banks m
ismatch
The player still functions properly after resetting it (although I'm still using my rockboxed H140)

I'm guessing this is due to more memory banks, if there is any test code that I can run on it to get more information out please let me know.

EDIT: More info. Modified the call to panicf in ata-nand-tcc780x.c (line 485) to print out total_banks and id_buf[4].
total_banks = 2 and id_buf[4] = 4
Suggesting 4 total memory banks

EDIT 2: A small amount of further investigation has found that total_banks is set to 2 at the line if (memcmp(uid_buf0, uid_buf2, 32) == 0)
Also, trying to ignore the sanity check (commenting it out) result in a failure to find a filesystem.

Title: Re: Cowon D2
Post by: shotofadds on June 04, 2008, 09:11:31 AM
Yeah, sorry, I'm aware of that thanks to some users at iAudiophile.net, but I haven't updated the wiki page to state that 16Gb models aren't working yet.

The problem is that nand_chip_select() isn't correctly selecting all of the 4 NAND banks that are present in the 16Gb model, so banks 0/2 and 1/3 appear to us as if they are duplicated. We are ignoring the 'duplicate' banks, hence the 2 vs. 4 total_banks mismatch.

I've built a version with some more debug text here (http://www.mediafire.com/?au6jtma5dwl), but it will just confirm the behaviour you've already seen. (Be aware that the backlight timeout will turn the screen off after 5 seconds, so you need to press a button or touch the screen to bring the display back).

I need to do some more investigation into this, but not having a 16Gb player in front of me slows things down somewhat.
Title: Re: Cowon D2
Post by: x5062 on June 04, 2008, 09:45:06 AM
hello.
I was studied about cygwin - so I can make bootloader.bin file and rockbox.zip file.
q1. by the way, how can I translate the english to korean?
I was used language - korean setting, so It was changing English to korean.
but there were not translating words... ex :
Main menu

files                                                                               íŒŒì¼ 보기
resume playback                                                           ìž¬ìƒ 계속하기
settings                        ------------------->                       settings
playlists                                                                         playlists
plugins                                                                          플러그인 보기
system                                                                          시스템 설정

before                                                                            after

like this... It wasn't change to korean perfect. how can I change  the word --->settings ->설정 ?

q2....and I went system - Debug(keep out!) - CPU frequency....
I guess, usually d2's chipset work to 192mhz clock, by the way, why the cpu frequency marking to 48mhz clock?

q3... d2's chipset is a dual core... 192 mhz + 192 mhz = 384 mhz clock, but one only using to play video clip,
the other using other things... music, text, flash...
than,  rockbox is same? if i playing a movie, d2 only using one core?
Title: Re: Cowon D2
Post by: GodEater on June 04, 2008, 11:59:35 AM
Q1 : Read this page : http://www.rockbox.org/twiki/bin/view/Main/LangFiles

Q2 : To save battery life, we usually don't run the processor at full speed all the time. This is common to nearly (if not) all the rockbox ports.

Q3: That would depend on the way the D2 developers are using the dual core chip at the moment. Rockbox has other dual core targets which are more mature than the D2 port, and even on those, the usage of both cores is still in most people's opinion (or rather, those that are in a position to comment), less than optimal.
Title: Re: Cowon D2
Post by: cybergrind on June 04, 2008, 12:06:45 PM
but if we will port java to rockbox, usage of second (J-core) should have more sense =)
Title: Re: Cowon D2
Post by: shotofadds on June 04, 2008, 12:10:06 PM
Codecs and plugins will boost the CPU up to 192Mhz when necessary (or you can boost it manually by pressing the "-" key from the CPU Frequency debug screen). There is no dual core support at the moment.

@cybergrind: the main ARM926E-JS core supports Java extensions, not the co-processor. However, the is no publically available documentation, so I would expect an open-source Java port any time soon.
Title: Re: Cowon D2
Post by: shotofadds on June 11, 2008, 06:44:02 AM
The current build should now also work on 16Gb models.

(Of course, when I say "work", I mean in the loosest sense.. ;))
Title: Re: Cowon D2
Post by: juggleboy711 on June 12, 2008, 01:08:20 AM
Just curious?? With the controls for a touchscreen, are the only options the edges(up,down,L,R, and center) or specific cordinates on the screen work just like it should? Or is that extremely complicated to code?(just for games in general, not pacman specifically)
Title: Re: Cowon D2
Post by: JdGordon on June 12, 2008, 01:18:50 AM
we can do whatever we want with the touchscreen... the driver has been setup with 2 modes... one is where the screen is split into 9 "buttons" which is just a imaginonary 3x3 grid drawn over the screen for them... the other is where you can get the actual pixel being pressed...
Title: Re: Cowon D2
Post by: sikon on June 12, 2008, 01:24:58 PM
Hi! How can i set the mode "where you can get the actual pixel being pressed..."?
Title: Re: Cowon D2
Post by: shotofadds on June 19, 2008, 05:35:19 AM
Hi! How can i set the mode "where you can get the actual pixel being pressed..."?
At the moment there's no option to do that in the menus, as the GUI has not really been adapted to that mode, yet. But, if you're interested in coding for the touchscreen, take a look at the test_touchpad plugin - it should show you how to use the relevant APIs.

...In other news...

On my way to work this morning I was able to use Rockbox instead of the Cowon firmware to listen to music for the first time! I had an album playing for about 40 minutes with no show-stopping problems. 8) 8)

This is really good news as it also proves the NAND driver isn't that broken if it's able to play a whole album without problems.

There are a few issues to work out: the headphone volume control isn't working, and there's some distortion, maybe due to setting the mixer volume incorrectly. Those should be simple fixes, though. The EQ (software 5-band and hw bass/treble) seem to work fine, but at the moment they mostly just add to the distortion.

With no EQ it's currently running at a 30.2% boost ratio (~90MHz) on LAME 192k MP3 files, which sounds rather high, but we can work on that.  :o

As a bonus, getting the sound buffering mechanism working also means that the Gameboy and MpegPlayer plugins now partially work:

- The Gameboy emulator is very slow and needs some work on the keymappings. But it works, and has sound.

-  MpegPlayer seems to run at a reasonable speed but it's hard to tell because the output is rotated and repeating across the display. The lcd_yuv_blit() function clearly needs some work.
Title: Re: Cowon D2
Post by: shotofadds on June 19, 2008, 05:36:52 AM
/me feels he deserves a few more than the allowed 3 smileys per post and adds a few more:

 8) 8) 8)
Title: Re: Cowon D2
Post by: LambdaCalculus on June 19, 2008, 05:47:09 AM
...In other news...

On my way to work this morning I was able to use Rockbox instead of the Cowon firmware to listen to music for the first time! I had an album playing for about 40 minutes with no show-stopping problems. 8) 8)

This is really good news as it also proves the NAND driver isn't that broken if it's able to play a whole album without problems.

/me wonders if a "Ladies and Gentlemen..." message is appropriate right now 8)
Title: Re: Cowon D2
Post by: shotofadds on June 19, 2008, 05:49:58 AM
I'm going to tidy up a few things and commit when I'm sure it's not going to damage anyone's hearing. Then cometh the email... ;D
Title: Re: Cowon D2
Post by: JdGordon on June 19, 2008, 08:30:04 AM
CONGRATS!
Title: Re: Cowon D2
Post by: x5062 on June 20, 2008, 10:27:02 AM
Hi.
I was made a bootloader(1.55) and rockbox.zip file. and format my d2, and put in .rockbox folder at root folder.

but rockbox can't play musics(mp3, wma format) and can't playing gameboy emule.(.gbc)

How can I fix this problem?
Title: Re: Cowon D2
Post by: GodEater on June 20, 2008, 10:38:37 AM
Wait for shotofadds to commit his working code, or write your own.

This is not a finished port yet - have patience!
Title: Re: Cowon D2
Post by: redmisquito on June 20, 2008, 03:23:44 PM
Hi.
I was made a bootloader(1.55) and rockbox.zip file. and format my d2, and put in .rockbox folder at root folder.

but rockbox can't play musics(mp3, wma format) and can't playing gameboy emule.(.gbc)

How can I fix this problem?

Doing a search before asking a question would be a good start. 
Title: Re: Cowon D2
Post by: Yeeze on June 21, 2008, 10:45:44 AM
Wow really nice!

Congrats!

THANK YOU shotofadds!

Can't wait to hear it myself ;-)
Title: Re: Cowon D2
Post by: shotofadds on June 21, 2008, 10:54:55 AM
Can't wait to hear it myself ;-)

I'm working on that.  ;)

The distortion is gone, the volume control's working now, and I'm just tidying up a few things before I can commit the changes. Hopefully that will happen in the next couple of days.
Title: Re: Cowon D2
Post by: Shady on June 21, 2008, 04:00:46 PM
Good job shotofadds,  thank you very much! :D

/me wonders why my previous post has been removed ???
Title: Re: Cowon D2
Post by: Llorean on June 21, 2008, 04:15:56 PM
Because this is a development thread and is supposed to be limited to posts that actually forward development.
Title: Re: Cowon D2
Post by: shotofadds on June 22, 2008, 04:04:02 PM
Initial sound playback has been added to the latest SVN build (r17755). As always, please read the Known Issues on the CowonD2Info wiki page before reporting any problems.

Ignore any errors about playlist control files, etc. These appear because the filesystem is read-only and Rockbox is attempting to write a playlist file to the disk.

For the same reason, you can adjust the sound settings (volume, balance, treble and bass and the 5-band EQ), but your settings won't be saved. Also the 5-band EQ is tricky to use, as the keymap needs fixing.
Title: Re: Cowon D2
Post by: stel on June 23, 2008, 02:27:41 AM
Congratulations shotofadds.
I for one appreciate your efforts. The D2 is another step closer to being perfect.

Sound is now working on my 8Gb D2. I've tested flac, mpc and mp3 files and they all work. A little bit of info: flac runs with 0% cpu boost, mpc at 4.1% and mp3 at 29%

Well done...
Title: Re: Cowon D2
Post by: shotofadds on June 23, 2008, 06:33:11 PM
Tonight's progress: the clicks and pops are gone, the hold switch now works, and many things have seen a massive speed increase (eg. codecs, emulator plugins, etc). Phew, I need a night off!

The speed increase comes from disabling IRAM - for some unknown reason this was causing a major performance issue. I haven't looked into the problem, but figured we are better off without it until we figure out what the issue is.

Stel, you may want to re-test those codecs with the latest build (r17774). I don't think any of those should boost at all now at 48MHz.
Title: Re: Cowon D2
Post by: Bkd11 on June 23, 2008, 08:03:12 PM
I just tried the latest build (r17774) and I keep getting an error "undefined instruction at 100C760" and the player freezes when selecting a .mp3 file. The same .mp3 file played fine with (r17755).

I did notice the hold key is working now.

Thanks for all your work shotofadds! Now get some sleep!! :)
Title: Re: Cowon D2
Post by: shotofadds on June 24, 2008, 02:59:00 AM
I just tried the latest build (r17774) and I keep getting an error "undefined instruction at 100C760" and the player freezes when selecting a .mp3 file. The same .mp3 file played fine with (r17755).

100xxxxx is IRAM, which I disabled in the lastest build. Have you done a full make clean / make / make zip?

EDIT: I had to make a further change to fully disable IRAM in plugins/codecs. This should fix the crash and also give a further speed boost.

Another edit: Wow. I've just done a few test_codec runs (see CodecPerformanceComparison (http://www.rockbox.org/twiki/bin/view/Main/CodecPerformanceComparison)) and it seems the 192MHz ARM926EJ-S in the D2 is nearly as fast in tests as the 300MHz ARM920 in the Gigabeat F. I guess the v5 architecture really does make a good bit of difference.
Title: Re: Cowon D2
Post by: ThibG on June 24, 2008, 05:46:16 AM
Yeah! Sound is working fine, except it skip milliseconds from time to time. (when playing music, at least)
Title: Re: Cowon D2
Post by: shotofadds on June 24, 2008, 06:07:19 AM
Yeah! Sound is working fine, except it skip milliseconds from time to time. (when playing music, at least)
Are you sure you're using the very latest version? I don't hear any skips/clicks/pops/etc with the current revision..

If you're still seeing this problem with the latest revision (r17779 or later), can you describe the problem in a bit more detail?
Title: Re: Cowon D2
Post by: ThibG on June 24, 2008, 06:17:06 AM
I'm using the latest svn revision, and it sometimes skip milliseconds.
It doesn't sound like the "clicks/pops" there were before, and it happens less often (I don't know how often, but less than one in 20s).
I was playing ogg (q6?) on a 4GB D2.

Edit: I noticed 3 of these "skips" in 11min of OGG/Vorbis playback
Title: Re: Cowon D2
Post by: shotofadds on June 24, 2008, 07:32:22 AM
I've been listening to a collection of various vorbis files (gaplessly 8)) for the last 30mins or so and haven't noticed any skips.

A possible explanation is that currently we don't implement error-correction when reading from the flash drive, so the occasional data bit may be read incorrectly leading to errors in decoding.

I wouldn't recommend Rockbox for serious music listening at this stage - with the current NAND driver it's also possible that completely the wrong data could be read instead of the intended file. That can lead to a complete crash, which I've seen once or twice now.

@cybergrind: yeah, the Rockboy keymap needs some work. I'll take your ideas on board, thanks.
Title: Re: Cowon D2
Post by: Bkd11 on June 24, 2008, 12:37:19 PM
EDIT: I had to make a further change to fully disable IRAM in plugins/codecs. This should fix the crash and also give a further speed boost.

After updating to (r17781) my .mp3s now play flawlessly and gaplessly ;D (is that a word). It did crash while testing a .flac file though. Tried it again and it crashed at the same spot. Tried another .flac file and it also crashed about 45 seconds in.
Title: Re: Cowon D2
Post by: shotofadds on June 24, 2008, 12:43:13 PM
Read the last paragraph of my previous post...
Title: Re: Cowon D2
Post by: dasimmet on June 24, 2008, 04:14:35 PM
Hi

i upgraded my d2 on r16807 and it was stuck on startup
i turned it off and tried it again, the same thing happend and now it cant be turned off any more  ???
thats what the console shows:
Code: [Select]
Rockbox boot loader
Version r16807:17603M-080522
ATA
mount
Lengt: 74478
checksum: 2EA7479
Model name: d2
Loading rockbox.iaudio
Sum: 2EC7660
Bad checksum
i dont know what to do, hopefully after some time it will run out of battery... :-\
Title: Re: Cowon D2
Post by: andiator on June 24, 2008, 04:54:21 PM

i upgraded my d2 on r16807 and it was stuck on startup


It's somewhat old, try newer one  ;).
You can reset your D2 - close to the usb is a little hole - below is the reset button, you can use the touchpen.
Or you hold the power off button in on/off position for some seconds, till it goes off
Title: Re: Cowon D2
Post by: dasimmet on June 24, 2008, 05:32:25 PM
thanks for help
holding the power swich was what i tried firt time...
i dont know how this old version could get on my d2, i downloaded it from the info page.
now its running fine
Title: Re: Cowon D2
Post by: Dicky Dave on June 26, 2008, 04:56:30 AM
Hi Guys,

I just tried installing Andiator's pre-built patched binary for v3.57 (rev17784) and I am getting a similar error to that reported by talex and couple of weeks ago:

Code: [Select]
*PANIC*
BMPM total_banks m
ismatch

However, this is on a 4GB D2 not a 16GB. I had my 16GB SDHC card in at first and thought this might be the problem. So I tried again with it removed but kept getting the same problem. Any ideas?
Title: Re: Cowon D2
Post by: shotofadds on June 26, 2008, 05:31:33 AM
Interesting. Could you try uploading this binary (http://www.mediafire.com/?lkwy9xd2nsl) with tcctool? It's one that I built for debugging the 16Gb support, so it should show some diagnostic information when you run it.

Let me know what shows up...
Title: Re: Cowon D2
Post by: Dicky Dave on June 26, 2008, 07:00:01 AM
Hi shotofadds,

Here is the output:

Code: [Select]
Bank 0: Manuf, 0xEC Id 0xD5
Bank 1: Manuf, 0xEC Id 0xD5
Bank 2: Manuf, 0xEC Id 0xD5
Bank 3: Manuf, 0xEC Id 0xD5
Banks 0,1 have same manuf. id
Banks 0,2 have same manuf. id
Banks 0,2 have same UID
Total banks: 2
BMP tag: 0x42 0x4D 0x50 0xFF 0xFF

The other thing that might be worth noting is that my 4GB D2 is one of the earliest revisions (I think it is 1.0, but the revision is on the box and I cannot find it at the moment). It was bought in Feb 07.
Title: Re: Cowon D2
Post by: shotofadds on June 26, 2008, 07:38:50 AM
Code: [Select]
BMP tag: 0x42 0x4D 0x50 0xFF 0xFF

The other thing that might be worth noting is that my 4GB D2 is one of the earliest revisions (I think it is 1.0, but the revision is on the box and I cannot find it at the moment). It was bought in Feb 07.

Ah, I've seen that before on a 2Gb D2, running firmware 2.20. On most D2's the first 0xFF shows up as 0x4D (the ASCII code for 'M') and the second is the number of NAND banks present. It's easy to fix - I'll to update the code to ignore those last two values if they're 0xFF.

I guess it's dependant on which firmware version originally formatted the drive - newer versions fill in those two values, older ones don't.

EDIT: This version should work for you, it's v3.57 patched with a modified bootloader.
Title: Re: Cowon D2
Post by: Dicky Dave on June 28, 2008, 01:18:15 AM
EDIT: This version should work for you, it's v3.57 patched with a modified bootloader.

Thanks shotofadds I got it to boot now. I tried to play some OGG files but no matter what file I choose I keep getting "Error accessing playlist control file" which no one else seems to have reported. Looking at the code it seems like it is failing to create a file, perhaps the 'Now playing' playlist file? I know writing to the internal memory is not yet supported so I would expect this to fail. Perhaps my tracks are failing to play for some other reason.
Title: Re: Cowon D2
Post by: shotofadds on June 29, 2008, 05:02:57 AM
Dave,

The "playlist control file" error will always come up at the moment - don't worry about it. There is currently a problem where music does not begin playing until the buffer is filled, wait up to 10 seconds and it should start.
Title: Re: Cowon D2
Post by: Dicky Dave on June 29, 2008, 05:28:38 PM
I could have sworn I waited at least 10 seconds for it play. Perhaps I pressed some buttons or something. Thanks shotofadds, I now have sound and will have a play with RB.

I have also set up my dev environment. I would like to help out the cause but like all RB developers I am time poor so I cannot promise anything. What areas of the codebase would you suggest I start familiarising myself with to best lend a hand?
Title: Re: Cowon D2
Post by: shotofadds on July 01, 2008, 06:53:00 PM
I have also set up my dev environment. I would like to help out the cause but like all RB developers I am time poor so I cannot promise anything. What areas of the codebase would you suggest I start familiarising myself with to best lend a hand?
That's actually quite a hard question to answer. The stock answer is usually "have a tinker with one of the plugins and see how you get on", but it all depends on what you want to do.

Bear in mind that the vast majority of Rockbox is common to all models, so it might be a good idea to familiarise yourself with things like the split between apps/ code and firmware/ or firmware/target code. The apps/keymaps files are useful things to understand as well, but really you just need to pick an area to look at and dive in...

If you're familiar with C it's generally not /too/ difficult to find your way around.
Title: Re: Cowon D2
Post by: shotofadds on July 08, 2008, 03:45:02 PM
There's now a "Work To Be Done" section on the CowonD2Info (http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info#Work_To_Be_Done) wiki page, for anyone out there who wants to help but doesn't know which areas need effort.

I fully appreciate that it might scare off as many people as it attracts, though...  ;D
Title: Re: Cowon D2
Post by: ThibG on July 09, 2008, 09:07:37 AM
I'm looking how lcd_blit_yuv work. So far, I can see that the (0;0) point is supposed to be at the top right corner. I can also see that the ASM part (lcd-as-memframe.S) draws line vertically.
I'm trying to modify it, with my almost inexistant ASM understanding.

Edit: It "works". Er... If video playback is supposed to be half the size of the screen, it works...
Another thing is that I modified the file "lcd-as-memframe.S", common to all ARM targets instead of making a cowond2-only file.
Title: Re: Cowon D2
Post by: shotofadds on July 09, 2008, 09:27:20 AM
I can also see that the ASM part (lcd-as-memframe.S) draws line vertically.

The existing code (both the C and the assembly) was written for players which have their screens in a portrait layout, eg. the Gigabeat F's 240x320 display. So the drawing code takes a 320x240 YUV image and rotates it to display in 240x320. Unfortunately the assembly code is misleading because it does not mention this rotation anywhere in its comments.

If you're going to look at fixing that function, I'd suggest starting with a simple C version (you could just include that in lcd-cowond2.c). This means you don't have to worry about breaking the code for other targets, and we can worry about optimising and/or genericising it later.
Title: Re: Cowon D2
Post by: ThibG on July 09, 2008, 12:56:09 PM
I've now a working (extremly slow) basic C code. The YCbCr to RGB565 conversion is not optimised at all, as I didn't understand the ASM part.
However, don't the D2 support one byte per color?
Title: Re: Cowon D2
Post by: shotofadds on July 09, 2008, 02:06:33 PM
I've now a working (extremly slow) basic C code. The YCbCr to RGB565 conversion is not optimised at all, as I didn't understand the ASM part.

Good stuff - could you post a patch to Flyspray containing your changes? Also maybe have a look at some of the other implementations for some tips (eg. iPod Video?)

I don't know if you're familiar with the test_fps plugin (add test_fps.c to apps/plugins/SOURCES), but it might come in handy while optimising your code...

However, don't the D2 support one byte per color?

Yes, the hardware does, but Rockbox only has a 16-bit LCD driver. The hardware should also support YUV blitting directly in hardware, which will be a nice avenue to explore one day when the basics are working correctly. ;)
Title: Re: Cowon D2
Post by: ThibG on July 09, 2008, 02:43:32 PM
I rewrote the patch with what I've read in the ASM files.
It's a bit slow, but much faster than the old patch.
It's available at http://www.rockbox.org/tracker/task/9178
Title: Re: Cowon D2
Post by: shotofadds on July 09, 2008, 06:47:44 PM
Your patch is now in SVN (r18000... nice number ;)), and as a result MpegPlayer is now usable - within the confines of the broken NAND driver, of course.

As jhMikeS pointed out on the Flyspray task, the "proper" solution would be to fix the existing lcd-as-memframe.S to have a compile-time rotation switch, but I'll leave that as a task for another day.
Title: Re: Cowon D2
Post by: ThibG on July 11, 2008, 03:48:07 AM
Okay, I'm trying to make the "proper" solution :)
I think the switch should be enabled when LCD_HEIGHT < LCD_WIDTH...
Title: Re: Cowon D2
Post by: El3ctroded on July 11, 2008, 04:06:24 AM
I had an idea that may help you proceed with the NAND driver:
1) delete everything from the flash that is non-essential
2) set (or clear, your choice) all bytes in the unused memory
3) Write a file to the flash that is nothing but a file containing a sequential count 00-1Fh numerous times.
4) See how the data got written into the flash doing a memory dump.
5) Delete two or three of those files (randomly) and clear or set the memory where those files were.
6) Write a file to the flash that contains a sequential count of 20-FFh Once only.
7) See how that data was written.

Of course this would have to be done using the D2's firmware using some method. In any event, I think that would allow you to see how the original NAND driver stores data when memory is and is not fragmented quite easily.

If it's a bad idea, or has nothing to do with your NAND driver problem, feel free to tell me ;) I'm not that fluent in file systems and NAND memory, just thought I'd share...
Title: Re: Cowon D2
Post by: ThibG on July 11, 2008, 04:39:41 AM
I uploaded a patch which make the ASM code draws horizontally if LCD_HEIGHT < LCD_WIDTH.
Due to my limited understanding of ASM, it may not be very clean, but it works (at least on my D2).
Title: Re: Cowon D2
Post by: shotofadds on July 11, 2008, 07:34:14 AM
I had an idea that may help you proceed with the NAND driver

That's essentially the kind of test I did originally (although it's better to write directly to the drive using something like 'dd', then we don't have to worry about how FAT arranges the data either).

I need to do more of these kind of tests, but there's a huge problem with the "see how that data was written" step. There's no way to get data back from the D2 to the PC, so the only way is to display raw data on the screen, a page at a time. This, combined with some code to search the NAND for particular occurences, is how the current driver was developed. When you're dealing with 4Gb+ of data, it's quite a painful experience. :-\

Another idea that I've been meaning to try is this: from the PC, write every sector on the UMS volume with a unique identifier based on its LBA address. Then, using the current Rockbox driver, read every sector to find which ones are read incorrectly. If we then search the NAND for the correct identifier, it might give us some clues about how the scheme really works.

The only problem with that approach is that I use my D2 as my day-to-day music player and don't really want to leave it in an unusable state for an extended period of time. I've picked up a cheap Sansa M240 (1Gb) which hopefully uses a similar NAND scheme, but I haven't had time to port the necessary code to TCC77x yet.

I uploaded a patch which make the ASM code draws horizontally if LCD_HEIGHT < LCD_WIDTH.
Due to my limited understanding of ASM, it may not be very clean, but it works (at least on my D2).

Thanks. I'll take a look later and maybe see if there's a way to optimize that add/sub stuff. Out of interest, what fps do you get in test_fps (both at 48MHz and 192MHz)?
Title: Re: Cowon D2
Post by: ThibG on July 11, 2008, 08:10:42 AM
Thanks. I'll take a look later and maybe see if there's a way to optimize that add/sub stuff. Out of interest, what fps do you get in test_fps (both at 48MHz and 192MHz)?
48Mhz:
  1/1: 19.2 fps
  1/4: 75.5 fps
192Mhz:
  1/1: 75.0 fps
  1/4: 291.0 fps
Title: Re: Cowon D2
Post by: andiator on July 11, 2008, 09:57:10 AM
About the NAND, did anyone looked at TCC78xx_MultiMedia_Application_SDK_v044_release.zip linked in the post #96 on this thread?
Under project/FS there are a dma.c and tnftl.h (Telechips Nand Flash Translation Layer) found.
Title: Re: Cowon D2
Post by: shotofadds on July 11, 2008, 01:32:47 PM
Even if it contained anything useful, there's no way we could use code from the SDK. Anything going into Rockbox must either be written from scratch or come from another GPL-compatible source.

In any case, it appears that the TNFTL stuff is supplied as a pre-compiled binary library, which wouldn't be any use anyway.
Title: Re: Cowon D2
Post by: El3ctroded on July 12, 2008, 02:17:35 PM
Quote
There's no way to get data back from the D2 to the PC... When you're dealing with 4Gb+ of data, it's quite a painful experience. :-\
That would be painful. But why is there no way to get data from the D2 to the PC? There's still the USB connection...

Quote
Another idea that I've been meaning to try is this: from the PC, write every sector on the UMS volume with a unique identifier based on its LBA address. Then, using the current Rockbox driver, read every sector to find which ones are read incorrectly. If we then search the NAND for the correct identifier, it might give us some clues about how the scheme really works.
Sounds like a good plan.

El3ctroded
Title: Re: Cowon D2
Post by: Dicky Dave on July 13, 2008, 05:39:23 PM
A few days ago, I spent some time going over the code in the SDK to see if there were any clues in there. However, the most useful routines were supplied pre-compiled. objdump -D did a fairly good job of disassembling it but its pretty tough trying to work through it. My goal was to clarify the unknown fields that shotofadds identified so as to be understand the fs structure.
Title: Re: Cowon D2
Post by: sikon on September 08, 2008, 01:02:31 PM
Hi Everybody! I have just installed the latest build of rockbox (r18451-080908) and i have a problem: the music not plays. I tried mp3 and flac formats. What happend?
PS: sorry for my English :-[
Title: Re: Cowon D2
Post by: shotofadds on September 08, 2008, 01:50:59 PM
This is a known problem - music does not start playing until the decoding buffer has been fully filled. This might take up to about 10 seconds, so just wait a little while.

If the music still doesn't play, it's probably because Rockbox cannot yet read reliably from the internal NAND filesystem. Try copying some more files to the D2 and then try again.

Both of these issues have been covered before in this thread, and are listed as Known Problems on the wiki page (but the wiki is down right now, so I'll let you off... ;)).
Title: Re: Cowon D2
Post by: FirleFanz on September 08, 2008, 04:23:14 PM
because the touchscreendriver. I think what ever, it never can two buttons, at the same time. But do´nt feel sad, a idea to get control of that touchy thing. I have.  Maybe a controlpad on the miniusbport is an ability?!?

I have installed that Rockbox and it´s awesome - I can play PACMAN whoa, same time AC-DC.

Great work for all here!

And also - I think it must be a specification about the touchscreendriver!


this allows that other touchscreens only nead a new Layer, and the Plugins are ok!

                                                               
sorry for my english, foreigner...  :D thanks for that chess!
Title: Re: Cowon D2
Post by: shotofadds on September 11, 2008, 04:32:40 AM
If this thread has been quiet it just means there's been nothing significant to report for a while. Don't read anything more into it than that.

At the moment I'm concentrating on getting the filesystem driver working more reliably. I've said this 101 times already, but it's going to take some time to get that right. The buggy file access is the #1 most important problem right now, and is responsible for many of the bugs/weird behaviour seen in the D2 port (and is now also holding back the upcoming iAudio7 port).

For this reason bug reports aren't really very useful at the moment, unless you're certain they aren't related to unreliable file access (e.g. most problems during music/video playback are almost certainly filesystem-related). But you're certainly free to install it and try things out, if you're feeling brave! ;)
Title: Re: Cowon D2
Post by: FirleFanz on September 24, 2008, 04:17:19 PM
Rockbox 3.0 I´m right way to get 3.0 with SVN?

I have no idea what to do  ???

compiled with the Debian4VMwareImage, the following error ocurred. But also with the 2.x build it was the same! since yesterday 3.0 i tryed again.

Consoleoutput
.
.
.
LD rockbox.elf
.../arm-elf/bin/ld: ERROR: .Dir/shrink/by/me/libgcc.a( udivsi3.o) uses FPA instructions, whereas ..D/S/By/Me/rockbox.elf does not
.
goes on with a lot other Errors
.
.
.
.


Title: Re: Cowon D2
Post by: saratoga on September 24, 2008, 04:36:49 PM
Rockbox 3.0 I´m right way to get 3.0 with SVN?

No if you do a standard checkout, you'll get the current SVN version, which is about 3 weeks newer then 3.0 as of today (3.0 is a fork from the end of August).  3.0 wasn't even released for the D2, so it doesn't really apply anyway.

compiled with the Debian4VMwareImage, the following error ocurred. But also with the 2.x build it was the same! since yesterday 3.0 i tryed again.

Consoleoutput
.
.
.
LD rockbox.elf
.../arm-elf/bin/ld: ERROR: .Dir/shrink/by/me/libgcc.a( udivsi3.o) uses FPA instructions, whereas ..D/S/By/Me/rockbox.elf does not
.
goes on with a lot other Errors
.

You don't have the proper gcc build for the D2's CPU, so compiling fails.  You should be able to fix it just by running the build script in the tools directory to build a new version of gcc.  Since the D2 is a new port, the vmware image probably hasn't been updated.  See the SimpleGuideToCompiling wiki page for info if you're not sure how to run the script.  Also, you should probably post a thread in Getting Started and Compiling forum if you have further trouble setting up your build tools rather then posting here.
Title: Re: Cowon D2
Post by: FirleFanz on September 25, 2008, 01:25:28 PM
 ;D - i will do so...

...ok i have Compiled the uptodate build and the Simulator now - awesome

my Steps
ubuntu installed
sudo apt-get install subversion
sudo apt-get install build-essential libc6-dev
sudo apt-get install patch
sudo apt-get install libsdl1.2-dev libsdl1.2debian

to conclude the LinuxSimpleGuideToCompiling form the docs index
http://www.rockbox.org/twiki/bin/view/Main/LinuxSimpleGuideToCompiling
and the SimpleGuideToCompiling
http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling
and the most problem was that ubuntu hides files in Nautilus!  ;)
Title: Re: Cowon D2
Post by: FirleFanz on September 30, 2008, 02:05:18 PM
about the D2 - Simulator

there is a picture in the sim ordner UI256.bmp

(http://mitglied.lycos.de/ronsonron/UI256.jpg)

but when I start ruckboxui there is´nt the picture around the screen.
Or is it future release?
Title: Re: Cowon D2
Post by: karashata on September 30, 2008, 02:11:04 PM
You have to run the background.bat file (for Windows simulators at least) to get the image to show up.  The regular rockboxui.exe doesn't automatically display the image.

Not sure about the linux simulators though...
Title: Re: Cowon D2
Post by: ikari_01 on September 30, 2008, 02:13:59 PM
Hi,

I am a little puzzled right now.
I've built rockbox for D2 from SVN as described at http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info#Steps_to_Install
There were no errors along the way and tcctool does not complain about anything.
However, after uploading the bootloader, I get the message:
Code: [Select]
"PANIC: unknown NAND: 0xEC 0xD7 0x55 0xB6 0x78" This seems illogical as nand_id.c contains an ID block that would match 0xEC 0xD7 0x55.

I've tried to force the detected NAND type using this:
Code: [Select]
return &all[0].info[3]; instead of the detected returncode.
Then, the bootloader seems to hang, it does not even boot the original firmware when the hold switch is off...

EDIT: disregard that, I accidentally mktccbooted the wrong binary. It boots now  :) (albeit with forced NAND detection.)
Title: Re: Cowon D2
Post by: FirleFanz on September 30, 2008, 02:24:37 PM
Can you post what´s written in the background.bat, please!
Title: Re: Cowon D2
Post by: karashata on September 30, 2008, 02:35:22 PM
Sure, it's "rockboxui.exe --background".
Title: Re: Cowon D2
Post by: FirleFanz on September 30, 2008, 02:43:27 PM
for linux it is ./rockboxui --background
Title: Cowon D2 Lcd Panel Driver
Post by: FranzD2 on October 05, 2008, 04:00:35 AM
Hi!

I'm new to the Rockbox development and i'm trying to figure out how i can help.
My question is related to the lcd panel driver, i was investigating the "2 top lines cut and repeated at the bottom" issue. Looking into the driver code i saw that the power on sequence has been implemented almost exactly as the LTV250QV-F0B datasheet says, exept for three commands that are different,

[lcd-cowon.c : 162] lcd_write_reg(3,  0xE100);         // datasheet says 0x100

[lcd-cowon.c : 165] lcd_write_reg(6,  0x4);               // datasheet says 0xA
[lcd-cowon.c : 166] lcd_write_reg(7,  0x30);             // datasheet says 0x36

I tried to set them to the datasheet values but my screen goes blank.
Could someone please explain me why those command are different (maybe they comes from the OF?)

Thanks & keep on the good work!
Title: Re: Cowon D2
Post by: shotofadds on October 05, 2008, 10:15:09 AM
Hi Franz, it's always nice to see new people getting interested! :)

The initialisation commands we use are the same as the original Cowon firmware, as the sequence given in the datasheet didn't work for me either (maybe the D2 LCD is a slightly different revision of the LTV250QV?).

I haven't looked into what the differences are, though. Maybe you could try changing individual bits within those register values to see which changes are important/relevant?

This "cut and repeated lines" problem only seems to happen when the bootloader is used to run the main Rockbox binary (it doesn't seem to happen if Rockbox is booted using tcctool). So it's likely to be provoked by the main Rockbox binary trying to initialise the LCD a 2nd time...
Title: Re: Cowon D2
Post by: FranzD2 on October 05, 2008, 02:20:57 PM
This "cut and repeated lines" problem only seems to happen when the bootloader is used to run the main Rockbox binary (it doesn't seem to happen if Rockbox is booted using tcctool). So it's likely to be provoked by the main Rockbox binary trying to initialise the LCD a 2nd time...

In my boot screen i even see the top two lines cut off so the problem is in the first LCD initialization, i'll try to test some bit configuration as you said, unfortunately the datasheet is very poor of infos on the meaning of each bit (what values can take R3???), however i'll do some trying, thanks for your reply!
Title: Re: Cowon D2
Post by: FranzD2 on October 07, 2008, 04:27:17 PM
I found the problem that was causing that "two lines cut and then repeated at the bottom",
first of all, i had to set the value of R06 (to be exact it is the value of the Vertical BachPorch) to 0x1 instead of 0x4 (Don't know why but let me know if this could cause problems, i don't think so) and then i inserted some sleep_ms() call into the spi command write routine ltv250qv_write(), right after the

GPIOA_CLEAR = LTV250QV_CS;

and just before the 

GPIOA_SET = LTV250QV_CS;

I put a "sleep_ms(20);"
I think that this problem was due to some timing stuff related to the spi hardware which has been resolved just by inserting a small delay.

If someone feels inspired, please try this fix and let me know...
Title: Re: Cowon D2
Post by: shotofadds on October 07, 2008, 05:16:08 PM
Well, that makes perfect sense. It does indeed look like two distinct problems:

1. An incorrect "vertical back porch" value could certainly cause the missing lines. This would apply to the bootloader and main Rockbox equally.

2. In the bootloader, lcd_init() is called while the cpu is unboosted, but main.c first calls cpu_boost(true). This means the CPU is running 4x faster when lcd_init() is called the 2nd time.

I'll do some testing to find the optimum wait time necessary (20ms is likely to be several orders of magnitude more than necessary!) and then commit a fix.

Thanks for looking into this - if you let me know your real name I'll add you to the CREDITS file.

EDIT: Using a vertical back porch value of 0x1 fixed the missing lines at the top, but caused a missing line at the bottom. A value of 0x2 works better for me - does this work for you as well?
Title: Re: Cowon D2
Post by: wnmnkh on October 07, 2008, 05:23:55 PM
shotofadds, I begin to suspect that the NAND read/writing driver for SD is broken even in the official firmware.

I used a lot of writing and deleting on my 8gb card using my D2, not a card reader. Currently, the card is corrupted and the firmware is unable to read the files correctly. Maybe this is my own, unique case only, but I just can't stop thinking about the connection between buggy file access and this problem.
Title: Re: Cowon D2
Post by: shotofadds on October 07, 2008, 05:42:32 PM
@wnmnkh: I very much doubt these problems are related. The Rockbox file access is "buggy" because we dont understand enough about the NAND Flash Translation Layer (although I'm working on that right now...), so that won't affect SD at all.
Title: Re: Cowon D2
Post by: FranzD2 on October 08, 2008, 02:51:58 AM

1) I'll do some testing to find the optimum wait time necessary (20ms is likely to be several orders of magnitude more than necessary!) and then commit a fix.

2) EDIT: Using a vertical back porch value of 0x1 fixed the missing lines at the top, but caused a missing line at the bottom. A value of 0x2 works better for me - does this work for you as well?

1) Be careful, i tried a value of 10 ms and that worked several times for me, however the problem was still present; i think that the correct value should be as near as possible to 10 ms but to be really sure it needs several trying.

2) I'll try asap and i'll let yow know

EDIT: Yes you're right.
Title: Re: Cowon D2
Post by: ThibG on October 12, 2008, 03:14:54 PM
Hm, I tried rockbox again today and... It won't boot (I tried 4 times, "file not found"...)
I have the same D2 as before (a 4Go one), but I have the 2.57 firmware now.
Title: Re: Cowon D2
Post by: shotofadds on October 12, 2008, 06:22:40 PM
Don't worry, the different firmware version won't matter - it'll be the same old "unreliable NAND driver" problem. I'm working on a new version which should improve things, and I'll keep you posted when there's something to test (hopefully in the next week or two).
Title: Re: Cowon D2
Post by: man.dovvn on October 12, 2008, 09:45:01 PM
I have also experienced file corruption using the supplied firmware.
Perhaps code could be written to calibrate file access based around an earlier thought. It was proposed here that Rockbox would write known unique data to all memory addresses, and then read back the data, in order to map the memory. If this is still a feasible solution, code could be written to do this, then save the map file and use it to access memory addresses correctly. It would be time consuming to map, and it'll slow down the whole firmware to use a memory look-up table, but it may be better than nothing.
Title: Re: Cowon D2
Post by: shotofadds on October 13, 2008, 08:56:46 AM
That's not really an option, since the mapping between logical block (LBA) and physical NAND address is dynamic and changes as data is written to the NAND. This is how the OF implements wear levelling, by ensuring that data is written evenly across different physical blocks. Unfortunately it also makes our job rather more complicated...

But like I said, check back in a week or two as I'm hopefully not far off a breakthrough in this area.

I'll try to keep the TelechipsNAND wiki page updated with any findings, but at the moment that's a secondary concern, after making the damn thing work in the first place. :D
Title: Re: Cowon D2
Post by: shotofadds on October 13, 2008, 04:36:07 PM
I've committed a slightly modified version of FranzD2's LCD fixes, which seem to reliably fix the missing/repeated LCD lines (at least for me).

Let me know if there's still a problem for anyone else...
Title: Re: Cowon D2
Post by: FranzD2 on November 15, 2008, 11:56:14 AM
For some days it worked fine for me but today i turned on my d2 and the screen was messed up again, i think that the delay is still too short.
Anyone else noticed this? shoto?
Title: Re: Cowon D2
Post by: dragongod on November 16, 2008, 05:48:33 AM
hi everybody, i'm a newbie of both D2 and rockbox, and i want to do sth. for this wonderful project. can anyone tell me where to start? i mean since there is no datasheet or SDK of telechips, should i just begin to read the source code or read sth. else before that?
Title: Re: Cowon D2
Post by: Llorean on November 16, 2008, 05:51:47 AM
You could start by reading the forum posting guidelines.
Title: Re: Cowon D2
Post by: shotofadds on November 16, 2008, 05:59:29 AM
For some days it worked fine for me but today i turned on my d2 and the screen was messed up again, i think that the delay is still too short.
Anyone else noticed this? shoto?
Hi Franz,

Could you try editing line 80 of lcd-cowond2.c, so that FREQ>>23 now reads FREQ>>22? This will double the current delay, so let me know if it works any better for you.
Title: Re: Cowon D2
Post by: FranzD2 on November 16, 2008, 10:54:41 AM
I just tried but i've got the top line repeated at the bottom, it seems that a value of 22 is worse than 23, is it possible?
By the way i'm investigating the problem in the touchscreen driver which takes wrong presses, i'm almost sure that the problem is the lack of a delay between the adc start command and the read:

Code: [Select]
pcf50606_write(PCF5060X_ADCC2, (0xE<<1) | 1); /* ADC start X+Y */
 pcf50606_read_multiple(PCF5060X_ADCS1, buf, 3);

in button-cowond2.c.
Putting a delay here seem to solve this problem but it slows down when i keep the screen button pressed.

Title: Re: Cowon D2
Post by: shotofadds on November 16, 2008, 11:15:55 AM
I just tried but i've got the top line repeated at the bottom, it seems that a value of 22 is worse than 23, is it possible?
Strange, both values seem to work here. Looks like I'll need to do some more work on this...

Quote
Putting a delay here seem to solve this problem but it slows down when i keep the screen button pressed.
Yes, the touchscreen handling is one area that could do with some serious re-work. Inserting delays should be a last resort as this code is run from IRQ context, and like you say, it will cause slow-downs. If I remember correctly, the PCF50606 datasheet states that a delay should not be required between the start and read commands.

I have some changes in my local tree that might improve things, but I was waiting to see how reliable they turned out to be!

Finally, I've committed some improvements to the NAND driver (in r19118), so please try out the new version and let me know how it goes. Cheers!  ;)

EDIT: To get the full benefit of any improvements to the NAND driver you will also need to update and re-flash the bootloader.
Title: Re: Cowon D2
Post by: FranzD2 on November 16, 2008, 11:30:19 AM
 :) !!!NAND!!!   :o :)

However i've just checked on the pcf50606 user manual and it says that the coversion time is 25 us.
Title: Re: Cowon D2
Post by: vodi on November 17, 2008, 04:29:40 PM
hi!
i just loaded r19130 (incl. new bootloader) into my D2!

The Bootup-logo works, but after this there is again the "2 lines from top on bottom" problem. everytime.

Title: Re: Cowon D2
Post by: shotofadds on November 17, 2008, 04:35:06 PM
Wow, that was quick..  ;D

Could you try one thing quickly for me - a variation of the "fix" I suggested to FranzD2 earlier? Could you try editing line 80 of lcd-cowond2.c, so that FREQ>>23 now reads FREQ>>24?

I just booted up the D2 15 times in a row with this setting and didn't see the problem once...
Title: Re: Cowon D2
Post by: vodi on November 17, 2008, 04:47:59 PM
oh ja

FREQ>>24 works for me also!
Title: Re: Cowon D2
Post by: shotofadds on November 17, 2008, 05:09:26 PM
Ok, I've committed that change.

For everyone else:

From r19130 onwards the main rockbox binary has been renamed to "rockbox.d2", so you will need to update the bootloader and flash a new patched firmware in order to use the new builds (since the old bootloader would still be looking for rockbox.iaudio).

The reason for making this change is twofold: 1) the D2 has never been marketed as part of the "iAudio" range, so I removed those references from the code, and 2) it forces people to update their bootloaders to the new more reliable NAND driver. It seemed a convenient time to do it. ;)
Title: Re: Cowon D2
Post by: shotofadds on November 22, 2008, 02:22:08 PM
Almost one week (and over 1000 page views) later, there hasn't been any comment regarding reliability of the updated NAND driver. Did anyone try it?

Is the requirement to build a new bootloader from source holding people back from testing this? Would a pre-built bootloader.bin and mktccboot be helpful, so that you can patch your own firmware file without having to build Rockbox?
Title: Re: Cowon D2
Post by: Yeeze on November 22, 2008, 02:38:07 PM
I'm sorry, I would love to test it, but I can't find my D2 since weeks :'(
But as soon as I fing it I'll let you know ;)
Title: Re: Cowon D2
Post by: gevaerts on November 22, 2008, 02:56:43 PM
It's a lot better than last time I tried. I installed the bootloader, unpacked the zip, and it actually booted! I'll play with it a bit and report back
Title: Re: Cowon D2
Post by: vodi on November 22, 2008, 03:17:34 PM
I don't see much improvements, because i didn't had very much problems before, just one or two times a "bad checksum" - error.

I also don't use very much Rockbox on my D2 because i miss write access :(

And i don't think, its too much work to build a new bootloader when you also build the rockbox.zip from SVN.
Title: Re: Cowon D2
Post by: gevaerts on November 22, 2008, 03:31:21 PM
I had some issues reading a file. This may be due to filesystem corruption, as fsck.vfat said the free cluster summary was wrong (now fixed).

In general it's a lot better thatn it was though
Title: Re: Cowon D2
Post by: kfoltman on November 23, 2008, 11:20:04 AM
shotofadds: I have the "2" (European, non-DAB) 2GB version here. I've played with Rockbox a little, and didn't run into easily spotted flash issues (in form of "bad checksum" messages or bursts of noise during playback). The sound is fine to my ears. Volume control works too. The display is fine - no abnormal lines or any visible shift.

One problem: the touchscreen stopped working after a couple of minutes of playing with different plugins. Also, I got "undefined instruction" when changing to another song (hopefully not flash-related?). Unfortunately the address is mostly obscured by "NOW PLAYING" message on yellow background (reading white on yellow isn't that easy). Looks like 000D40DC or similar. I'll try to test more later.

Edit: s/DRAM/NAND flash/ - I never thought I'll ever confuse those two, but I did.
Edit2: I get "undefined instruction" semi-regularly, the address displayed seems to be different each time. I've also started getting the LCD lines problem, but that was after shutting down the original firmware during load stage two times. It kept showing those two lines consistently after that (reboot after reboot), until I started the original firmware again. Then it stopped happening and I couldn't reproduce it ever since.
Edit3: does Rockbox bootloader (or the loaded binary) do any checksum verification on the code read from NAND Flash?
Title: Re: Cowon D2
Post by: wahamir on November 23, 2008, 03:04:37 PM
I would love to try it, but since i'm not used to rockbox development and don't have much time ...

It would be apreciated if someone could post a compiled bootloader or just explain me how to do it ....

Thanks
Title: Re: Cowon D2
Post by: Llorean on November 23, 2008, 09:34:09 PM
This thread is for development. If you're not planning on developing, please wait until a user version is available.
Title: Re: Cowon D2
Post by: shotofadds on November 24, 2008, 07:59:47 AM
@Llorean,

I did specifically ask whether the lack of a pre-compiled bootloader was holding anyone back from testing, so that response was entirely justified. As I'm sure you know, user testing can be incredibly helpful even in early stages of development.

If there are people who would find it useful, I see no problem providing a mktccboot binary (with associated bootloader.bin), especially given that we already provide a pre-built rockbox.zip and tcctool, too.

@kfoltman,

The undefined instruction errors are rather interesting - I haven't seen those during playback, even after extended periods of use (eg. I left it to run for over 24hrs recently without a hitch). Does this happen with any particular audio formats, or when changing to a particular song?

It's quite annoying that the error text is obscured by the viewport background, as the handler really should clear the screen beforehand. I'll see if I can fix that. If you're able to read the hex address next time, do write it down and also post which revision (r19???) you're running, since the address is only useful with this information.

I've seen the problem where the touchscreen stops responding before, and I think I have a workaround (I hope to do some more work in that area over the next couple of weeks).

The bootloader does verify the rockbox.d2 checksum before starting Rockbox, that's why the old version used to fail on bootup with "Bad Checksum" errors rather often...
Title: Re: Cowon D2
Post by: luck3r on November 24, 2008, 08:21:07 PM
NAND seems to have improved for me, didn't get any errors since I've built r19189.
It used to make problems with high-bitrate (low compression) FLAC files (sometimes the playback was interrupted by extremely loud artifacts, kinda sounded like /dev/urandom), seems be gone now, but I'll keep testing.
The "shifted lines" problem also disappeared.

BTW, I like how the D2 gets warm when using Rockbox, as it's getting really cold outside, so I use it to prevent my hands from freezing off. Nice side-effect :D
Title: Re: Cowon D2
Post by: gevaerts on November 25, 2008, 05:23:48 AM
It used to make problems with high-bitrate (low compression) FLAC files (sometimes the playback was interrupted by extremely loud artifacts, kinda sounded like /dev/urandom), seems be gone now, but I'll keep testing.
Those were probably caused by NAND issues as well I guess
Title: Re: Cowon D2
Post by: luck3r on November 26, 2008, 05:36:32 PM
I was able to repoduce the problem where the touch screen stops working.

1. go to Settings->Theme Settings->Colours
2. go to Background Colour and change it to #080000
3. go there again, this time changing it to #000000
Title: Re: Cowon D2
Post by: gevaerts on November 26, 2008, 06:07:09 PM
I was able to repoduce the problem where the touch screen stops working.

1. go to Settings->Theme Settings->Colours
2. go to Background Colour and change it to #080000
3. go there again, this time changing it to #000000

Also reproducible here
Title: Re: Cowon D2
Post by: shotofadds on November 26, 2008, 06:25:42 PM
What symptoms are you seeing? Does the touchscreen stop responding completely?

My local version doesn't do that (although it does include some touchscreen-related changes), but there's definitely something funny about that screen regardless. Touching midleft/midright on the colour picker screen initially works as expected (ie. increment/decrement the coloured bar) but as soon as Select is pressed the behaviour changes, and next time the screen is entered pressing Left/Right will also exit the screen.

Very weird. Something must be causing the touchscreen "button" driver to get rather confused...
Title: Re: Cowon D2
Post by: luck3r on November 26, 2008, 11:56:45 PM
It stops responding completely.
Title: Re: Cowon D2
Post by: buk on November 27, 2008, 04:07:39 PM
Hi,
I'm new here and I first want to congratulate you for your work, I really enjoy Rockbox.
Since rev 19228, I have no sound. I fixed the problem by changing line 46 of wmcodec-telechips.c to :
#if defined(HAVE_WM8731) || defined(HAVE_WM8751) || defined(HAVE_WM8985)
I'm not sure it's the best and correct way to fix it but it works.

I will try to look deeper into the code and maybe one day I'll be able to help you guys (not sure as I never code hardware stuff but it's a good way to learn ;)).
Title: Re: Cowon D2
Post by: FranzD2 on November 29, 2008, 04:39:30 PM
Hi all!  :) ;D

I just posted on FlySpray a patch that seems to solve the problem of the touchscreen driver, i've introduced an error compensation mechanism on the values read from the pcf50606 and some other stuff.
I think that the wrong values were due to some touchscreen voodoo (eg signal rebound) and does not depend on how the software is made, so the only way is to use a compensation algorithm.
It works fine for me.

Please try this fix and let me know...
Title: Re: Cowon D2
Post by: sikon on November 29, 2008, 05:02:47 PM
Hi! I want to try new build and i can write some comments about it. But there is a one problem, where can i download compiled builds(i have 2.57 version)
Title: Re: Cowon D2
Post by: andiator on November 29, 2008, 06:09:41 PM
The booloader can be find on my ftp ftp://andiators.homeip.net (ftp://andiators.homeip.net). There is also rockbox.zip with the same revision.
The newest ("bleeding edge", build every day ) rockbox.zip can be found here: http://build.rockbox.org/dist/build-cowond2/rockbox.zip
Title: Re: Cowon D2
Post by: sikon on November 29, 2008, 06:41:40 PM
Hi all!  :) ;D

I just posted on FlySpray a patch that seems to solve the problem of the touchscreen driver, i've introduced an error compensation mechanism on the values read from the pcf50606 and some other stuff.
I think that the wrong values were due to some touchscreen voodoo (eg signal rebound) and does not depend on how the software is made, so the only way is to use a compensation algorithm.
It works fine for me.

Please try this fix and let me know...

I tried it and it works fine! I tested it for 5 minutes and, no errors was found! Good work.
Title: Re: Cowon D2
Post by: luck3r on November 29, 2008, 09:16:40 PM
Works fine for me too.
Title: Re: Cowon D2
Post by: dhkd0407 on November 30, 2008, 06:28:39 AM
Hi, I'm Korean D2 rockbox user. I have a few question for d2 rockbox bootloader.

1. a DMB boot loader does not have  in ftp://andiators.homeip.net/. Where Do I get the DMB boot loader?

2. rockdoom still not working?


Title: Re: Cowon D2
Post by: andiator on November 30, 2008, 07:09:37 AM
@dhkd0407
Well, I have no idea if it works on DMB D2, so there is a chance that you break your D2. Than you have to use the tcctool to recover it.

If you, despite of this warning, still want to test rockbox, than post the firware version you use and the link where I can download it, and I will make one for you.

But you are testing it AT YOUR OWN RISK.

@all
Does anybody know if it would give some problems with the DMB version?
Title: Re: Cowon D2
Post by: kfoltman on November 30, 2008, 08:31:22 AM
It would - or at least it has little chance to work correctly. DMB models use 1.xx or 4.xx series firmware, while non-DMB versions use 2.xx or 3.xx.
Title: Re: Cowon D2
Post by: Yeeze on November 30, 2008, 11:47:28 AM
I can install the 1.xx firmware even though I have an non-DMB D2...
So you can not use the DMB with that firmware, but the other things. So it could work
Title: Re: Cowon D2
Post by: isanggon on November 30, 2008, 12:08:15 PM
I compiled bootloader for 1.58. It successfully worked with D2 dmb 8gb model.

Copy below address and paste to exploer manually. You can download compiled bootloader.

http://isanggon.mireene.com/

I will compile custom build for D2, soon.



Title: Re: Cowon D2
Post by: shotofadds on November 30, 2008, 01:56:00 PM
Phew, where to start?! :D

@buk,

Thanks for spotting that - the fix has been committed to SVN (although I'm not entirely sure why it happened at all!).

@FranzD2,

I'll take a look at your touchscreen patch soon, although I have a few local changes in that area already that might complicate things. I also need to see if that busy-wait in the button handler can be avoided, as it could have a rather negative effect on CPU usage...

btw. You can get an indication of how much CPU the touchscreen uses by comparing results from the test_fps plugin: check the difference in results when circling the screen with your finger, against not touching the screen at all. Just add test_fps.c to apps/plugins/SOURCES if you haven't done so already.

@andiator,

Thanks for hosting these builds once again. I'll post some binaries soon (mktccboot and bootloader.bin) so that users can easily make their own patched firmware files and reduce their reliance on your server...

@everyone else,

I develop on a DAB D2, so patched 1.xx and 4.xx firmware versions do work fine. Remember that if you are not sure, you can always use tcctool to safely test if a patched firmware works before flashing it.

And Doom doesn't work yet - it's not really a priority right now...
Title: Re: Cowon D2
Post by: gevaerts on November 30, 2008, 02:30:59 PM
While we're listing what now works : I got USB mostly working today.

To try it, look for the #if 0 block in config-cowond2.h and change that to #if 1
Title: Re: Cowon D2
Post by: aidy on December 01, 2008, 07:53:29 AM
hi,
does having usb working have any practical features yet?
Title: Re: Cowon D2
Post by: shotofadds on December 01, 2008, 08:17:24 AM
There won't be much benefit for users at this point (it's basically the same as the Cowon firmware's MSC mode, but read-only). But it will be a really helpful debugging aid to help me fix the remaining issues with the NAND driver...
Title: Re: Cowon D2
Post by: isanggon on December 01, 2008, 09:07:34 AM

I found "2 lines from top on bottom" problem on lcd.
My device is dmb/dab model and I fixed this problem by editing line 80 of lcd-cowond2.c, as you said.
FREQ>>23 and 22 works fine but 24 caused bottom line problem.
I think FREQ>>23 is better choice for dmb/dab model.
 
Title: Re: Cowon D2
Post by: shotofadds on December 01, 2008, 09:45:08 AM
I don't think there should be any difference between DMB/non-DMB models, since they use the same LCD. The problem is getting the correct timing when sending initialization commands to the LCD controller. If the delay is too long or too short, some of the commands do not seem to be registered, which causes this problem.

Since the CPU can either operate at 48MHz (normal) or 192MHz (boosted), the number of loops in the delay counter has to be adjusted for the CPU speed. FREQ>>23 (etc) is an attempt to scale the delay to the current CPU speed, but it's obviously still not quite correct.

Maybe something like (FREQ>>24)+2 would work? You could also try adding an extra DELAY; at the very end of the for() loop in ltv250qv_write(). Feel free to adjust any of these values and report back...

I really would much prefer to find a solution that works for everyone...  :)
Title: Re: Cowon D2
Post by: FranzD2 on December 01, 2008, 10:23:34 AM
I don't think there should be any difference between DMB/non-DMB models, since they use the same LCD. The problem is getting the correct timing when sending initialization commands to the LCD controller. If the delay is too long or too short, some of the commands do not seem to be registered, which causes this problem.

Since the CPU can either operate at 48MHz (normal) or 192MHz (boosted), the number of loops in the delay counter has to be adjusted for the CPU speed. FREQ>>23 (etc) is an attempt to scale the delay to the current CPU speed, but it's obviously still not quite correct.

Maybe something like (FREQ>>24)+2 would work? You could also try adding an extra DELAY; at the very end of the for() loop in ltv250qv_write(). Feel free to adjust any of these values and report back...

I really would much prefer to find a solution that works for everyone...  :)

The last value you suggested to me worked fine but since i modified the touchscreen driver this value doesn't work anymore, i now often see the two lines.
I don't know if this is due to some other mod but it seems to me that a mod in other files causes the problem in the lcd driver to reappear. How is it possible?
Title: Re: Cowon D2
Post by: isanggon on December 01, 2008, 11:20:10 AM

I tried touch screen patch. It worked fine with FREQ>>23 without 2-line problem on my device.

shotofadds// Okay, I'll try other value, for test ;D
Title: Re: Cowon D2
Post by: shotofadds on December 01, 2008, 12:38:23 PM
I don't know if this is due to some other mod but it seems to me that a mod in other files causes the problem in the lcd driver to reappear. How is it possible?
D'Oh! Of course, we can adjust the delay all we like, but behaviour will still vary if an interrupt (IRQ) occurs while sending commands to the LCD..

I suggest updating lcd_write_reg() so that it reads:

Code: [Select]
static void lcd_write_reg(unsigned char reg, unsigned short val)
{
    int irq_level = disable_irq_save();
    ltv250qv_write(0x740000 | reg);
    ltv250qv_write(0x760000 | val);
    restore_irq(irq_level);
}

That might improve things. ;)
Title: Re: Cowon D2
Post by: FranzD2 on December 01, 2008, 01:38:31 PM

@shoto

1) I just tried test_fps and i saw no differences, if i press or don't press the screen, the values are the same.

2) I tried disabling irq in lcd_write_reg + using FREQ>>24 and i saw one line repeated, with a value of 23 things seem to work better, i'll test it better tomorrow all day at work.

@all

Please if you want to try the touchscreen patch then use the second one, i've adjusted a value that caused problems in the first one.
Title: Re: Cowon D2
Post by: shotofadds on December 01, 2008, 03:50:17 PM
1) I just tried test_fps and i saw no differences, if i press or don't press the screen, the values are the same.

Really? Check the value displayed at the top: with a plain SVN build this shows either 153.5fps or 158fps normally (at 48Mhz), but goes down to around 120fps if I continually circle the screen with my finger - that's a massive amount of CPU usage attributed to the touchscreen. That's why I'm concerned about adding any more complexity to the button driver, and trying to look at doing things a different way. :o

NOTE: Don't do any speed testing if you are uploading the build using tcctool, sometimes this can give rather different results (and I currently have no idea why that's the case).

btw. I'd also recommend looking at the test_touchscreen plugin, you can use it to see which calibration values work best (for me SVN is rather more accurate than your patch...)

2) I tried disabling irq in lcd_write_reg + using FREQ>>24 and i saw one line repeated, with a value of 23 things seem to work better, i'll test it better tomorrow all day at work.

Yes, FREQ>>23 plus disabled IRQs seems to work fine for me too. Hopefully we've cracked it this time. ;D
Title: Re: Cowon D2
Post by: FranzD2 on December 01, 2008, 04:36:08 PM
1) About test_fps's results CPU: 48 Mhz
1/1 is 140.0 fps (main lcd update)
1/4 is 534.0 fps (main lcd update)
these values don't change when i use the touchscreen even if i circle with my finger or press multiple buttons, i tried several times but they don't change.

2) I tried disabling the busy wait loop but at the moment it is not a good idea, First: there are incorrect presses, Second: i see repeated lines again :-\ (only with the loop disabled). I think that this cycle is essential if we want to always read correct value, so we could try to optimize other things (BTW: a busy wait loop should be also placed when reading battery values)

3) I tried the touchcreen testing plugin, it seems that the empiric calibration is not so bad,

EDIT:

In touch_to_pixels try to modify "x = val_x / 3.5;" -> to -> "x = val_x / 3.1;"

I forgot to include this fix in the second patch.... :o

however the old calibration does not work with my patch (and i don't know why) so i had to replace it with some rough operation, maybe you can find a better solution :)

Title: Re: Cowon D2
Post by: dragongod on December 03, 2008, 02:27:04 AM
I'm confused. Justnow I started a v19309 and there got the "famous" problem: one (or two?) line(s) of top appeared at the bottom. But after I shut it off and power on again, It's just all OK.  I tried to reboot for another 3 times, still all OK. Only the first time got that problem.

it's a 2G D2 without DMB. i will try other values besides >>23 ,and try to make the problem reappear with the value 23.

EDIT:
I tried 22 23 24. 22 would cause the problem, and 23 24 would be OK. But I can't reappear that problem with 23...

EDIT2:
Oh here come again. 23 is unstable for me. Sometime it's OK and sometime it gets the problem. maybe i should use 24.
Title: Re: Cowon D2
Post by: Yeeze on December 06, 2008, 01:46:10 PM
I'm confused. Justnow I started a v19309 and there got the "famous" problem: one (or two?) line(s) of top appeared at the bottom. But after I shut it off and power on again, It's just all OK.  I tried to reboot for another 3 times, still all OK. Only the first time got that problem.

I think someone said, that the problem only appears when the original cowon firmware powers the display on right before the rockbox boot...
Title: Re: Cowon D2
Post by: ThibG on December 07, 2008, 10:15:48 AM
I just tried again and... the screen doesn't turn on. If I hold the power off "button" a few seconds, I can turn on my D2 again (under the Official Firmware).
Title: Re: Cowon D2
Post by: shotofadds on December 08, 2008, 11:18:33 AM
I just tried again and... the screen doesn't turn on. If I hold the power off "button" a few seconds, I can turn on my D2 again (under the Official Firmware).
You're going to have to give me a bit more information than that. What were you trying to do?
Title: Re: Cowon D2
Post by: ThibG on December 08, 2008, 01:10:05 PM
It's because of me... I have made a little script to update the local svn copy, rebuild the whole thing, and upload it to the D2... I didn't notice that the bootloader moved from ./bootloader/bootloader.bin to ./bootloader.bin
So, it works, and pretty well :)
I tried to boot 25 times, it worked the 25 times :)
The screen worked fine most of the time, but not everytime (I then booted on the OF, and rebooted to rockbox, it fixed the two top lines issue).
No weird sound when playing music, gapless playback, and all the good things of rockbox.
I played elephants dream, it worked very fine, except the first seconds.

There is a few seconds before the first music, during which rockbox "hesitate" about the remaining/total time of the song.
The date is completly off
Rockbox doesn't want to shut down if connected on USB
Rockdoom is stuck at "Starting Graphics engine" :(


I didn't tried the USB support.
One other (really, really, really minor) thing I have noticed is the shutdown message, that talks about low battery...
Title: Re: Cowon D2
Post by: 3amsleep on December 16, 2008, 01:58:28 AM
1.- Franz patch is working FLAWLESSLY for me!, GREAT JOB!  ;D

2.- i noticed something, maybe its normal but, when the screen "shuts down" it dosnt actually, i can still see VERY faintly whats going on. i guess its just the backlight going to "0" and the screen is still working... i think this could be potentialy eating a nice chunk off the battery.

3.- i noticed regular skips on some of my ogg tracks, audio skips always in the same position and with same "skip duration" on the same tracks. (each track has its own skipping position and duration)

4.- first post here!, hope i can help with the proyect. i been trying to learn C but i still cant understand 60% of whats going on inside the code XD,  i teached myself with cprogramming.com C tutorials, but i think thats not going to be enough... can anyone reccomend another good web resource/tutorial? ???.
Title: Re: Cowon D2
Post by: FranzD2 on December 16, 2008, 01:27:02 PM
Hi all!

I used rockbox on my D2 for some days and I noticed these problems,

1) The touchscreen stopped working two times
2) While i was listening Pink Floyd, the music stopped  :'(, the touchscreen and all the other buttons stopped working
3) While i was listening Claudio Cordero, the music stopped and the player turned off

Anyone noticed some of these?
Title: Re: Cowon D2
Post by: 3amsleep on December 16, 2008, 01:47:53 PM
Hi all!

I used rockbox on my D2 for some days and I noticed these problems,

1) The touchscreen stopped working two times
2) While i was listening Pink Floyd, the music stopped  :'(, the touchscreen and all the other buttons stopped working
3) While i was listening Claudio Cordero, the music stopped and the player turned off

Anyone noticed some of these?

yeah i noticed that too, it has happened to me like 2 times also, but i think its just the unreliable nand driver.

i also noticed sometimes if you are using a m3u playlist and you skip the tracks too fast, the player will crash on some tracks.
Title: Re: Cowon D2
Post by: FranzD2 on December 16, 2008, 02:39:40 PM
Yes I think so too, i also noticed some "Bad Checksum"

I have some improvement in the touchscreen patch but I'm waiting to test it better, the actual patch has still some (very rare) error.
Title: Re: Cowon D2
Post by: shotofadds on December 16, 2008, 03:50:12 PM
Once again I'll re-iterate that the filesystem driver is unreliable and will lead to errors (which may include crashes - ie. unresponsiveness) during playback. There is a very good reason why the wiki has said that for at least the last 6 months, so until further fixes go in please don't report these kind of issues. It really doesn't make any difference what kind of music you're listening to.

Touchscreen improvements will come, but I can't commit your patch until a solution has been found to the CPU usage issue. I plan to look at it after the Xmas break, but it's very much a second priority after the filesystem driver.

I'm currently working on a PC-based simulation of the NAND driver (in conjunction with a large amount of raw data obtained using gevaerts' USB work) and hopefully that will yield some results soon. Unfortunately the main problem is that I have less and less time to spend on Rockbox work these days. :(
Title: Re: Cowon D2
Post by: markV on January 30, 2009, 04:32:43 PM
Hi,

I just saw a new Cowon D2 offficial firmware.  In case you missed it:
http://www.cowonamerica.com/download/cowon_d2_jsfw.html
(date on site is Jan 20, 08, but I think it's 2009)
or
http://iaudiophile.net/forums/showthread.php?t=25286

Won't beat Rockbox !

MarkV
Title: Re: Cowon D2
Post by: outlawman on February 05, 2009, 06:30:06 PM
does metronome plugin work on d2? mine's not... :(
Title: Re: Cowon D2
Post by: 3amsleep on February 07, 2009, 01:51:28 AM
I made a little patch that enables the user to change the tracks while on hold mode by pressing the minus or plus buttons.

Personally I think this feature comes really handy when you're on the street/bus/metro, since you don't have to get the D2 out of your pocket, thus keeping it safe =).

You can get it here http://www.rockbox.org/tracker/task/9875


#################################################

Also I used Francesco Rigoni button-touchscreen patch and added a way to switch between the 2 touchscreen modes so anyone can test/use them.

D2 starts in the common "button" touchscreen mode, to get into "pinpoint" touchscreen mode press the MINUS and MENU buttons together, to get back to "button" touchscreen mode press PLUS and MENU buttons together.

You can get the patch here http://www.rockbox.org/tracker/task/9590?getfile=18525
Title: Re: Cowon D2
Post by: vodi on February 08, 2009, 08:06:41 AM

Also I used Francesco Rigoni button-touchscreen patch and added a way to switch between the 2 touchscreen modes so anyone can test/use them.

Hi! This patch works very well, just 2 things:

I can't quit the "lamp" application (maybe there are others which can't get closed).
And the calibrations does not work very well on the right border, i will take a photo tomorrow.

good work!
Title: Re: Cowon D2
Post by: FranzD2 on February 08, 2009, 09:00:46 AM
And the calibrations does not work very well on the right border, i will take a photo tomorrow.

I Repeat: In touch_to_pixels try to modify "x = val_x / 3.5;" -> to -> "x = val_x / 3.1;"

I'm sorry i will soon commit a patch with this fix included. ;)

EDIT: Done,

http://www.rockbox.org/tracker/task/9590?getfile=18525

this patch is based upon 3amsleep altTouchscreenMode patch, so you only have to apply this one.
However the only change is x = val_x / 3.5; which has become x = val_x / 3.1, you can also do it by hand  :)
Title: Re: Cowon D2
Post by: outlawman on February 08, 2009, 03:32:32 PM
explain to ordinary user: how to add this feature? when i try to download a patch i see a bunch of codes
Title: Re: Cowon D2
Post by: Llorean on February 08, 2009, 03:33:29 PM
It's not for ordinary users. Patches are code, to be patched into the source code and then compiled.
Title: Re: Cowon D2
Post by: 3amsleep on February 08, 2009, 11:28:13 PM
@outlawman

like llorean said, "Patches are code, to be patched into the source code and then compiled.", if you wish i can compile a build with this patch for you to test.

@shotofadds

i been reading the code on the arm/tcc780x and it seems that the SD code is getting somewhere, do you think we can expect to be using our sd cards soon?

also, how is that nand driver going, any news so far?.


PS: im trying to understand the rockbox code, its going ok so far, but i think it's going to take some time before i can make any serious colaborations.

Title: Re: Cowon D2
Post by: FranzD2 on February 09, 2009, 12:39:26 PM

Quote
@FranzD2

i been reading the code on the arm/tcc780x and it seems that the SD code is getting somewhere, do you think we can expect to be using our sd cards soon?

also, how is that nand driver going, any news so far?.

PS: im trying to understand the rockbox code, its going ok so far, but i think it's going to take some time before i can make any serious colaborations.


Hi, I'm not working on that, ask shotofadds  ;)

@shoto

Can I help you somehow with that nand driver?
Title: Re: Cowon D2
Post by: buk on February 09, 2009, 01:16:52 PM
I'm starting getting into Rockbox code too.
I'm working on getting the "logf over usb" working, it's almost done (juste need minor changes in trunk) but I have issues with USB connection.
Sometimes Rockbox doesn't detect that usb cable has been plugged in. If I set the cpu frequency to 192MHz, the usb initialisation is OK but I have communication issues. The most surpising thing is that it works for days and suddently problems appears.
Does anyone experience this kind of behaviour ? (USB works fine with original firmware).

@shotofadds : if you need some help on the nand driver that do not need advenced skills, I'm ready to help too.
Title: Re: Cowon D2
Post by: 3amsleep on February 09, 2009, 01:32:13 PM
@FranzD2

lol, I just realised I confused you two.

@buk

In my experience with electronics (way more than with coding) I learnt that those "come and go" problems are (really) often caused by wireless interference and heat, they cause the oscillators to vary, thus changing the FCPU;  I would try to get the code to consider such oscillations with a nice calibration function.
Title: Re: Cowon D2
Post by: store88 on February 09, 2009, 10:01:55 PM
my D2(2G) firmware version 2.59
download patch from
ftp://andiators.homeip.net/D2%20rockbox/2009.01.21%20rev19825/d2N_patched2.59.bin

follow the instruction from
ftp://andiators.homeip.net/D2%20rockbox/2009.01.21%20rev19825/How%20to%20install.txt

but it seems not work for me
The screen shows:
Quote
*PANIC*
Unknown NAND: 0xEC 0xD5 0x14 0xB6 0x74

http://iaudiophile.net/forums/showthread.php?t=17854
And I try to use tcctool to patch
But get the same result

Any idea?
Title: Re: Cowon D2
Post by: 3amsleep on February 09, 2009, 10:31:21 PM
@store88

2.59 is new ground for rockbox, so if you want to test rockbox on your d2, revert to 2.57 or 3.57 and install rockbox.

anyway, what D2 model do you own? (2gb/4gb/8gb/16gb...)

PS: if you had a SD card on, get it out and try anyways.
Title: Re: Cowon D2
Post by: store88 on February 09, 2009, 10:58:58 PM
@store88

2.59 is new ground for rockbox, so if you want to test rockbox on your d2, revert to 2.57 or 3.57 and install rockbox.

anyway, what D2 model do you own? (2gb/4gb/8gb/16gb...)

PS: if you had a SD card on, get it out and try anyways.
I have metioned my D2 model is 2G
and follow the instruction I had get my SD out
I will try again on 2.59 firmware
Thx

I recompiled the source, and rebuilt the patch
as a result, it cannot work on 2.59 firmware(2gb D2)
maybe I need to roll back 2.57
'cause I don't know How to make rockbox work with 2.59
Title: Re: Cowon D2
Post by: vodi on February 10, 2009, 02:12:13 AM
Hi!
What's the exact command you used for patching the firmware?

./mktcctool /path/to/D2_2.59/1/D2N.bin /path/to/bootloader.bin /path/to/patched/D2N.bin

should output a correct patched Firmware.

I use Rockbox on a 8GB D2 with 3.59, i don't think there is too much difference to 2.59.
Title: Re: Cowon D2
Post by: store88 on February 10, 2009, 02:43:09 AM
@vodi
./mktcctool D2N.bin bootloader.bin D2N-2.59.bin
D2N.bin is copied from folder 1

@all
I failed again, when I try 2.57 firmware
Maybe my machine is different at all

I bought D2 in China, is a reason?
or rockbox cannot work with 2Gb D2?

Title: Re: Cowon D2
Post by: vodi on February 10, 2009, 02:54:01 AM
Then you maybe have a different NAND, this would be interesting for shotofadds.
Title: Re: Cowon D2
Post by: store88 on February 10, 2009, 02:58:06 AM
@vodi

what is the meaning of "shotofadds"

and how can I get the Nand details of my D2
Title: Re: Cowon D2
Post by: vodi on February 10, 2009, 03:01:46 AM
"shotofadds" is the only active NAND-Driver Developer i know, but i don't know, him and he is now a pretty long time inactive.
Title: Re: Cowon D2
Post by: store88 on February 10, 2009, 03:15:20 AM
Wow, Nand driver programming, I know nothing about it
It seems related to bootloader closely.

Maybe I will give up the effort of patch my D2 in order to run rockbox in it
Title: Re: Cowon D2
Post by: vodi on February 10, 2009, 03:50:27 AM
these programming skills are like magic for me ;-)

The only programming language i really know is Java. And i haven't heard about any JVM for rockbox. This would be an idea for a nice plugin ;-)!

EDIT:
I'm not the first guy with this idea:
http://www.rockbox.org/tracker/task/7072
http://www.rockbox.org/tracker/task/2903
Title: Re: Cowon D2
Post by: store88 on February 10, 2009, 03:59:13 AM
I'm a java developer too.
newbie of java
just work for 1 year ;D
Title: Re: Cowon D2
Post by: outlawman on February 10, 2009, 10:14:28 AM
3amsleep, it would be great!
Title: Re: Cowon D2
Post by: mcuelenaere on February 10, 2009, 12:55:36 PM
@store88:

The panicf() you get was because the NAND ID driver doesn't have any data for that specific NAND, you'll need to look up what NAND chip corresponds with those identify bytes and add them to nand_id.c

@all:
Please keep this on-topic, Java has nothing to do with Rockbox nor the Cowon D2..
Title: Re: Cowon D2
Post by: saratoga on February 10, 2009, 01:04:25 PM
mcuelenaere:  Usually we just delete off topic posts and remind the people posting them of the forum guidelines via PM.  That way threads remain somewhat readable.
Title: Re: Cowon D2
Post by: 3amsleep on February 10, 2009, 02:06:24 PM
@outlawman

here is the patched rockbox build you asked for, it includes the alternative hold and touchscreen modes, just unzip to your D2 root and overwrite the old .rockbox folder.

http://rapidshare.com/files/196478306/rockbox.zip

enjoy =)
Title: Re: Cowon D2
Post by: store88 on February 10, 2009, 08:28:01 PM
@mcuelenaere
How can I get Nand chip responds

"Unknown NAND: 0xEC 0xD5 0x14 0xB6 0x74"
Is this the responds you mean
Title: Re: Cowon D2
Post by: isanggon on February 11, 2009, 12:01:00 AM
store88,

How about try to download and use another version of patched firmware. May be There wasn't hardware change on D2.

As I know, all of the D2's hardware are made in korea. And rockbox works well on latest selled version of D2 :)

Title: Re: Cowon D2
Post by: store88 on February 11, 2009, 01:38:08 AM
@isanggon

I only tried 2.57 and 2.59

In addtion, another guy in a chinese forum has the same error as mine.
He or she use 3.57 firmware

@all
I have no brave of taking apart of my D2
I'll try rebuild the source and patch my D2 firmware, but my D2 is in "low battery" status now

I add the following code in nand_id.c
Quote

                                              /* K9GAG08U0 */
    {0xD5, 0x14,             128,            8192,      2048,         64,          2,          3 },

maybe it will not work, but I will try later

and now the error is:
*PANIC*
bmp tag not present
The rockbox I used is the lastest version(February 11, 2009)
Title: Re: Cowon D2
Post by: mcuelenaere on February 11, 2009, 07:38:15 PM
store88:

You'll need to look for a datasheet for that specific NAND chip which specifies the needed information to add in nand_id.

The 'bmp tag not present' error is TCC-specific, and AFAIK only shotofadds can help you with that..
Title: Re: Cowon D2
Post by: store88 on February 11, 2009, 08:36:36 PM
My D2's battery in charge, test wait 3 hours

I don't know where to get a datasheet for that specific NAND chip
And I did the following step:
compile in "D2 and Bootloader" style,
But copy the 7z file from http://download.rockbox.org/daily/cowond2/rockbox-cowond2.zip, uncompress it to D2 root directory.

next time, I'll try add this instead of nandinfo I added before.
Quote
                                              /* K9GAG08U0 */
    {0xD5, 0x14,             128,            8192,      4096,         128,          2,          3 },

when I patch the bootloader to d2N.bin(version 2.59)
It displays
Quote
original firmware entry point: 0x2000006c
New entry point: 0x203204fc



Should rockbox.d2 be recompiled, If bootloader is changed?

--------------------------
Now I can see the rockbox logo now
and the infomation in the lcd is
Quote
Ata
mount
File not found
the rockbox I tested is from the daily build

and my D2 cannot be turned off now :(

Title: Re: Cowon D2
Post by: Noobtaculus on February 11, 2009, 08:59:18 PM
I'm sorry this is such a noob question, how do I compile the bootloader to patch the Cowon firmware? Or can someone direct/send me to a pre-patched set of files? And how well is 2.59 working with this RB? Thanks in advance.
Title: Re: Cowon D2
Post by: store88 on February 11, 2009, 09:17:29 PM
@Noobtaculus

you can download from ftp://andiators.homeip.net/

And there is a "how to install.txt" in that server.

It's likely most people can success, except me.

@all
Now I copy the rockbox.d2 out of .rockbox directory
My D2 can find the rockbox.d2 now.
A new error comes:
Quote
ATA
mount
Length: 778A8
Checksum: 0
Model name:
Loading rockbox.d2
Sum: 1FFFEE7
Bad checksum
this is release 3.1

And I had tried recent daily buid too

my D2 can't load firmware from /.rockbox/rockbox.d2
but /rockbox.d2 is ok

and the Sum is 18
but in the config-cowond2.h
Quote
/* Offset ( in the firmware file's header ) to the file CRC */
#define FIRMWARE_OFFSET_FILE_CRC 0
Title: Re: Cowon D2
Post by: buk on February 14, 2009, 04:21:51 PM
@Noobtaculus

you can download from ftp://andiators.homeip.net/

And there is a "how to install.txt" in that server.

It's likely most people can success, except me.

@all
Now I copy the rockbox.d2 out of .rockbox directory
My D2 can find the rockbox.d2 now.
A new error comes:
Quote
ATA
mount
Length: 778A8
Checksum: 0
Model name:
Loading rockbox.d2
Sum: 1FFFEE7
Bad checksum
this is release 3.1

And I had tried recent daily buid too

my D2 can't load firmware from /.rockbox/rockbox.d2
but /rockbox.d2 is ok

and the Sum is 18
but in the config-cowond2.h
Quote
/* Offset ( in the firmware file's header ) to the file CRC */
#define FIRMWARE_OFFSET_FILE_CRC 0
With recent build, be sure to update your bootload too. I just had the Checksum error after an update on my working copy, it was solved by reinstalling the bootloader.
Title: Re: Cowon D2
Post by: store88 on February 14, 2009, 11:56:14 PM
@buk
I updated my bootloader again with the recent build.
and rebuilt add following into nand_id.c
Quote
                                              /* K9GAG08U0 */
    {0xD5, 0x14,             128,            8192,      4096,         128,          2,          3 },

but lcd still displays:
Checksum: 0
Sum: 18

and still can't find rockbox.d2 from .rockbox/ directory.
only can recognize /rockbox.d2


And, can anyone build the bootloader for me
add the new nand_id
maybe there was something wrong that I didn't know occurs while I
built the bootloader.
Title: Re: Cowon D2
Post by: shotofadds on February 15, 2009, 11:10:29 AM
Hi guys, sorry for the extended break. Things have been rather busy for me over the last month or two but I should able to spend time on Rockbox again now. Unfortunately due to my own incompetence I haven't been getting email notifications about this thread, so I didn't know people were having trouble...

@store88, could you maybe try this nand_info line instead?

Code: [Select]
                                              /* K9GAG08UOM */
    {0xD5, 0x14,             128,            4096,      4096,        128,          2,          3 },

Note: You don't need the bootloader to try this - just build a new rockbox.bin and upload it using tcctool.

I have not yet tried any of the x.59 firmwares on my D2 but I can see no reason why it could cause a problem.

Quote from: store88
and my D2 cannot be turned off now :(

You've probably already noticed this, but you can always turn a D2 off by holding the power switch for 8 seconds or longer, or by pushing the stylus in the reset button...
Title: Re: Cowon D2
Post by: store88 on February 15, 2009, 08:02:43 PM
@shotofadds
I tryid the nand_id you suggested.
And I got the error: Max NAND write caches reached.


I think the number 8192 is right.

and I used to turned off the D2 by the way of turing the switch button back and forward.
and that some time works for me.

now I use the reset button to turn if off.
Title: Re: Cowon D2
Post by: shotofadds on February 16, 2009, 04:15:10 AM
Hmm, I have an idea what the problem might be. So far we have only encountered two different NAND chip types in the D2 and iAudio 7, and helpfully both happen to use the same style of physical block layout (4 physical blocks to 1 logical 'segment').

The other Telechips ports (Sansa M200, Logik DAX) have different NAND chips and use 1 physical block to 1 logical segment. I think yours may fit into this category (or maybe different again...)

If you can wait a few hours til I get home from work I'll provide a test build for you, which will print some numbers to your screen that will help me debug this issue.

btw. 4096 is definitely correct - I checked the value from the Cowon firmware.
Title: Re: Cowon D2
Post by: shotofadds on February 16, 2009, 02:10:47 PM
@store88,

Could you try uploading this build with tcctool please? It should show the Rockbox logo and then a page full of text (hex numbers) - could you post the results here or in a PM please.

http://www.megaupload.com/?d=4PAQ7QHK

Thanks!
Title: Re: Cowon D2
Post by: buk on February 16, 2009, 06:15:31 PM
I just put a patch on flyspray (http://www.rockbox.org/tracker/task/9917) that allow the use of the usb serial driver.
To enable logf over usb, you have to :
 * Enable "logf over usb" in debug menu before plugging cable
 * Plug usb cable
 * on linux "modprobe usbserial vendor=0x0781 product=0x7450", then a /dev/ttyUSBX should appear
 * use any serial communication program with /dev/ttyUSBX, or just cat /dev/ttyUSBX

(see http://www.rockbox.org/twiki/bin/view/Main/PortalPlayerUsb)

I didn't experiment transferring bunch of data but maybe it would freeze the D2  like when transferring files with usb storage.
Title: Re: Cowon D2
Post by: store88 on February 16, 2009, 07:51:01 PM
@shotofadds
it reads:
Quote
total banks: 1
0,0: FF FFFF
0,1: FF FFFF
0,2: FF FFFF
0,3: FF FFFF
1,0: FF FFFF
1,1: FF FFFF
1,2: FF FFFF
1,3: FF FFFF
2,0: FF FFFF
2,1: FF FFFF
2,2: FF FFFF
2,3: FF FFFF
3,0: 13 0007
3,1: 13 0007
3,2: FF FFFF
3,3: FF FFFF
4,0: FF FFFF
4,1: FF FFFF
4,2: FF FFFF
4,3: FF FFFF
5,0: 13 0009
5,1: 13 0009
5,2: FF FFFF
5,3: FF FFFF
Title: Re: Cowon D2
Post by: shotofadds on February 17, 2009, 07:42:44 AM
I just put a patch on flyspray (http://www.rockbox.org/tracker/task/9917) that allow the use of the usb serial driver.

Thanks, that sounds really useful. I'll have a look and see if we can get those changes into SVN (disabled by default, of course). I'm not too familiar with the USB code so I will need to check those changes are ok, though.

it reads:
Code: [Select]
...
3,0: 13 0007
3,1: 13 0007
3,2: FF FFFF
3,3: FF FFFF
...
5,0: 13 0009
5,1: 13 0009
5,2: FF FFFF
5,3: FF FFFF
...

Ok, it looks like your D2 is using 2 blocks per segment, as opposed to the usual 4. I should be able to produce a build that works, but first I need to add in some code to detect this at runtime based on the NAND chip id. Check back in a day or two...
Title: Re: Cowon D2
Post by: kugel. on February 17, 2009, 02:19:50 PM
I just wanted to note, that the D2 build runs on the Samsung P2. The only problem was the LCD, which was functional, but used wrong x/y dimensions.

It might be of interest to design the D2 LCD driver as dimension-independant as possible. IIRC there are at least some spots in it where it has fixed values instead of LCD_WIDTH/_HEIGHT.

Note, this is all according to a guy, who "just tried" it and played around with the lcd driver.
Title: Re: Cowon D2
Post by: shotofadds on February 17, 2009, 02:45:38 PM
@kugel, I'll reply to that over in the P2 thread. ;)
Title: Re: Cowon D2
Post by: Bryan.Brake on March 02, 2009, 12:52:44 PM
question:

Do the Rockbox devs have a D2 to crunch on?  If someone was to donate a D2, who would they send it to?  I have thought about getting a D2, since they are still selling them, and they aren't HD-based players, and 32GB SDHC is cheaper.

Title: Re: Cowon D2
Post by: shotofadds on March 03, 2009, 05:00:46 PM
Do the Rockbox devs have a D2 to crunch on?  If someone was to donate a D2, who would they send it to?  I have thought about getting a D2, since they are still selling them, and they aren't HD-based players, and 32GB SDHC is cheaper.

That's a very kind offer, but I'm not sure how much it would really help. There already are (or were, at least) 3-4 Rockbox devs who own D2s, but those same devs are already busy enough working on existing targets/other projects. An alternative, if no-one takes up your offer of a D2 to work on, might be a small donation to the general Rockbox fund (http://www.rockbox.org/twiki/bin/view/Main/DonatedMoney) (although it won't go towards any specific porting effort).

Ok, it looks like your D2 is using 2 blocks per segment, as opposed to the usual 4. I should be able to produce a build that works, but first I need to add in some code to detect this at runtime based on the NAND chip id. Check back in a day or two...

@store88: Could you try again with the latest build from SVN? r20186 contains some changes which should allow your D2 to boot now.
Title: Re: Cowon D2
Post by: store88 on March 04, 2009, 10:27:30 PM
it works now on my D2
thx very much
Title: Re: Cowon D2
Post by: buk on March 19, 2009, 05:28:24 PM
I post a patch on Flyspray (http://www.rockbox.org/tracker/task/10035) to enable FM radio.
There's some empirical calibration for the frequency measurement (due to the lack of hardware based udelay). I don't know if this calibration is device independent so feedback are welcomed.

I have no idea on how implementing an accurate udelay, I guess we have to find some TCC78x functions. Maybe I will try to investigate reverse engineering of OF but it seems to be a very tedious task...
Title: Re: Cowon D2
Post by: shotofadds on March 20, 2009, 07:22:26 AM
Thanks, nice work! I'd already done the basic work to communicate with the FM chip, but I didn't get very far without a usable logging mechanism. Presumably your logf-over-usb patch was rather useful for this...

Regarding udelay(), I've been meaning to fix that for a while. It should actually be rather simple so I'll try to implement that (and also the missing __timer_set() etc calls) in the next day or two. Watch this space...
Title: Re: Cowon D2
Post by: shotofadds on March 20, 2009, 08:26:39 PM
With a proper udelay implementation, those modifications to the FM driver are no longer necessary, so I've taken them out and committed the rest of this patch. The FM radio now seems to work quite nicely! :)

If you're going to test this, do remember that the filesystem is read-only so you won't be able to save presets etc - but there are a large number of ready-made preset files available here (http://www.rockbox.org/twiki/bin/view/Main/FmPresets). If there isn't one available for your area you can always create one with a text editor.
Title: Re: Cowon D2
Post by: buk on March 21, 2009, 04:56:19 PM
Thanks for implementing udelay function, now it works very well !

Maybe the SS_CTRL value should be increased. It seems to be used to determine if the stations signal
level allow stereo decoding. With the actual value, I can hear some noise with some stereo stations.
In the OF, the SS_CTRL seems to be higher than rockbox.
Title: Re: Cowon D2
Post by: Japio on March 22, 2009, 08:44:02 AM
First of all great work you guys! I tried installing Rockbox on my D2 yesterday and it works pretty good.
The Last.fm log file doesn't seem to be saved on my D2 though, despite enabling "Last.fm Log" in the Playback Settings. After a reboot of the D2 the setting is turned back on "No" (disabled).
Can someone please take a look at this?

I'm using firmware 2.57 and rockbox version 2009.03.21 rev20423.
Title: Re: Cowon D2
Post by: gevaerts on March 22, 2009, 08:55:41 AM
First of all great work you guys! I tried installing Rockbox on my D2 yesterday and it works pretty good.
The Last.fm log file doesn't seem to be saved on my D2 though, despite enabling "Last.fm Log" in the Playback Settings. After a reboot of the D2 the setting is turned back on "No" (disabled).
Can someone please take a look at this?

I'm using firmware 2.57 and rockbox version 2009.03.21 rev20423.

There is no write support on the D2 yet, so *nothing* gets saved
Title: Re: Cowon D2
Post by: Japio on March 22, 2009, 09:02:28 AM
I see, bummer.
Title: Re: Cowon D2
Post by: hpfmn on March 25, 2009, 03:58:28 PM
Is it alowed to ask whether there is any development on the sd card driver (reading would be nice and write extreamely awsome!)?

It seems there is currently no development ... I really get pissed of by the corrupted databases of the orginal firmware and I think with this feature rockbox would be almost perfectly usable (than there is just this ugly music buffer thing)
Title: Re: Cowon D2
Post by: outlawman on March 26, 2009, 04:19:20 PM
there are menu items like "cut, delete"... called with long pressing menu button. but they doesn't work. is it because of "read-only" thing?
Title: Re: Cowon D2
Post by: vodi on March 26, 2009, 04:20:50 PM
there are menu items like "cut, delete"... called with long pressing menu button. but they doesn't work. is it because of "read-only" thing?
Yes. Nothing, which needs write-access can be done. This means also cut & delete.
Title: Re: Cowon D2
Post by: markV on March 26, 2009, 11:53:16 PM
Hi Group !

I have one or two questions and, two or three observations...

First (neophyte) question: I know Rockbox bootloader is patched in the original firmware with mktccboot, does that mean Rockbox is like a "parasite" application ?  I mean does Rockbox send commands to the hardware through the original software or directly to the hardware ?

Second question: I remember having seen somewhere on this site something about database corruption being related to a bad bootloader patching or something...  Is that what I'm experiencing on the "original firmware side" (complete database corruption, like 'hpfmn' wrote) or this database corruption is really just from the new Cowon 2.59 firmware ?

Ok, now some observations I made (could this help) on my Rockboxed (v. r20457-090322) 8GB D2:
1- when the backlight goes to sleep there is still a faint (so faint !) amount of light emitted when using a white background theme (like iCatcher)
2- I still got the two-bottom-lines-at-top problem, like once in 20 boots or so (random for sure)
3- I have a weird problem when getting the power button back from the locked position: most of the times the player goes to a paused state but gets back to the main menu and can not resume playing.  A less frequent symptom is the player shutting down after a couple of clicks.

Aside from that, Rockbox is now very usable on the D2 !
Thanks for putting so much effort in this great application !!

MarkV
Title: Re: Cowon D2
Post by: Pivot on March 27, 2009, 11:54:52 AM
I did specifically ask whether the lack of a pre-compiled bootloader was holding anyone back from testing, so that response was entirely justified. As I'm sure you know, user testing can be incredibly helpful even in early stages of development.

If there are people who would find it useful, I see no problem providing a mktccboot binary (with associated bootloader.bin), especially given that we already provide a pre-built rockbox.zip and tcctool, too.
Hi, I am looking for pre-built mktccboot (with associated bootloader.bin). I would try Rockbox on my D2 and haven't develop's environment.

If it is possible..... many thanks.

Regards
Title: Re: Cowon D2
Post by: hpfmn on March 27, 2009, 01:19:41 PM
First (neophyte) question: I know Rockbox bootloader is patched in the original firmware with mktccboot, does that mean Rockbox is like a "parasite" application ?  I mean does Rockbox send commands to the hardware through the original software or directly to the hardware ?

Okay I don't know but I think it uses the hardware directly and is just patched into the main firmware to boot the whole thing up ;)

Second question: I remember having seen somewhere on this site something about database corruption being related to a bad bootloader patching or something...  Is that what I'm experiencing on the "original firmware side" (complete database corruption, like 'hpfmn' wrote) or this database corruption is really just from the new Cowon 2.59 firmware ?

I Just spoke about the "normal" Datacorruption of 2.59 (are there more Problems with this release?)

and I would just like to have a nice platform to stark hacking :) - but I think my skills are to low for drivers
Title: Re: Cowon D2
Post by: Rapide_23 on March 28, 2009, 01:16:28 AM
I just flashed my D2 to the D2+ firmware with rockbox.

However, when I try to boot rockbox, all I get is "*PANIC* Max NAND write caches reached".

I'm using a 16GB D2. Did I not install something properly, or is rockbox still not quiet ready for the 16GB?

Any help would be greatly appreciated.
Title: Re: Cowon D2
Post by: shotofadds on March 28, 2009, 07:04:56 PM
Maybe the SS_CTRL value should be increased. It seems to be used to determine if the stations signal level allow stereo decoding. With the actual value, I can hear some noise with some stereo stations.
In the OF, the SS_CTRL seems to be higher than rockbox.
I always found it quite annoying that the OF seems to need a particularly strong signal before it will enable stereo. The current behaviour in Rockbox seems to match what I'd expect from a portable device, so I think we should leave it how it is (and there's always the Force Mono option if you prefer it...)

Is it alowed to ask whether there is any development on the sd card driver (reading would be nice and write extreamely awsome!)?
You can ask but you might not necessarily get an answer! There was some work done on an SD driver a while ago, but I'm not sure of its current status.

First (neophyte) question: I know Rockbox bootloader is patched in the original firmware with mktccboot, does that mean Rockbox is like a "parasite" application ?  I mean does Rockbox send commands to the hardware through the original software or directly to the hardware ?
Rockbox is a complete firmware replacement, so it doesn't use any part of the original firmware. The only reason we patch the original firmware at all is to provide the dual-boot function. You could potentially flash just Rockbox, without the Cowon firmware, but that would be rather silly at this stage...

Second question: I remember having seen somewhere on this site something about database corruption being related to a bad bootloader patching or something...  Is that what I'm experiencing on the "original firmware side" (complete database corruption, like 'hpfmn' wrote) or this database corruption is really just from the new Cowon 2.59 firmware ?
It's extremely unlikely that Rockbox could affect anything in the Cowon firmware. I've never seen any reports of this or "bad bootloader patching"...

Ok, now some observations I made (could this help) on my Rockboxed (v. r20457-090322) 8GB D2:
1- when the backlight goes to sleep there is still a faint (so faint !) amount of light emitted when using a white background theme (like iCatcher)
2- I still got the two-bottom-lines-at-top problem, like once in 20 boots or so (random for sure)
3- I have a weird problem when getting the power button back from the locked position: most of the times the player goes to a paused state but gets back to the main menu and can not resume playing.  A less frequent symptom is the player shutting down after a couple of clicks.
1. Yeah, I see that too. It's because the LCD isn't actually being switched off, only the backlight. This is intentional for some Rockbox targets, as the screen can still be read with no backlight. I should fix that, as it's wasting power having the LCD switched on all the time.

2. It looks like there's still a timing problem in the LCD init code, but it seems to happen much less often now. I need to study the OF code again to see how they do it. :P

3. This is a flaw in the keymapping. To get out of hold mode you need to slide the hold switch and then press another button to see the screen. If you slide the switch all the way over, it acts as a POWER key press - this is mapped to STOP, which will stop playback and exit to the menu. I'm not sure how best to solve that.

Hi, I am looking for pre-built mktccboot (with associated bootloader.bin). I would try Rockbox on my D2 and haven't develop's environment.
First of all, Rockbox isn't really ready for general use (mainly just for development / testing at the moment) so we haven't made easy installation tools available yet. I did intend to provide some pre-built tools to aid people testing builds, but I wanted to wait until the NAND code was more reliable. It's not ready yet...

I just flashed my D2 to the D2+ firmware with rockbox.  However, when I try to boot rockbox, all I get is "*PANIC* Max NAND write caches reached".
What version of the bootloader did you use to patch the firmware (or did you download someone else's pre-patched build)? There was a fix a few weeks ago (r20168) which might help.
Title: Re: Cowon D2
Post by: Rapide_23 on March 28, 2009, 07:55:59 PM
What version of the bootloader did you use to patch the firmware (or did you download someone else's pre-patched build)? There was a fix a few weeks ago (r20168) which might help.

I'm using the one on iaudiophile: http://www.iaudiophile.net/forums/showthread.php?t=26360 (The patched 3.02 in the download link at the bottom of the first post).
Title: Re: Cowon D2
Post by: shotofadds on March 28, 2009, 08:11:30 PM
That's the problem when other people distribute builds - I don't know exactly what version it is, or what other changes it might contain. So it's pretty much impossible to debug.

Are you able to use tcctool? If so could you try a debug build I made a few weeks ago for someone with a similar problem. See here (http://forums.rockbox.org/index.php?topic=10164.msg144920#msg144920).
Title: Re: Cowon D2
Post by: Rapide_23 on March 28, 2009, 08:26:27 PM
That's the problem when other people distribute builds - I don't know exactly what version it is, or what other changes it might contain. So it's pretty much impossible to debug.

Are you able to use tcctool? If so could you try a debug build I made a few weeks ago for someone with a similar problem. See here (http://forums.rockbox.org/index.php?topic=10164.msg144920#msg144920).

Thats the problem. I don't know how to build a bootloader  :'(
Title: Re: Cowon D2
Post by: Yeeze on April 01, 2009, 06:11:20 PM
@Rapide:
Here: http://www.rockbox.org/twiki/bin/view/Main/DocsIndex#For_Developersis everything you need. It takes a little while to read and to setup everything, but then you can always build the newest version and you are independent.

@shotofadds:
Quote
It's because the LCD isn't actually being switched off, only the backlight. This is intentional for some Rockbox targets, as the screen can still be read with no backlight. I should fix that, as it's wasting power having the LCD switched on all the time.
As far as I can see, the OF also only switches the backlight off. The D2's screen is hard to read without backlight, but still possible under the right light conditions.
Do you really think it drains that much battery?
Title: Re: Cowon D2
Post by: shotofadds on April 02, 2009, 06:48:47 AM
Do you really think it drains that much battery?
The LCD itself probably isn't that much - the backlight will be a much more significant battery drain. Still, on some other players (eg. iPod Video) a nice boost in battery lifetime has been gained by switching off the LCD when not in use. Although if we power off the LCD, it does take some time to power on again, so the "user experience" might not be ideal...

On a related note, I recently had Rockbox playing music constantly for over 24 hours, so our battery usage at the moment isn't exactly terrible. I'm not really too concerned about power consumption at the moment - I think the D2 port has rather bigger issues to worry about than that. :(

ps. I haven't mentioned it here yet, but the "user timer" has now been implemented, so things like the Metronome plugin and Doom should now work properly.
Title: Re: Cowon D2
Post by: luck3r on April 02, 2009, 02:43:19 PM
The OF only turns off the LCD 30 seconds (or so) after the backlight was switched off, but stops updating the screen, as far as I can see.

Edit: I can confirm that Doom works now, although the sound quality is low and the MIDI music doesn't play yet. Radio is also working fine.

Something else: The delay until Rockbox turns off the device is too long. The device would automatically shutdown after a few seconds if the power switch was held for >1s AFAIK. Maybe this can be prevented by the firmware?
Title: Re: Cowon D2
Post by: markV on April 04, 2009, 12:10:46 AM
Hi

Is it just me or is the current version of the bootlader broken ?

I bricked my D2 three times (on OF 2.59 and 3.57) trying to get the latest svn version...
It usually works well compiling and patching ...

Thanks
MarV
Title: Re: Cowon D2
Post by: andiator on April 04, 2009, 05:09:00 AM
Well, the revision 20603 works.
Did you run the configure tool?
Running make you get the message that your version is old and you should run configure, is it that case?
Title: Re: Cowon D2
Post by: Rapide_23 on April 04, 2009, 11:08:46 AM
Andiator, I downloaded the patched 3.02 file and rockbox build from your website, but I still get the NAND panic after flashing and trying to boot into rockbox....
Title: Re: Cowon D2
Post by: markV on April 04, 2009, 01:03:55 PM
Hi,

@Andiator,

svn  tells me "revision 20615" (today).

I've done:
make clean
configure --target=33 --type=B
make,
I've had no problem.

mktccboot bootloader d2N.bin d2new.bin

Thanks,
MarkV
Title: Re: Cowon D2
Post by: andiator on April 04, 2009, 01:37:41 PM
Rapide_23,
do you have the new D2+ or the old (reflashed) one?
My 3.59 works fine, so I think it's the old NAND driver problem.
You can try to remove and copy files from/to D2 internal memory and then start rockbox. It helps sometimes.
Or you can backup your files and format the internal memory. Then copy back the .rockbox directory and try again.


@MarkV
so does
Quote
I've had no problem.
mean it worked? Anyway I'm going to try the new revision.
Title: Re: Cowon D2
Post by: Rapide_23 on April 04, 2009, 06:01:02 PM
Mine is the old D2 flashed to the newer 3.02 firmware.
Title: Re: Cowon D2
Post by: markV on April 04, 2009, 10:57:34 PM

@andiator,

I'm sorry; I meant the "make" went well, but the bootloader bricked my D2.

Is there a way to check the mktccboot process ?  Is the "entry point" output tells something about the "patching" success ?

Thanks again,
MarkV
Title: Re: Cowon D2
Post by: andiator on April 05, 2009, 04:52:18 AM
That's strange, the rev. 20615 works well on my D2 (3.59). Did you try if my build (20603) works?
I'm using the debian virtual machine, downloaded somewhere here, for build.

mktccboot says:
2.59:
  original entry point: 0x2000006c
  new entry point: 0x203204fc
3.57:
  original: 0x000068
  new: 0x2037b658

Greets,
  Andreas
Title: Re: Cowon D2
Post by: markV on April 05, 2009, 07:16:13 PM
Hi Andi,

Here both OF (2.59 & 3.57) give:
original firmware entry point: 0xe59f00ec
New entry point: 0x2001afd4

I'm on a complete Linux system (Mandriva 2008).
Maybe I should check my make system ? (whatever that means ?)

And here, the rockbox-info.txt output:
Target: cowond2
Target id: 34
Target define: -DCOWON_D2
Memory: 32
CPU: arm
Manufacturer: tcc780x
Version: r20615-090405
Binary: rockbox.d2
Binary size: 110540
Actual size: 110540
RAM usage: 570006100
gcc: arm-elf-gcc (GCC) 4.0.3
ld: GNU ar 2.16.1
Host gcc: gcc (GCC) 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)
Host system: Linux

My D2 seems (hard to say) to shut off rapidly in the firmware upgrade process...?

Thanks,
MarkV
Title: Re: Cowon D2
Post by: andiator on April 06, 2009, 03:06:29 AM
Do you use the right d2n.bin? from the directory '1' ?
Title: Re: Cowon D2
Post by: markV on April 06, 2009, 09:17:00 PM
Hi Andiator,

Strange was the key word in your preceding reply... 
When it's strange it is usually due to a fool's mistake !
Well I'm a fool: I inverted the arguments on the mktccboot line !  :-\  I'm sorry...

Thank you very much for your patience,
MarkV


Title: Re: Cowon D2
Post by: andiator on April 07, 2009, 03:10:48 AM
No problem,
I'm glad it's working again.  :)

And you don't want to know what stupid bugs I do always hide im my own code   ::)
Title: Re: Cowon D2
Post by: Rotareneg on April 12, 2009, 08:39:30 PM
According to the wiki, the lack of a USB connection to dump the raw flash data is one thing that's holding up a proper flash driver. Has the regular audio output been considered? The player seems to have enough RAM and processor power to allow enough compression to reduce the amount of data sent to a manageable level (at least if you make sure that any unallocated space is cleared, either by formatting or adding big empty files.) You'd have to write software on the PC side to receive the data as well, but altogether it would seem to be a relatively simple process?
Title: Re: Cowon D2
Post by: gevaerts on April 12, 2009, 09:11:10 PM
According to the wiki, the lack of a USB connection to dump the raw flash data is one thing that's holding up a proper flash driver. Has the regular audio output been considered? The player seems to have enough RAM and processor power to allow enough compression to reduce the amount of data sent to a manageable level (at least if you make sure that any unallocated space is cleared, either by formatting or adding big empty files.) You'd have to write software on the PC side to receive the data as well, but altogether it would seem to be a relatively simple process?

Does the wiki still say that? If so, it's outdated. Shotofadds has used USB to get at the data.
Title: Re: Cowon D2
Post by: Rotareneg on April 12, 2009, 09:48:31 PM
Yep,
Quote
Investigate and implement a software USB stack (the ability to dump raw NAND data to a PC would help item 1 considerably).
Title: Re: Cowon D2
Post by: shotofadds on April 15, 2009, 04:02:33 AM
I'll fix the wiki page - the D2 has had semi-working software USB for some time now, although it's disabled in the main builds. In fact, it's the main reason that reading from the internal flash is as reliable as it is today.

The wiki page could really do with a bit of general updating - at the moment it doesn't even have a status table of what works and what doesn't.
Title: Re: Cowon D2
Post by: grantmasterflash on April 26, 2009, 12:21:36 AM
I just flashed my D2 to the D2+ firmware with rockbox.

However, when I try to boot rockbox, all I get is "*PANIC* Max NAND write caches reached".

I'm using a 16GB D2. Did I not install something properly, or is rockbox still not quiet ready for the 16GB?

Any help would be greatly appreciated.

There must be some boot issue with Rockbox on D2's that have been upgraded to D2+ firmware, cause I'm having this same  "*PANIC* Max NAND write caches reached" problem referred to by Rapide_23.  I also notice a few people have posted in the D2 Rockbox iAudiophile forum with this issue on D2->D2+ (for example, http://iaudiophile.net/forums/showpost.php?p=230625&postcount=6). 

I used to play around with Rockbox when I was on D2 3.57 with no boot problems (never experienced this PANIC message), but since flashing my D2 to D2+ 3.02, I can no longer boot Rockbox because I always see this PANIC message.

I've tried this with Andiator's 3.02 Rockbox bootloader available from his ftp site (2009.04.01 rev20603) and with a bootloader I compiled myself earlier today with the daily build (090425).

I'll be glad to help with debugging this issue on my device if anyone can tell me what is needed.  I'm not completely new to using/installing Rockbox, but I am new to debugging it.
Title: Re: Cowon D2
Post by: shotofadds on April 27, 2009, 05:14:19 PM
I'm still trying to work out why upgrading to the D2+ firmware causes these problems for some people.

The D2+ firmware doesn't seem to use a new version of the Telechips NAND driver (both D2+ x.02 and D2 x.58 contain the identifer string "SIGBYAHONG_TNFTL_TCC78X_V000474", whereas this version number did change slightly in some older versions) - so there shouldn't be any difference as far as Rockbox is concerned.

The "obvious" thing might just be to try upping the MAX_WRITE_CACHES value in firmware\target\arm\ata-nand-telechips.c (eg. from 8 to 16), and then re-compiling the bootloader. I can't see why that should be necessary, though.

If that still doesn't work, I'll need to write some code to print out some more debug information from your D2. Without being able to reproduce the problem myself or be able to retrieve data directly from your D2, this could be tricky. :-[
Title: Re: Cowon D2
Post by: grantmasterflash on April 28, 2009, 09:53:09 AM
The "obvious" thing might just be to try upping the MAX_WRITE_CACHES value in firmware\target\arm\ata-nand-telechips.c (eg. from 8 to 16), and then re-compiling the bootloader. I can't see why that should be necessary, though.

If that still doesn't work, I'll need to write some code to print out some more debug information from your D2. Without being able to reproduce the problem myself or be able to retrieve data directly from your D2, this could be tricky. :-[

I upped MAX_WRITE_CACHES in firmware\target\arm\ata-nand-telechips.c from 8 to 16 and recompiled the bootloader.  Unfortunately, I still get the PANIC message.

If there's anything I can do to provide some debug, I'll be glad to help.  Just let me know.
Title: Re: Cowon D2
Post by: grantmasterflash on May 05, 2009, 09:57:56 AM
Regarding these "*PANIC* Max NAND write caches reached" errors during Rockbox boot I've been receiving since flashing my D2 to the D2+ firmware:

I flashed back to D2 3.59 firmware, then flashed to D2+ 3.02 firmware, then put the latest daily Rockbox bootloader and zip build on my device.  Rockbox is now booting without a problem and I haven't seen these messages at all.  I don't know if the reflashing fixed this or if something has changed in the most recent Rockbox builds.
Title: Re: Cowon D2
Post by: shotofadds on May 06, 2009, 01:13:04 PM
Well, that's interesting, but unfortunately it gives me nothing to go on in order to fix the problem. If you find a way of making these errors happen repeatably, do let me know...
Title: Re: Cowon D2
Post by: 3amsleep on May 28, 2009, 11:41:55 PM
I (really) hate to be such a nuisance, but I been looking every day here and in the trunk for the last year for any significant updates... I would really like to know if im just losing my time cause it seems to me that shotofadds lost interest in the project and though many people have offered help with the nand driver I've never seen any response from him regarding that.

is there anybody actually developing MMC support?, are there any NAND improvements not jet released?, shotofadds if you're just over the whole D2 thing, please just tell us so we can figure a way to keep the port developing.
Title: Re: Cowon D2
Post by: Llorean on May 28, 2009, 11:53:52 PM
Why are you hinging everything on one person?

At any point, any of you can pick up and continue working on things. Those who wish to "help" with NAND can attempt to work on it on their own, see if they have any breakthroughs themselves, etc.

Instead of talking about how to "figure a way to keep the port developing", why not just develop?
Title: Re: Cowon D2
Post by: 3amsleep on May 29, 2009, 07:55:27 PM
Why are you hinging everything on one person?

At any point, any of you can pick up and continue working on things. Those who wish to "help" with NAND can attempt to work on it on their own, see if they have any breakthroughs themselves, etc.

Instead of talking about how to "figure a way to keep the port developing", why not just develop?

i understand what you mean, and I didn't want to hinge everything in shotofadds, but i think it would be nice if he can share some knowledge on the NAND driver so other people can catch up and do some work there. It seems to me that many people is counting on shotofadds to finish that driver, so if he says that he dosn't want to expend much time doing that, people will start working on that.

Personally i'd love to just go and finish the driver myself, but I have next to no skills/knowledge in that area, in fact many times I tried to understand how it works/what needs to be done, but i've failed miserably.

 I think comunication and organization have been missing in this project for the last year or so, I think it would be really helpful if shotofadds beign the project main developer states who is working in what, and where help is needed how.
Title: Re: Cowon D2
Post by: shotofadds on June 01, 2009, 05:16:38 PM
Apologies in advance for the long post.. :o

Now I don't mean to be rude, but please realise that everyone contributes to Rockbox in their spare time. That is, the time left in the week after working, eating (this is a big one for me!), sleeping, socialising, spending time with my friends/family and all those other mundane time-consuming things like trying to find a new place to live.

If there's some time left in the week after that, and I choose to spend it on Rockbox, then great. If not, then I really don't need to explain myself.

Also, don't assume that no posts here means that no work is going on (for example, I actually read your post while waiting for a D2 build to compile). Tasks like disassembling and fully understanding complex routines in the original firmware are long, slow jobs where you potentially won't see the results for months, and far more of that will be needed if we are to ever have read/write NAND capability.

Having said that...

It's quite obvious that the D2 port hasn't progressed as far as it could since it got audio playback and a reliable read-only filesystem last year. The reason for that is simple, and it's exactly as Paul says: as far as I know, no-one else has expressed any serious interest in working on low-level aspects such as the NAND driver or SD card driver. These are the two most important obstacles to usability of the D2 port, far moreso than issues with the touchscreen UI (imho).

Don't get me wrong, people have contributed all sorts of improvements and tweaks over time, and these are hugely appreciated. Unfortunately the fact remains that no-one seems to want to tackle low-level issues. The other Rockbox devs who own D2s (there are a few) have enough on their plate already, before worrying about "new" ports like the D2.

As far as the SD/MMC driver is concerned, the necessary specifications are freely available, links to the TCC7801 controller specs have been leaked several times on here and elsewhere, and the Cowon firmware is available for reverse engineering. Drivers for other players have been written using far less information than that in the past, but so far no-one has decided to work on it...

The NAND driver is a bit of a special case because it's rather complicated and there is no documentation whatsoever. I'm part way through documenting in plain English everything needed to read a logical sector of data (ie. what the driver does already). When this is complete I'll add this to the wiki in the hope of attracting some attention from others. Expanding the driver to a read/write capability may be possible one day, but only if a very significant amount of time and effort is spent on it.

I think comunication and organization have been missing in this project for the last year or so, I think it would be really helpful if shotofadds beign the project main developer states who is working in what, and where help is needed how.

The CowonD2Info wiki page already has sections listing Known Problems and Work To Be Done, and since I try to keep the page up to date with any significant changes, those are still current. What would you like to see beyond that?

Finally, let me just say I definitely haven't lost interest (remember I originally bought my D2 just to work on this!). I just don't have as much spare time to spend on it at the moment.
Title: Re: Cowon D2
Post by: GodEater on June 02, 2009, 04:09:15 AM
If there's some time left in the week after that, and I choose to spend it on Rockbox, then great. If not, then I really don't need to explain myself.

Too right mate. You don't owe anyone anything.
Title: Re: Cowon D2
Post by: grantmasterflash on June 03, 2009, 03:07:45 PM
This is probably a terrible time for a question like this, so first I'll say thanks to shotofadds and everyone that works on the Rockbox port.  Also, I realize the D2 port is far from finished, so it's a bit early for feature requests.

With all that said...

I see in some of the released Rockbox ports that there is an option to flip the display upside down.  Would there be a similar way to make an additional option in Rockbox for D2 for moving the display orientation from landscape to portrait mode (like a 90 degree and 270 degree option, so that the headphone port could be oriented at the top or bottom of the device)?

I'm guessing the answer is: Yes, get the code and do it.  If that is the case, I'll simply say that I bet there are much more capable programmers here than me, so if you get an inclination to this, I'll bet it would be very much appreciated by the D2 Rockbox community.
Title: Re: Cowon D2
Post by: shotofadds on June 03, 2009, 05:18:04 PM
I don't think flipping the display orientation at runtime would be possible without major changes. More realistically, you could potentially make a build that uses a 240x320 resolution instead of 320x240, "just" by changing the LCD_WIDTH and LCD_HEIGHT defines and making the LCD driver draw things sideways... I believe some other ports can be built this way already.

But yes, like everything else, it needs an interested programmer to implement it! I'm not saying I'm not interested, but there are more fundamental things to fix first...
Title: Re: Cowon D2
Post by: grantmasterflash on June 05, 2009, 01:24:02 PM
I guess the touchscreen grid would have to be reoriented as well, so that taps would correspond with how the screen layout has changed.

Flipping during runtime wouldn't be necessary, but I think it would be cool in the future to have another build or just instructions on what to change in the code so you could compile your own vertical Rockbox for D2.

Just an idea to throw out there in the idea pile.
Title: Re: Cowon D2
Post by: kugel. on June 22, 2009, 02:17:25 PM
shotofadds, just a small remark regarding r21465, I don't think you actually need USEC_TIMER. The AMS Sansas are doing it with plain current_tick (each 5 ticks 1 yield), so 77x could use this too.
Title: Re: Cowon D2
Post by: shotofadds on June 22, 2009, 03:17:17 PM
shotofadds, just a small remark regarding r21465, I don't think you actually need USEC_TIMER. The AMS Sansas are doing it with plain current_tick (each 5 ticks 1 yield), so 77x could use this too.
That would work too. ;)

I just copied another driver (I forget which) with the view that in the long run 77x would have USEC_TIMER too. 77x is somewhat unfinished in the timer department, eg. it currently doesn't have udelay() either. That could be fixed easily using the same method I used for 78x.

I think I'll leave it how it is, and implement the usec timer on 77x.

@everyone else, you'll be pleased to know that the "delay before playback starts" bug is fixed in r21465. I'm also working on a possible fix for the "Max NAND write caches reached" panic that some people reported.
Title: Re: Cowon D2
Post by: andiator on June 22, 2009, 03:45:06 PM
The new bootloader doesn't work for me. It hangs in bootscreen showing rev number. The first boot was funny: The screen had a distortion like an old analog tv set with poor receiving.
I have no idea what's wrong.
Title: Re: Cowon D2
Post by: shotofadds on June 22, 2009, 04:01:57 PM
The new bootloader doesn't work for me. It hangs in bootscreen showing rev number. The first boot was funny: The screen had a distortion like an old analog tv set with poor receiving.
I have no idea what's wrong.
/me slaps his forehead.

Yes, you're quite right. That change was never going to work for bootloader builds. The D2 doesn't have interrupts/threading in the bootloader, so adding calls to yield() is a recipe for disaster...

Just use the old bootloader for now, and I'll fix it as soon as I can.
Title: Re: Cowon D2
Post by: andiator on June 22, 2009, 04:16:16 PM
Yes, I already have installed the old one to see if it still works.
But hey, that's a nice improvement, the big delay is no more  :)
Title: Re: Cowon D2
Post by: shotofadds on June 22, 2009, 05:31:56 PM
As a quick update: I've managed to get interrupts/threading to work in the bootloader now, so a fix will be coming soon.

Unfortunately my SVN tree is now in such a mess it'll take a little while to clean things up and commit. Hopefully I'll have it fixed tomorrow.
Title: Re: Cowon D2
Post by: shotofadds on June 24, 2009, 04:01:49 AM
The above bootloader fix, and a fix for the "Max NAND write caches reached" panic that some users were seeing, are now in SVN (r21486).

Also, it seems that JPEG album art has become broken in recent versions (although this works in the sim, and the JPEG viewer plugin itself still works on target). I assume one of the recent optimisations isn't playing nicely on the D2 - I'll look into it soon.

EDIT: The JPEG problem is fixed now, too.
Title: Re: Cowon D2
Post by: buk on July 17, 2009, 03:25:49 PM
Thanks for your work on FS#10415 (http://www.rockbox.org/tracker/task/10415) shotofadds !
Work well on my D2 with a 4GB Kingston SDHC.

It is a really good replacement for NAND write support.
Title: Re: Cowon D2
Post by: shotofadds on July 19, 2009, 02:54:08 PM
A working read/write SD/SDHC driver has now been committed to SVN. The main things to note are:

- if you install .rockbox to an SD card and power on the player with the card inserted, this will be used as the primary drive. This means your settings/playlists/highscores/etc/etc will be saved to this drive, and these will be automatically re-loaded on startup.

- if you don't have an SD card inserted at power on, everything should work as before (Rockbox will boot from the internal memory and everything will be read-only).

- if you're feeling adventurous, you should be able to swap cards while Rockbox is running, but make sure to have the same .rockbox folder installed on both cards!

- if you booted from an SD card, the internal memory will show in the file browser as "<microSD1>" - This will be fixed eventually.

- if you booted from an SD card, and then remove the card, you can't view any files at all in the file browser until you re-insert a card. This is a bug that needs to be fixed.

- there is currently no support for MMC cards.
Title: Re: Cowon D2
Post by: vodi on July 20, 2009, 12:15:55 PM
Thank you all! This works fantastic with my 16GB SDHC card!
Title: Re: Cowon D2
Post by: shotofadds on July 20, 2009, 03:43:23 PM
I've just had a rather worrying issue where my 16GB SDHC card will no longer power up. It appears to be dead in both my D2 and with a PC card reader.  :'(

I can't be 100% sure whether this failure can be attributed to Rockbox or not, so in the meantime be very careful which cards you use with Rockbox. I wouldn't recommend using anything valuable until we have identified whether this driver really is safe to use.

I hadn't had any problems in a couple of weeks of use, until today's problem. It could be that I simply removed the card while it was in use or something like that, but it could equally be due to a software bug.

In short: for the time being only use cards you don't mind losing... you have been warned.
Title: Re: Cowon D2
Post by: Monkeytamer on July 21, 2009, 02:12:56 AM
Shotofadds: Amazing job with all of the recent updates and the entire port in general. This port has really breathed life into my Cowon D2. I like having so much more control over my device, and am really loving gapless. I have really missed using Rockbox and am thankful for another opportunity.

So far I am having a great results with the SD(HC) support on my 16GB A-Data SDHC card. The D2 just feels so much faster and more responsive; I have observed no instance of lag or poor performance and most features work quite well.

I haven't encountered any repeatable bugs/errors at the moment, but admit to encountering some initial trouble locating the "play" button, though I understand that this emanates from a lack of buttons.

Suffice to say, thank you for your efforts and revitalizing an already great Digital Audio Player.
Title: Re: Cowon D2
Post by: hpfmn on July 23, 2009, 06:39:28 PM
sound quite awesome that you got it work... I might try it out later :)

and I hope you'll find out what fucked up your card. Maybe it was the also the card itself and had nothing to do with rockbox as far as other people do not seem to have a problem... maybe also it has something to with the kind of cards.

btw. I don't use partitions on my card do I have to use partitions or will the card recognized if it is just one filesystem without partion/mbr settings?
Title: Re: Cowon D2
Post by: funman on July 23, 2009, 10:19:11 PM
An unpartitioned card with only a fat32 filesystem should be alright.
Title: Re: Cowon D2
Post by: Bkd11 on July 24, 2009, 01:48:55 AM
Maybe it was also the card itself and had nothing to do with rockbox as far as other people do not seem to have a problem... maybe also it has something to with the kind of cards.

He's not the only one. A couple of other people have reported problems. Over at iaudiophile.net shotofadds speculated that the power supply might not be shutting down properly, resulting in a spike in voltage which the card can't handle. He also said it might be something else entirely.

You might be advised not to use valuable cards until he finds/fixes this problem. That being said I've been using an A-data 16gb (class 6) card for the past 3 days without any problems. Although recently I've been removing the card before I shut it down and waiting till rockbox boots up before inserting it.
Title: Re: Cowon D2
Post by: shotofadds on July 24, 2009, 04:00:36 AM
The reason for thinking the above is that there seems to be no problem using cards in Rockbox continuously for long periods of time. Several people have run battery_bench tests which involve both reading and writing to the card periodically over a long time frame (eg. 18 hours). That suggests to me that the problem is either at startup (unlikely since the card works) or at shut down.

This also fits reports that people have encountered card corruption after initialising the database - which requires a reboot.

I do know that we power off the player differently to the Cowon firmware. We power off by telling the power management chip (PCF50606) to enter sleep mode, which cuts most of the internal power supplies. After writing some config files, the Cowon firmware mutes the audio codec, turns the lcd and backlight off, and then clears a GPIO (A7) and enters an inifite loop. It doesn't seem to write anything to the PCF except to turn the backlight off.

I will do some testing to see if we should be using the same mechanism.

@funman, FAT16 will do too. Just not FAT12.
Title: Re: Cowon D2
Post by: 3amsleep on July 24, 2009, 01:00:00 PM
WOW, Congrats Shotofadds on the SDHC driver!.

Unfortunately I couldn't get it to work with the only SD card I have now (a 256mb sandisk), the card mounts the player loads rockbox but then I think the conection with the card is lost somehow because the .rockbox dir on the card is lost (maybe the card unmounts?) and I get the "failsafe" mode.
Title: Re: Cowon D2
Post by: shotofadds on July 24, 2009, 01:23:28 PM
Is it possible you're using an SD-enabled bootloader but a version of rockbox.zip that doesn't support SD?

The most recent builds (since r21999) do not have the SD driver enabled, for safety reasons.
Title: Re: Cowon D2
Post by: 3amsleep on July 24, 2009, 01:51:26 PM
Is it possible you're using an SD-enabled bootloader but a version of rockbox.zip that doesn't support SD?

The most recent builds (since r21999) do not have the SD driver enabled, for safety reasons.

yeah I heard about that so I tried an older version.

Sorry my mistake, I thought it was an older version. Yep it works fine with an older version, thanks =).
Title: Re: Cowon D2
Post by: hpfmn on July 25, 2009, 10:13:30 AM
Hey it works really nice for me :) I really appreciate your work!

I'm just a bit afraid because I don't want to loose my card even it is just maybe something about 20€...

I hope you guys will find out what is wrong - if I can help in any way just tell me. keep up the good work
Title: Re: Cowon D2
Post by: shotofadds on July 27, 2009, 04:22:25 AM
I've posted an SD-enabled build over in the Official Testing Builds (http://forums.rockbox.org/index.php?topic=22337.0) forum. Please use that thread to report back any successes/failures using SD cards in Rockbox.

I've made a couple of changes which should hopefully help: we now power off the player using the same mechanism as the Cowon firmware, and there was also a problem where the power management chip could cut the power while Rockbox was still shutting down - and this could potentially have been while writing files to the SD card.
Title: Re: Cowon D2
Post by: grantmasterflash on July 30, 2009, 05:26:29 PM
Wanted to see if anyone has heard of this problem, has any ideas on what could be causing it, or knows what I could enable to debug it:

(I'm using shotofadds' official testing build with the SD driver, but this is unrelated to SD driver.  None of the files I'm referring to are on the SD card and I've noticed this problem with all Rockbox builds I've tried over the past few months).

I listen to mostly flac on my 16GB D2.  Every now and then I will be playing a track that suddenly abends due to some unknown error and the playback jumps immediately to the next track in the playlist.  I can recreate the problem over and over again at the same time point in whatever track exhibits the problem.  Rebooting Rockbox has no effect - the problematic track will stop playback at the same point and jump to the next even after many restarts. 

If I boot into the standard D2 firmware, the track will play without a problem (no skips).

I've found that I can fix the playback problem in Rockbox by deleting the problematic flac file from the D2 and then simply copying the file back from my PC to the D2 (so no change whatsoever to the file).

This happens with files that have metadata and that have no metadata (vorbis tags), so seems unrelated to that.

The problem has happened with many different files - for example, one album track with Vorbis tags that I ripped from CD, one live bootleg track with no Vorbis tags that I downloaded from a live performance torrent site, etc.  The other day a file encountered the error at about 3:40 into the track, another at 2:30, etc.  I find no common factor uniting the tracks that exhibit the problem, except that they have all been copied from my Ubuntu box onto the D2.

I don't listen to many mp3 files or other formats, so I can't say whether it is specific to flac or not, although I have not noticed the problem occurring with any format other than flac so far.

The fact that I can fix it by deleting the file from the D2 and copying it anew from my PC makes me wonder if it has to do with some fragmentation of the D2's internal memory that Rockbox doesn't like...  I don't know - I'm shooting in the dark.
Title: Re: Cowon D2
Post by: shotofadds on July 30, 2009, 06:28:26 PM
The fact that I can fix it by deleting the file from the D2 and copying it anew from my PC makes me wonder if it has to do with some fragmentation of the D2's internal memory that Rockbox doesn't like...  I don't know - I'm shooting in the dark.
Do these files play reliably if you play them from the SD card?

If so, the problem is most likely due to incorrect file data being read from the internal flash. There are almost certainly bugs left in our implementation of the NAND FTL (flash translation layer), and since FLACs tend to be rather large files they are likely to show this kind of problem more often than other formats.

Edit to add: Now we have semi-reliable SD access it should be much easier to debug NAND issues, however it's unlikely I'll find the time to look into this for a while.
Title: Re: Cowon D2
Post by: grantmasterflash on July 31, 2009, 12:13:28 AM
The fact that I can fix it by deleting the file from the D2 and copying it anew from my PC makes me wonder if it has to do with some fragmentation of the D2's internal memory that Rockbox doesn't like...  I don't know - I'm shooting in the dark.
Do these files play reliably if you play them from the SD card?

If so, the problem is most likely due to incorrect file data being read from the internal flash. There are almost certainly bugs left in our implementation of the NAND FTL (flash translation layer), and since FLACs tend to be rather large files they are likely to show this kind of problem more often than other formats.

Edit to add: Now we have semi-reliable SD access it should be much easier to debug NAND issues, however it's unlikely I'll find the time to look into this for a while.

Based on your question about the SD card, I did the following:

1.  Copied one of the 'skipping' files from internal memory to the SD card from within Rockbox using the context menu to copy and paste and played the file on the SD card

Result: File copied to SD still stopped playback at the same point as the original file did on internal memory

2.  Copied the same 'skipping' file from internal memory to the SD card using standard D2 USB mode (so just plugged to my PC), then booted into Rockbox and played the file on the SD card

Result: File copied to SD played without a problem

I would guess the results in #1 back up your theory about the NAND FTL, since copying the file from within Rockbox resulted in a duplicate file that exhibits the same problem.
Title: Re: Cowon D2
Post by: shotofadds on July 31, 2009, 03:54:04 AM
Yes, that's pretty conclusive. Accessing files from the internal flash is "fairly" reliable now (it's certainly much, much better than it used to be) but clearly it isn't quite 100% yet. I just need to find the time to look into it again. :-\
Title: Re: Cowon D2
Post by: mbk1969 on July 31, 2009, 06:25:05 AM
grantmasterflash, I have encounted the same problem
Title: Re: Cowon D2
Post by: kristinuk21 on July 31, 2009, 11:09:14 AM
grantmasterflash, I have encounted the same problem

Maybe a diff between original file and file copyed from memory would help someone find the issue faster!
Title: Re: Cowon D2
Post by: samokhov on July 31, 2009, 03:42:46 PM
I've copied a skipping file from internal flash to SD by RockBox and then compared to the original. 4 bytes differ. 4 bits, actually:

original value      misread value
7775
1416
23A3
B7F7

I've uploaded the files, if that helps:
http://samokhov.com/files/itwit/original.flac
http://samokhov.com/files/itwit/misread.flac
Title: Re: Cowon D2
Post by: shotofadds on July 31, 2009, 03:59:04 PM
Ah, it all becomes clear! Those are all single-bit errors, which is almost certainly because the NAND driver does not yet implemented any error correction (ECC). Nothing to do with the FTL, phew!

It should be relatively straighforward to add ECC, but try as I might I couldn't get any errors to show up on my D2 at all, so it makes testing rather difficult! It's another one for the to-do list I'm afraid...
Title: Re: Cowon D2
Post by: samokhov on July 31, 2009, 04:28:33 PM
It should be relatively straighforward to add ECC, but try as I might I couldn't get any errors to show up on my D2 at all, so it makes testing rather difficult!
I've got a 8GB D2+, maybe that matters.

UP: Then again, since grantmasterflash gets the same kind of errors on his 16GB D2, probably it doesn't  :-X
Title: Re: Cowon D2
Post by: grantmasterflash on July 31, 2009, 05:00:57 PM
It should be relatively straighforward to add ECC, but try as I might I couldn't get any errors to show up on my D2 at all, so it makes testing rather difficult! It's another one for the to-do list I'm afraid...

In my experience, I find one of these error-inducing files approx. every 10-12 tracks - for example, one track per flac album on D2 exhibits this problem.  If you rip a few CDs to flac (or convert 20-30 audio files you have, whatever you prefer), transfer these to your D2, load them into a playlist, and start listening, I would bet you'll encounter this issue (or at least I hope so, for the sake of getting to the bottom of the problem).
Title: Re: Cowon D2
Post by: kristinuk21 on August 01, 2009, 03:27:15 AM
In my experience, I find one of these error-inducing files approx. every 10-12 tracks

So how about a "how to reproduce" ???
If a bug is easy reproducible by someone that knows how to fix it, i'm pretty sure that it will be fixed. So if you really want to fix this thing ..why don't you give a hand ??
- steps required:
1) find Rockbox versions used
2) pick n tracks, [free tracks if possible :) ]
3) clear the player [delete all files except Rockbox - maybe a clean install would help more ]
4) copy files to the player [describe how...if you think it might help]
3) listen to the skip, mark it down somewhere
4) repeat procedure - see if reproducible
5) zip everything
6) if possible ask others to reproduce [with the zip]
6) file a bug (you know ..we have buttons in the left up :) )
7) then ask what can be done in order to help more the debug

Since you said is easy ... it shouldn't take you too long, besides...do you know how frustrating is to try to fix something that you can't reproduce ?? and it might take a lot of time, to find the bug...time that could be invested in other ....bugs.
Title: Re: Cowon D2
Post by: mcuelenaere on August 01, 2009, 06:20:24 AM
Ah, it all becomes clear! Those are all single-bit errors, which is almost certainly because the NAND driver does not yet implemented any error correction (ECC). Nothing to do with the FTL, phew!

It should be relatively straighforward to add ECC, but try as I might I couldn't get any errors to show up on my D2 at all, so it makes testing rather difficult! It's another one for the to-do list I'm afraid...
You do know there's a patch (http://www.rockbox.org/tracker/task/8669) for this on the tracker?
Title: Re: Cowon D2
Post by: shotofadds on August 01, 2009, 06:51:19 AM
Yes, but there are reasons why I can't use that code. It needs implementing afresh from the datasheet.
Title: Re: Cowon D2
Post by: mcuelenaere on August 01, 2009, 07:14:34 AM
Yes, but there are reasons why I can't use that code. It needs implementing afresh from the datasheet.
Then I suppose that patch should be closed/rejected?
Title: Re: Cowon D2
Post by: grantmasterflash on August 01, 2009, 11:28:01 AM
In my experience, I find one of these error-inducing files approx. every 10-12 tracks

So how about a "how to reproduce" ???
If a bug is easy reproducible by someone that knows how to fix it, i'm pretty sure that it will be fixed. So if you really want to fix this thing ..why don't you give a hand ??

Have you taken the time to read what I've posted here before lecturing me?  Clearly you have not.

I provided the exact Rockbox build I used in my first post about this (shotofadds' official test build with the SD driver enabled - see my post on 7/30 at 4:26pm), but the build is also unimportant - the problem has occurred with every Rockbox build for D2 for the past several months at least.  My message right before this post from you detailed exactly what can be done to reproduce it (see my post on 7/31 at 4:00pm).

Additionally, shotofadds has indicated he has a pretty good idea of what is causing it.  If more is needed from me, I will be happy to assist.

You are correct that I haven't filed a bug, but since shotofadds feels that this is due to lack of ECC, he can probably file a more intelligent bug about this than I can.  Additionally, I don't believe the bug tracker is for new ports that haven't been released yet, such as D2's Rockbox - my understanding is that it is for reporting bugs on the officially supported and released version of Rockbox.   

If you take the time to read what has already been posted here, you will find that your posting is pretty unnecessary, but thanks for the lecture.  Given your whopping 2 post total in this forum, I hardly think you should be doling out advice as if you're a seasoned veteran.
Title: Re: Cowon D2
Post by: markV on August 04, 2009, 05:05:21 PM
Hi,

I am using the test build version r22056M-090726 on my D2 8Gb + 2Gb SD card.  Everything is working well; I'm so happy Rockbox finally saves my settings !  Thank you so much !!!

Aside this, I've made the following observation: when using a 16Mb (yes, megs!) or 256Mb SD cards with the same test build, Rockbox boots then shuts down and never comes back.  The file system goes corrupted and I even had to reformat these SD cards. 
Why is that ?  At first I thought 16 Mb was not enough but 256Mb should be...

Is it because these cards are not SDHC ?

MarkV
Title: Re: Cowon D2
Post by: shotofadds on August 04, 2009, 06:41:25 PM
Aside this, I've made the following observation: when using a 16Mb (yes, megs!) or 256Mb SD cards with the same test build, Rockbox boots then shuts down and never comes back.  The file system goes corrupted and I even had to reformat these SD cards.
I've certainly not seen that behaviour before. I've tried a 16Mb card (which Rockbox won't recognize since it's FAT12 formatted) but it didn't experience any corruption - it just ignored it. I've also used a 512Mb non-SDHC card plenty of times without any trouble at all. Are you sure these aren't MMC cards?

Can you explain "Rockbox boots then shuts down and never comes back" in a bit more detail?
Title: Re: Cowon D2
Post by: markV on August 05, 2009, 10:15:37 PM
Yes, I've been able to reproduce the behaviour and note it down (sorry for the style):

With 16 Mb SD card copy .rockbox folder
boots
choose file - microSD1 [the first time I've reached a music file and even started playing, second time (after format + copy .rockbox folder) just saw the menu, then:
*PANIC* updating size on empty dir entry 42 [first time] 39 [second time]
wait 15-20 sec, nothing happens
no choice to power off
[I started the original firmware "by mistake"]
power on to reboot, shows usual Rockbox boot screen with the file not found error:
  ata
  mount
  file not found
plug it back to PC
empty .rockbox folder

256 Mb SD card copy .rockbox folder
first time boot:
  ata
  mount
  file not found
shuts down by itself
plug it back to PC
leaves only one weird named document :
·:
format + copy .rockbox folder
second time boot, error message:
  length 8FE0c
  checksum: 0
  model name:
  loading rockbox.d2
  read failed (image)
shuts down by itself
plug back to PC
no file left

That's about it.  I wrote that just in case it helps, not because it's a big problem (for me).
Just to mention, my PC is on Mandriva Linux and I used "drakdisk" to format both cards in FAT16.  You're right: my 16Mb card was also FAT12.  Is it wrong to try and format it in FAT16 (I mean could the result be weird with the file system and all ?)

Thank you,
MarkV

Title: Re: Cowon D2
Post by: shotofadds on August 06, 2009, 03:55:37 AM
I'm not familiar with drakdisk at all, could you possibly try a more standard formatter such as mkfs.vfat or even try formatting using a Windows machine? Or another card that still has the original manufacturer's format?

Incidentally, I'm not sure it's valid to have a 16Mb FAT16 partition at all - though I could be wrong. Certainly the Windows tools don't allow it and will always override with FAT12 instead.
Title: Re: Cowon D2
Post by: DiveSlip on August 06, 2009, 06:56:22 AM
Hi, guys. Honestly, I don't read all this theme, but on my forum (cowonworld.ru) one guy's posted (http://cowonworld.ru/forum/viewtopic.php?f=52&t=7&p=11220&hilit=sdk#p11220) two links with sdk and maybe you can find something interesting for you.
If you need some help with downloading, I'll help you, of course.
Title: Re: Cowon D2
Post by: pyro_maniac on August 06, 2009, 08:42:07 AM
Hi, guys. Honestly, I don't read all this theme, but on my forum (cowonworld.ru) one guy's posted (http://cowonworld.ru/forum/viewtopic.php?f=52&t=7&p=11220&hilit=sdk#p11220) two links with sdk and maybe you can find something interesting for you.
If you need some help with downloading, I'll help you, of course.

Did you take a look into these files?

EDIT: i did. The first file seems to be a backup of a telechip project folder or something like that. "TCC7xx DMP SDK" is named at many places. But there are Telechip copyrights everywhere. I don't know if its for the D2 because there is a WM8750 driver.
Title: Re: Cowon D2
Post by: DiveSlip on August 06, 2009, 09:00:39 AM
Did you take a look into these files?
Yes, I do. But that files are not useful for me.
Title: Re: Cowon D2
Post by: pyro_maniac on August 06, 2009, 09:05:19 AM
Yes, I do. But that files are not useful for me.

are the first and the second file similar?
Title: Re: Cowon D2
Post by: vodi on August 06, 2009, 09:25:23 AM
@shotofadds:

Today i copied some files from the internal flash to a 16GB SDHC card, because I have the problem, that some .flac files are skipped immediately while playing.

GNU diff only says
Code: [Select]
Binary files /media/D2/music/Texta/Blickwinkel/01 - Text vs. Autor vs. Hoerer.mp3 and /media/VODI_SDHC/music/Texta/Blickwinkel/01 - Text vs. Autor vs. Hoerer.mp3 differ
What tool should I use to compare the files?

Bye, Vodi
Title: Re: Cowon D2
Post by: DiveSlip on August 06, 2009, 09:57:52 AM
are the first and the second file similar?
No. The second file is about 1,1 GB. I can't say what the file contains, because a copy of the file is at home and I'm not.
Title: Re: Cowon D2
Post by: shotofadds on August 06, 2009, 01:10:14 PM
What tool should I use to compare the files?
You don't really need to. We already identified the likely cause of these problems earlier in the thread, so doing more diffs isn't going to help...

@DiveSlip / pyro_maniac:

Those Telechips SDK links have been posted here before, but since it is not open source (GPL) code there is no way we could use any of it in Rockbox.
Title: Re: Cowon D2
Post by: pyro_maniac on August 06, 2009, 02:30:32 PM
Those Telechips SDK links have been posted here before, but since it is not open source (GPL) code there is no way we could use any of it in Rockbox.

I know that to use the code is not allowed but the addresse may not help?
Title: Re: Cowon D2
Post by: dohashi on August 08, 2009, 12:16:20 PM
First, thanks for all the work getting the port where it is today.

I've been testing the latest firmware (version r22056M-090726 from the Rockbox info page).  I've noticed two problems.  First, I occasionally hear a very short skip or pause in playback.  Most of my music is in ogg format, stored on the internal memory, so it may be related to ogg playback.  I've listened to some mp3s and not noticed the skip there.

Also, I was able to crash rockbox with the following message (or similar to this, I wrote down the number, but not the whole message)

Illegal Instruction at
A0632000

I had a randomized playlist containing all the music on the player and when transitioning from one track to the next, rockbox would crash.  I was able to reproduce this a couple times at the same point, both by allowing the first track to finish, or by skipping the track.  However both tracks played fine on their own.

Darin
Title: Re: Cowon D2
Post by: blueblazer22x on August 08, 2009, 02:06:37 PM
I've been testing the latest firmware (version r22056M-090726 from the Rockbox info page).  I've noticed two problems.  First, I occasionally hear a very short skip or pause in playback.  Most of my music is in ogg format, stored on the internal memory, so it may be related to ogg playback. 


Darin



I've noticed the same problem of a short skip.  All of my music is OGG.

EDIT:  It seems that the skips only occur on OGG tracks played from the internal memory and they always occur in the same place.  If I rewind the skip occurs again and again at the same time in the track.  I haven't noticed any skips on my OGG tracks stored on the SD card (r22056).
Title: Re: Cowon D2
Post by: shotofadds on August 09, 2009, 03:07:09 PM
It seems that the skips only occur on OGG tracks played from the internal memory and they always occur in the same place.  If I rewind the skip occurs again and again at the same time in the track.  I haven't noticed any skips on my OGG tracks stored on the SD card (r22056).
A few posts back we identified a problem where single bit errors were found in files read from the internal memory, due to a lack of ECC error correction. You seem to be reporting the same thing. It's also quite possible this is responsible for the exception errors dohashi has seen.

I've partly implemented a fix for this, but it's not ready yet.
Title: Re: Cowon D2
Post by: vodi on August 10, 2009, 06:53:05 AM
Hi! I'm testing a SD/SDHC enabled build (r.....), placed all my .flac files on the SDHC Card and now they don't get skipped any more. But today I listened a few hours to music and the D2 often hangs on track changes (I see the WPS, but it doesn't play music or reacts on button presses), or it simply reboots or i get "undefined instruction". The latest was "Undefined instruction at 2009007C".

I don't think, this is related to the SD/SDHC function, so I posted it here, my SDHC card isn't corrupt at all.

bye, Vodi
Title: Re: Cowon D2
Post by: samokhov on August 10, 2009, 07:19:49 AM
vodi, it's probably the same problem that we've been talking about earlier: the lack of single-bit error correction. I presume that SD cards are quite capable of generating single-bit errors as well  ::)
Title: Re: Cowon D2
Post by: shotofadds on August 10, 2009, 12:53:33 PM
vodi, it's probably the same problem that we've been talking about earlier: the lack of single-bit error correction. I presume that SD cards are quite capable of generating single-bit errors as well  ::)
Actually, that's almost certainly not the case. SD cards and the internal memory both use NAND flash chips for storage, but SD cards have error-correction and an FTL built into the hardware itself. The internal NAND does not have this, so Rockbox has to implement these functions itself in software, hence the potential for bugs!

I've also seen occasional problems when skipping tracks (music stops and the WPS becomes unresponsive except for pressing POWER to return to the menu). Not sure what's causing that, but it seems a fairly recent problem. I get the same behaviour if I use PictureFlow to change tracks, but this usually only happens if I control PictureFlow with the touchscreen rather than physical buttons. How strange.
Title: Re: Cowon D2
Post by: ezzieyguywuf on August 11, 2009, 08:36:21 AM
I am interested in working on the touchscreen code. I think that what I'd like to do first is touch up the 3X3 stuff and then maybe get into the "absolute" touchscreen stuff. I have a little bit of coding experience, not tons, but I'm an engineer and like a good problem to solve  ;D

Step one for me would be to get rather familiar with all things touch screen related. I've seen this (http://svn.rockbox.org/viewvc.cgi/trunk/apps/keymaps/keymap-touchscreen.c?view=markup ) source file. I understoood mainly what was going on. What I need next is for some of you guys to point me to the right files that actually use this keymap. I unsuccesfully searched for them last night.

Step two is I want to add some new keys to that key map. I think I saw some discussion on something like this waaaaay back. But, similar to the current D2 firmware, a swipe from top to bottom would scroll down etc... I think this could me implemented rather easily by defining a new key as Top-middle-bottom with some maximum time period in between.

Those two steps in themselves should keep me busy for a while, and I'm hoping that they'll get me familiar enough with Rockbox to really add some functionality to the touchscreen support.

So, waddaya got?
Title: Re: Cowon D2
Post by: alfchin on August 11, 2009, 10:15:56 AM
I'am very sorry to trouble you but I think I'am facing a difficult situation while installing rockbox on some D2+,which Orginal Firmware is 3.11 when it comes from their manufactory,and which are sold in Korea.
I've used the same way to make the patched firmware of 3.11/2.11 as I did to those of 2.02/3.02.
However,it doesn't work on those new D2+.Also this kind of New D2+ can only flash the FW of 3.11/2.11,even with the help of TCC Tool.Neither does the bootloader with SD Driver work.
Could you please help me,please
Title: Re: Cowon D2
Post by: shotofadds on August 11, 2009, 04:13:20 PM
Also this kind of New D2+ can only flash the FW of 3.11/2.11,even with the help of TCC Tool.Neither does the bootloader with SD Driver work.
So you're saying for example that the D2+ firmware 3.02 doesn't work on your player? I think this might be the same issue seen here: http://iaudiophile.net/forums/showthread.php?t=30037

Can you try shining a bright light at your D2+ and see if anything is visible with either FW 3.02 or Rockbox?

If so we can be sure there are different variants of the D2+ that have different LCD backlight handling. If that's the case, someone will need to sit down with a disassembly of 3.02/3.11 and work out what the difference in backlight handling is...
Title: Re: Cowon D2
Post by: alfchin on August 12, 2009, 06:37:15 AM
Also this kind of New D2+ can only flash the FW of 3.11/2.11,even with the help of TCC Tool.Neither does the bootloader with SD Driver work.
So you're saying for example that the D2+ firmware 3.02 doesn't work on your player? I think this might be the same issue seen here: http://iaudiophile.net/forums/showthread.php?t=30037

Can you try shining a bright light at your D2+ and see if anything is visible with either FW 3.02 or Rockbox?

If so we can be sure there are different variants of the D2+ that have different LCD backlight handling. If that's the case, someone will need to sit down with a disassembly of 3.02/3.11 and work out what the difference in backlight handling is...
Thank you for  your help.
Here's the result:
When I flash to 3.11 patched firmware,and try to start Rockbox,however,there's nothing displaying on the screen with a bright light,just like it is powered of .Only when I used reset could I went into its orginal firmware .
When I tried  to flash 3.02 to the player,I can see the screen of the firmware update.However,when I tried to turn it on,I found its screen all blank,just like above.The computer can detect it as an normal D2+ when I connected it by USB cable.Then I have to flash 3.11 back,using the normal way.The firmware  update procedure  displayed nothing,and after it finished,d2+ can load 3.11,proving that the update was sucessful.
I guess that the new D2+s use a new LCD,which cannot drive it in the old way.
Title: Re: Cowon D2
Post by: shotofadds on August 12, 2009, 01:59:41 PM
Ok, so we know there's a difference in LCD and/or backlight handling in some newer D2+ units. Firmware 3.11 works with these as well as older players, so it obviously has a mechanism to detect and work with both types. Someone needs to do some disassembly to work out how this is done in the new firmware.

I'd look into it myself, but I'm about to go away for 2 weeks and I already have plenty of other things to do before then!
Title: Re: Cowon D2
Post by: shotofadds on August 12, 2009, 04:02:01 PM
Followers of this thread might be interested in a couple of recent changes:

r22283 re-enables the SD driver, since there have been no more reports of damaged cards.

r22284 implements ECC correction for files read from NAND, which should solve problems with tracks skipping unexpectedly when played from the internal memory.
Title: Re: Cowon D2
Post by: helloworld1 on August 12, 2009, 11:20:27 PM
Ok, so we know there's a difference in LCD and/or backlight handling in some newer D2+ units. Firmware 3.11 works with these as well as older players, so it obviously has a mechanism to detect and work with both types. Someone needs to do some disassembly to work out how this is done in the new firmware.

I'd look into it myself, but I'm about to go away for 2 weeks and I already have plenty of other things to do before then!

I can confirm that the backlight cannot be turned on in the new D2+ model. The 2.01 firmware cannot drive the backlight too. But 2.11 2.10 or 3.11 can drive the light. I am using the latest SVN to build the bootloader.

Under very very strong light, I can even see the rockbox logo. So LCD is working but the backlight.


EDIT:
How to dissemable the OF under Linux?, I am willing to help.
Title: Re: Cowon D2
Post by: shotofadds on August 13, 2009, 03:08:18 PM
Ok, I spent a couple of hours looking into this today and it looks like some new D2+ units have an entirely different power management chip, instead of the PCF50606 used by older D2+'s and the 'classic' D2.

Looking at firmware 4.11+ (since that is what I use on my player) it shows some interesting changes almost straight away:

- Follow the branch at 0x200000F8 (LDR PC,=0x20009BD4)
- In older firmwares, the first call in this routine starts writing to the PCF50606 almost immediately (using I2C slave address 0x10)
- In 4.11, this now tests the value of GPIOA6 (used for backlight control on older D2s) and stores a flag depending on its value
- Depending on this flag, the next routine (at 0x200722E4) either calls the PCF50606 init routine (0x200BD1C8) or another init routine (0x200BDBE8)
- The new init routine makes numerous I2C writes to slave address 0xE6, with completely different register addresses to the PCF chip.

Similarly, the backlight control routine (0x20072320) checks this flag, and calls either the PCF routine (0x200BD5C4) or a new one (0x200BE19C). To control the backlight brightness, this new routine writes registers 0x28 and 0x29 to I2C address 0xE6.

I don't know what this new chip is - anyone fancy opening their D2+ to find out? Although having said that, this disassembly should give us enough information to get Rockbox working eventually...  it's just that I won't be around for the next couple of weeks to look into it.
Title: Re: Cowon D2
Post by: samokhov on August 13, 2009, 04:21:00 PM
r22284 implements ECC correction for files read from NAND, which should solve problems with tracks skipping unexpectedly when played from the internal memory.
It seems to work great so far. I've had a track that only played a few seconds from the start. Now it plays the full 10 minutes. Thanks a ton!
Title: Re: Cowon D2
Post by: grantmasterflash on August 13, 2009, 05:30:46 PM
Followers of this thread might be interested in a couple of recent changes:

r22283 re-enables the SD driver, since there have been no more reports of damaged cards.

r22284 implements ECC correction for files read from NAND, which should solve problems with tracks skipping unexpectedly when played from the internal memory.

Nice work as always, shotofadds.  Many thanks on your hard work.  With ECC enabled, I'm not getting any of the track skipping behavior.

I do notice an issue where tracks that are on my SDHC card get added to the database nine times (so for each track, there are nine entries for that track in the database view).  This doesn't happen for tracks on the internal memory, only the music on the SDHC card.  I've tried deleting the .rockbox folder entirely and re-initializing the db, and still see the same behavior after the db is built each time.

I tried 2 scenarios:

1. Used a 128mb SD card - Put only one track on it, deleted .rockbox dir from the card and put a new .rockbox dir in place, then booted the device and initialized the db.  No duplication of the track on the SD card.

2. Used a 16GB SDHC card - This card is almost completely filled with music and only has ~250mb of free space on the card.  Deleted .rockbox dir from the card and put a new .rockbox dir in place, then booted the device and initialized the db.  The db initialization takes a very long time and all the tracks on the SDHC card are duped 9 times in the db.

What I mean by "duped 9 times" is that if I navigate to Database -> Artist -> The Clientele -> Suburban Light -> I then see 9 track 1s, 9 track 2s, etc., for example,

01. I Had To Say This
01. I Had To Say This
<etc. and 7 more until 9 total are listed, then>
02. Rain
02. Rain
<etc. and 7 more until 9 total are listed>

Obviously I went to two extremes there (128mb vs. 16GB).  Maybe has something to do with the amount of music on a large card?

This is with rockbox built from svn yesterday afternoon, r22286-090812, on D2 16GB.
Title: Re: Cowon D2
Post by: shotofadds on August 13, 2009, 05:44:53 PM
That's pretty bonkers, I don't know what could cause that...  maybe you could try to find if any particular track / combination of tracks triggers the problem?
Title: Re: Cowon D2
Post by: grantmasterflash on August 13, 2009, 06:36:18 PM
That's pretty bonkers, I don't know what could cause that...  maybe you could try to find if any particular track / combination of tracks triggers the problem?

Agreed, very bonkers.  I'll play around with paring down the amount of files on the SDHC card and see if the dupe behavior stops at some point.

No big deal.  Music is playing great now and I can use the file browser until I figure out what's going on.
Title: Re: Cowon D2
Post by: Chronon on August 13, 2009, 08:18:58 PM
There is an open bug at FS#8414 that has to do with duplicate entries in the database.  It has, so far, eluded a proper explanation.  It seems some of the database options may play a role in its appearance. . ..  Maybe you are seeing an instance of this bug.
Title: Re: Cowon D2
Post by: helloworld1 on August 13, 2009, 10:31:57 PM
Ok, I spent a couple of hours looking into this today and it looks like some new D2+ units have an entirely different power management chip, instead of the PCF50606 used by older D2+'s and the 'classic' D2.

Looking at firmware 4.11+ (since that is what I use on my player) it shows some interesting changes almost straight away:

- Follow the branch at 0x200000F8 (LDR PC,=0x20009BD4)
- In older firmwares, the first call in this routine starts writing to the PCF50606 almost immediately (using I2C slave address 0x10)
- In 4.11, this now tests the value of GPIOA6 (used for backlight control on older D2s) and stores a flag depending on its value
- Depending on this flag, the next routine (at 0x200722E4) either calls the PCF50606 init routine (0x200BD1C8) or another init routine (0x200BDBE8)
- The new init routine makes numerous I2C writes to slave address 0xE6, with completely different register addresses to the PCF chip.

Similarly, the backlight control routine (0x20072320) checks this flag, and calls either the PCF routine (0x200BD5C4) or a new one (0x200BE19C). To control the backlight brightness, this new routine writes registers 0x28 and 0x29 to I2C address 0xE6.

I don't know what this new chip is - anyone fancy opening their D2+ to find out? Although having said that, this disassembly should give us enough information to get Rockbox working eventually...  it's just that I won't be around for the next couple of weeks to look into it.

I crack open my 3-day D2+. Unfortunately I break the device's mic somehow.
I don't know where is the LCD controller chip. here lists most chips I can find on the main board.
PCF50635HN   (Is this one different from original?)
Samsung 919 (8G)
24020A
TCC7801
Samsung 840  K4M56323P I
MAX 1779
WM89859
8117 907A
D129C

The LCD screen have some text like this: ATOUCH A025 3DE4
Title: Re: Cowon D2
Post by: shotofadds on August 14, 2009, 04:22:45 AM
I crack open my 3-day D2+. Unfortunately I break the device's mic somehow.
I'm sorry to hear that. :(

Quote
PCF50635HN   (Is this one different from original?)
Well that's certainly different, but I can't find a datasheet to check any details. All the references suggest it's a smaller verison of the PCF50607, for which I can't find any details either. I guess I'll have to do some more investigative work when I get back from my holidays...
Title: Re: Cowon D2
Post by: helloworld1 on August 14, 2009, 07:09:01 AM
Have a good holiday!
I am looking forwards to the good news from you.

Also after massive searches, I also cannot find a datasheet of PCF506035 or PCF50607. Even the only datasheet of PCF50606 is from rockbox website. I will try to mail NXP semiconducts for the datasheet.
Title: Re: Cowon D2
Post by: 3amsleep on August 17, 2009, 07:28:37 PM
the "release events" patch is working nicely for me, the navigation is still a bit wacky from time to time, but it's a lot better now. thanks a lot shotofadds  ;D

PS: I've noticed that the mayority of wrong presses are interpreted as "left" events... maybe implementing a self calibration for the resistive pad would be the best option, since resistive pads tend to vary their response/resistivity a lot.
Title: Re: Cowon D2
Post by: vodi on August 18, 2009, 08:31:22 AM
Hey Guys!

Is it possible to use the "Touchscreen WPS" on the D2? If yes: How? Would it be good to set it as the "Standard WPS" for the D2?

bye, Vodi
Title: Re: Cowon D2
Post by: mcuelenaere on August 18, 2009, 09:26:43 AM
PS: I've noticed that the mayority of wrong presses are interpreted as "left" events... maybe implementing a self calibration for the resistive pad would be the better option, since resistive pads tend to vary their response/resistivity a lot.
There is already a calibration screen in Rockbox, but I'm not sure whether the D2 uses this..
Title: Re: Cowon D2
Post by: vodi on August 18, 2009, 10:31:26 AM
There is already a calibration screen in Rockbox, but I'm not sure whether the D2 uses this..
Yes, there is a "Touchscreen Calibration" menu item in settings.
Title: Re: Cowon D2
Post by: andrewthecoder on August 22, 2009, 10:57:58 AM
Jpeg resizing for album art seems to be messed up.
Take this 200px * 200px image, for example: http://rockbox.andrewbeveridge.co.uk/D2/cover.jpg

Rename to "cover.jpg", stick it in a folder with some tracks and play - it looks awful in the WPS compared to the same image in bitmap format: http://rockbox.andrewbeveridge.co.uk/D2/cover.bmp

Anybody have any light to shed on this?
I thought jpeg decoding was added to the core, so this wouldn't be a D2-specific thing, but after a brief chat on IRC it seems like it is.

When I get hold of a decent camera, I'll take photos to show exactly what I mean.
Title: Re: Cowon D2
Post by: mcuelenaere on August 22, 2009, 10:59:13 AM
...

When I get hold of a decent camera, I'll take photos to show exactly what I mean.
You could also use the System->Debug->Screendump feature..
Title: Re: Cowon D2
Post by: andrewthecoder on August 22, 2009, 11:10:14 AM
You could also use the System->Debug->Screendump feature..

I would, if it worked.
When it is enabled, and I connect my D2 to a usb port, nothing happens. I mean, no files are created.

It works fine in the simulator, but this problem does not occur in the simulator build.
Title: Troubles with SD card
Post by: Arago on August 27, 2009, 09:14:32 AM
Hello. Rockbox destroying FS on my SD card every boot. dd of=memcard if=/dev/sdd (http://uploads.arago.shell.tor.hu/rockbox/memcard.rar) (before boot), dd of=memcarddestroyed if=/dev/sdd (http://uploads.arago.shell.tor.hu/rockbox/memcarddestroyed.rar) (after boot). Rockbox r22502M-090824 (own build and daily builds, d2N_3.59.bin), (card from Canon IXUS 85IS, 32mb)), photos: http://uploads.arago.shell.tor.hu/rockbox/1.JPG, http://uploads.arago.shell.tor.hu/rockbox/2.JPG
Lock pin is ignored by Rockbox, it destroy FS with lock and without lock very vell. On another card (SanDisk 2gb) Rockbox work good, but this card from digital camera, i don't want replace it from D2 to IXUS and back too often... And that microscopic card would be wonderful, bookmarks there preserve and so. Tried it when only driver written - then too dying.
I used many different programms for partitioning and formatting: fdisk+mkfs.vfat, gparted, acronis disk director, and even ms format... I tried to partition it as HDD or as megafloppy - all the same result (( Those images - fdisk partitioning and gparted formatting.
Sorry for my english...
Title: Re: Troubles with SD card
Post by: helloworld1 on August 27, 2009, 01:55:45 PM
Hello. Rockbox destroying FS on my SD card every boot. dd of=memcard if=/dev/sdd (http://uploads.arago.shell.tor.hu/rockbox/memcard.rar) (before boot), dd of=memcarddestroyed if=/dev/sdd (http://uploads.arago.shell.tor.hu/rockbox/memcarddestroyed.rar) (after boot). Rockbox r22502M-090824 (own build and daily builds, d2N_3.59.bin), (card from Canon IXUS 85IS, 32mb)), photos: http://uploads.arago.shell.tor.hu/rockbox/1.JPG, http://uploads.arago.shell.tor.hu/rockbox/2.JPG
Lock pin is ignored by Rockbox, it destroy FS with lock and without lock very vell. On another card (SanDisk 2gb) Rockbox work good, but this card from digital camera, i don't want replace it from D2 to IXUS and back too often... And that microscopic card would be wonderful, bookmarks there preserve and so. Tried it when only driver written - then too dying.
I used many different programms for partitioning and formatting: fdisk+mkfs.vfat, gparted, acronis disk director, and even ms format... I tried to partition it as HDD or as megafloppy - all the same result (( Those images - fdisk partitioning and gparted formatting.
Sorry for my english...

32M memory card?! XD. I hope other people can help you.
Title: Re: Troubles with SD card
Post by: Arago on August 27, 2009, 04:04:02 PM
32M memory card?! XD. I hope other people can help you.
Do You mean the donation?
It's not a capacity, 16gb NAND is enough for me, and 32mb SD more than enough for Rockbox until it learns to write to NAND. And buy SDHC with 4/8/16/32...gb I do not see the need, but SD with 512/256/128...mb - do not see the point. This card I got quite by accident, but since I have it - I would like to use it to benefit...
Title: Re: Troubles with SD card
Post by: mbk1969 on August 28, 2009, 07:08:54 AM
card from Canon IXUS 85IS, 32mb... I used many different programms for partitioning and formatting

Are you shure that theese programms creates FAT32 file system on such small card?
Title: Re: Troubles with SD card
Post by: Arago on August 28, 2009, 11:13:15 AM
Are you shure that theese programms creates FAT32 file system on such small card?
No, they all says that it's impossible, FAT32 partition must be larger than 32mib. But for some IXUS-related reasons FS on 2gb card is also FAT16, and that card works normally with Rockbox, instead if this. I created FAT32 FS on card using dirty hack and got ATA mount File not found when booting. Card is not damaged, but Rockbox is not booting. Booted from NAND say that HD1 18.4mb/28.9mb, but not showing .rockbox dir on <microSD1> in file browser. This image (http://uploads.arago.shell.tor.hu/rockbox/memcardfat32.rar).
Title: Re: Troubles with SD card
Post by: samokhov on August 28, 2009, 02:11:35 PM
No, they all says that it's impossible, FAT32 partition must be larger than 32mib. But for some IXUS-related reasons FS on 2gb card is also FAT16, and that card works normally with Rockbox, instead if this.
Just to clarify: is your card being formatted as FAT16? Because if it's FAT12, that wouldn't work with Rockbox.
Title: Re: Cowon D2
Post by: shotofadds on August 28, 2009, 05:34:18 PM
Jpeg resizing for album art seems to be messed up.
Take this 200px * 200px image, for example: http://rockbox.andrewbeveridge.co.uk/D2/cover.jpg

Rename to "cover.jpg", stick it in a folder with some tracks and play - it looks awful in the WPS compared to the same image in bitmap format: http://rockbox.andrewbeveridge.co.uk/D2/cover.bmp

Anybody have any light to shed on this?
I thought jpeg decoding was added to the core, so this wouldn't be a D2-specific thing, but after a brief chat on IRC it seems like it is.
The core JPEG decoder has specific optimisations for the ARMv5 architecture used by the D2, and I don't think any supported Rockbox targets use these. So it's entirely possible that this problem only shows up on the D2 at the moment.

Can you identify which build version the problem started with, or has it always happened since the core JPEG decoder was added?

@Arago:

Yours is the second report of a corrupted FS when using very small (16/32Mb) SD cards. I haven't looked at your dump yet (memcard.rar) but I suspect it is either FAT12 masquerading as FAT16 somehow, or the Rockbox FAT driver does not like very small FAT16 partitions (seems unlikely). I have a similar card here that I can use to investigate soon - this needs to either be fixed, or at the very least it should refuse to mount the card rather than destroy the FS.

----

Also a quick update: while on holiday I've been using Rockbox for music playback from a 4Gb SDHC almost every day: on planes, trains, and as the main stereo system in our apartment. The only real problem I noticed was a number of "Unknown instruction" exceptions, and in each case I think this happened when switching between different track formats (eg. from MP3 to FLAC). I guess it needs a cache flush or so when loading a new codec...
Title: Re: Cowon D2
Post by: saratoga on August 28, 2009, 06:32:22 PM

Also a quick update: while on holiday I've been using Rockbox for music playback from a 4Gb SDHC almost every day: on planes, trains, and as the main stereo system in our apartment. The only real problem I noticed was a number of "Unknown instruction" exceptions, and in each case I think this happened when switching between different track formats (eg. from MP3 to FLAC). I guess it needs a cache flush or so when loading a new codec...

Sounds like the bug I fixed for AMS:

http://svn.rockbox.org/viewvc.cgi?view=rev;revision=21647

Are cpucache_flush and cpucache_invalidate defined for the D2?
Title: Re: Cowon D2
Post by: Arago on August 28, 2009, 06:56:13 PM
I tried FAT12 - Rockbox doesn't see this card. I tried different sectors per cluster (32-16 - Rockbox doesn't see card, 8-1 - destroy it). I dd'ed 2gb card to 32mb - Rockbox is thinking some seconds after boot, but not destroy this very strange card! And also it show empty .rockbox directory (but reads config, localization, rockbox.d2 and skin from it during boot process). My Linux says that FAT: Filesystem panic (dev sdd1), File system has been set read-only; not my windows falls into a stupor at the sight of this card and advises to format it. Image of this card is here (http://uploads.arago.shell.tor.hu/rockbox/alivecard.rar). Sorry for size, but i can't clean free space, if I try it on base card - dd'ed card is not booting, and dd'ed card is read-only FS.
Title: Re: Cowon D2
Post by: shotofadds on August 29, 2009, 11:36:17 AM
Sounds like the bug I fixed for AMS:

http://svn.rockbox.org/viewvc.cgi?view=rev;revision=21647

Are cpucache_flush and cpucache_invalidate defined for the D2?
Thanks, I remember this being discussed, but I hadn't yet found the revision containing the change. Those functions are not yet implemented for TCC, so that's almost certainly the problem. The generic ARM versions should be fine, so it should be easy to fix when I find the time.
Title: Re: Cowon D2
Post by: shotofadds on August 31, 2009, 05:51:33 PM
Jpeg resizing for album art seems to be messed up.
Fixed in 22577 (it was a typo in the ARMv5+ optimisations, as I suspected).

Lock pin is ignored by Rockbox
Sorry, I missed that when I read your post first time. That's definitely something that needs implementing, but I need to work out how to do it first (probably some GPIO pin). I'll have a look at the OF...
Title: Re: Cowon D2
Post by: helloworld1 on September 04, 2009, 11:07:40 AM
Have a good holiday!
I am looking forwards to the good news from you.

Also after massive searches, I also cannot find a datasheet of PCF506035 or PCF50607. Even the only datasheet of PCF50606 is from rockbox website. I will try to mail NXP semiconducts for the datasheet.

I have tried emailing NXP several time for the datasheet but no response at all. Maybe u can also have a try.

Some ipod also uses PCF506035 and works find with rockbox. I have found that they are linking against the pcf50605.c. Maybe you can investigate their works.
Title: Re: Cowon D2
Post by: shotofadds on September 04, 2009, 12:45:11 PM
Some ipod also uses PCF506035 and works find with rockbox. I have found that they are linking against the pcf50605.c. Maybe you can investigate their works.
Well, I looked into that already. The 50605 is largely register-compatible with the 50606 (and also has the same I2C address iirc) so would probably work already. Given that the changes between D2+ firmwares x.02 and x.11 are to support a completely different power management chip, I would say that's a read herring. :-\

Give me a bit of time to go through the firmware disassembly again, and I'll probably be able to make a test build for you that can enable the backlight/LCD - but I wouldn't really expect anything else to work.

Getting something displayed on the screen would be a good start though!
Title: Re: Cowon D2
Post by: Voluspa on September 06, 2009, 11:36:51 AM
Since "r22594: D2: Move ACTION_WPS_STOP" I've experienced two complete shutdowns (with non-hacked svn code) while long pressing BUTTON_TOPRIGHT. That is quite a lot because I usually don't stop the music ;-) It's not a crash. Message on display is just "Shutting down..."

And speaking of erratic touchscreen behaviour, have you seen the ca 8 pixel area left/right of at least bottom and top middle 'buttons'? Pressing those pixels overrides usual scrolling restrictions (like delay) and eternally loops with gusto in the file list view. No stop at top or bottom.

I managed to expand that bug to the whole 'button' area by twiddling with the lines below 171 in firmware/target/arm/tcc780x/cowond2/button-cowond2.c Don't remember if it was through just setting line 178 to "send_touch = false;" or through copying the whole x/y checks down to the else statement at line 182.

It has nothing to do with "#define TOUCH_MARGIN 8" though. I've tried settings of 1 to 64 with little change...

Mvh Mats
Title: Re: Cowon D2
Post by: shotofadds on September 08, 2009, 03:24:14 PM
And speaking of erratic touchscreen behaviour, have you seen the ca 8 pixel area left/right of at least bottom and top middle 'buttons'? Pressing those pixels overrides usual scrolling restrictions (like delay) and eternally loops with gusto in the file list view. No stop at top or bottom.
Hmm.. sounds like the button repeat mechanism isn't working correctly and you are seeing lots of single presses in a row instead. I'd guess this is because the raw data read from the touchscreen has a certain amount jitter, which we make pratically no attempt to correct for.

Have you seen/experimented with the test_touchscreen plugin (in apps/plugins/test_touchscreen.c - you'll need to add it to apps/plugins/SOURCES manually)?

Also, is it possible this started with r22314 (http://svn.rockbox.org/viewvc.cgi?view=rev;revision=22314)?
Title: Re: Cowon D2
Post by: Voluspa on September 08, 2009, 06:03:48 PM
Sorry, this gigantic thread reveals that you saw it already at May 01, 2008 when the touchscreen got a separate driver:

http://forums.rockbox.org/index.php?&topic=10164.msg124107#msg124107
"This plugin has already shown up a couple of issues on the D2:

1) Touching on/near the 'line' between two areas causes jitter between the two adjacent rectangles. This causes a stream of distinct button presses."

JdGordon responded in the next message that:
"1) yeah, i noticed that also, i think we need to add a error margin around the joins, or something"

So, an ancient issue.
Title: Re: Cowon D2
Post by: fish on September 15, 2009, 08:05:19 AM
@shotofadds
@helloworld1

I'v opend a bug to track this issue/new port:

http://www.rockbox.org/tracker/task/10607
Title: Re: Cowon D2
Post by: shotofadds on September 15, 2009, 01:49:47 PM
^^ I'm not sure if that's the "correct" thing to do, since we don't normally allow bug reports for unreleased ports like the D2.

btw. The datasheet you linked is for the PCF50603, not the PCF50635 (check helloworld1's post here (http://forums.rockbox.org/index.php?topic=10164.msg154638#msg154638)). And it's not a full datasheet anyway, since it doesn't contain any details of register addresses, etc.

Based on my disassembly of FW4.11 I can probably make a test build that turns on the screen/backlight, but I doubt very much that anything else will work... watch this space.
Title: Re: Cowon D2
Post by: fish on September 15, 2009, 08:44:50 PM
Ok sorry. I hoped it would help you to track is there. So I will try to help you here ;)

I'v googled a bit and stumbled about that:

https://electronics.wesrch.com/User_images/Pdf/16_1178305668.pdf

Quote
We de-potted the Philips part, revealing it to be a PCF50635, apparently a smaller version
of the PCF50607 used in the original nano

...and for that chip you have already some support, right? For the ipod nano?


amiconn suspects that the pcf50607 is a smaller version of the pcf50605:
http://www.rockbox.org/irc/log-20080311#21:12:28

That would make the PCF50635 = PCF50607 = PCF50605:

http://www.rockbox.org/wiki/pub/Main/DataSheets/pcf50606.pdf
http://svn.rockbox.org/viewvc.cgi/trunk/firmware/drivers/pcf50605.c?view=markup
Title: Re: Cowon D2
Post by: shotofadds on September 16, 2009, 04:28:08 AM
If that's really true, Rockbox would already work on your D2+, and Cowon would not have needed to add support for an entirely new power management chip in the x.11+ firmwares.

I can see from the disassembly that every time a power management function is needed (eg. to turn on the backlight) a decision is made which results in calling code which either communicates with the PCF50606, or some new chip. I explained all this several posts ago...
Title: Re: Cowon D2
Post by: Toni on September 17, 2009, 02:25:47 PM
I own a CowonD2+ with 4GB flash K9LBG08U0M. I have modified the ARM emulator to run the original CowonD2 code (4.59) for this flash type. The emulator supports some basic flash access emulation, basic lcd emulation, basic i2c emulation and rudimentary timer interrupt handling. It needs a complete dump of the flash for input. To keep the data clean, I bypass all flash write accesses into a different memory location. With this I come to the startup screen and can navigate between the menues. The code is still kind of hackish and compatible to MSVC6.0 only. If someone is interested, I have appended the code here (rename *.pdf to *.zip). The tool dumps all register and flash accesses and the latest (500000) executed instructions to files. Feel free to experiment with this but I will not have much time in the near future for any support.

Edit by karashata: removed attachment, moved it to CowanD2Info wiki page.
Title: Re: Cowon D2
Post by: shotofadds on September 17, 2009, 03:36:49 PM
Wow, nice work!

Really interesting too - I had no idea that so relatively few hardware registers would be needed to boot the OF under emulation. If the D2 used the hardware I2C controller instead of bit-banging GPIOs I guess it'd be even simpler...

I wonder how hard it would be to incorporate a gdb stub for interactive debugging? Or to incorporate this into something like QEMU which already has one... that would certainly open up some possibilities!

Edited to add: if you modify the emulator to boot from the EEPROM rather than loading in the executable to DRAM, does it successfully boot the OF from the NAND dump?
Title: Re: Cowon D2
Post by: Toni on September 17, 2009, 05:24:43 PM
I have no experience with gdb, but my sansa emulator, I think, has been successfully ported to gdb. I tried to execute the eeprom, but it fails after basic register initialization, when it comes to flash commands. After the reset command 0xffff the second command is 0x50 at location 0xe0000980, which I don't know, what it does. After issuing the command the bootloader reads 16 Byte, but I have no idea, how to fill them.
Title: Re: Cowon D2
Post by: saratoga on September 17, 2009, 05:28:40 PM
You should consider cleaning that up and getting it into SVN.  It'd be a nice tool.
Title: Re: Cowon D2
Post by: Llorean on September 17, 2009, 05:52:27 PM
Shouldn't it be on the wiki, rather than renamed and attached to a forum post?
Title: Re: Cowon D2
Post by: karashata on September 17, 2009, 06:29:34 PM
Removed attachment and moved it to the CowanD2Info wiki page.
Title: Re: Cowon D2
Post by: grep on September 18, 2009, 03:57:57 AM
I have been using rockbox with great satisfaction on my D2 so far, and have been looking for a way to "give back" something to this wonderful project.
Since I'm not a programmer and can't help with all the technical stuff, I've got my eye on that "Write the manual" item on the todo list and have been reading the ManualHowto page.

But before I get started with all that I'd like some confirmation if it's the right time to start with this. Is it perhaps too soon to start writing the D2 manual, since the release is still not a supported rockbox target?
Title: Re: Cowon D2
Post by: shotofadds on September 18, 2009, 04:32:35 AM
I'd say it's a great time, since it's unlikely to ever become supported without a manual ;)
Title: Re: Cowon D2
Post by: shotofadds on September 20, 2009, 04:18:22 PM
To those who cannot get Rockbox to boot on D2+ players with new hardware, please try uploading this image to your player using tcctool:

http://www.mediafire.com/?rwuzjzj1ejy

You might find the backlight comes on now, so you might be able to read the screen. However, I wouldn't expect much else to work (the touchscreen certainly won't). Let me know how it goes...

@grep, I've now added an SVG drawing of the D2, so that part of the manual is already done for you! :D
Title: Re: Cowon D2
Post by: fish on September 20, 2009, 08:33:51 PM
I'v gave it short try and it works.
The screen turned on and I even can navigate with the keys - very nice :)
Title: Re: Cowon D2
Post by: grep on September 21, 2009, 03:58:29 AM
@grep, I've now added an SVG drawing of the D2, so that part of the manual is already done for you! :D

Thanks mate!  :D

I'm still in the process of "finding my bearings" of the processes surrounding the rockbox manual. I've installed Latex and svn and been doing some test building of manuals to see how that all works.

There's one thing that I don't understand atm:

The ManualHowTo tells me to create a new directory in Rockbox SVN root (where tools, apps, manual etc are located) and do the "configure" and "make" in there. This strikes me as odd. Doesn't that mean when I commit this to svn, the directory stays on that level? Or is that perhaps to prevent new manual targets to fuck it up for the existing entries under manual?




Title: Re: Cowon D2
Post by: shotofadds on September 21, 2009, 04:15:13 AM
The screen turned on and I even can navigate with the keys - very nice :)
Ok, I'll add that change into the main build soon, then you should be able to run a full build. We'll then need to work out what needs to be fixed...

The ManualHowTo tells me to create a new directory in Rockbox SVN root (where tools, apps, manual etc are located) and do the "configure" and "make" in there. This strikes me as odd. Doesn't that mean when I commit this to svn, the directory stays on that level? Or is that perhaps to prevent new manual targets to fuck it up for the existing entries under manual?
Only the outputs of the build will appear in the build directory you created - it's the same process as building code from SVN. All the source files (and your changes) will go in the main 'manual' folder. It's done like this so that you can have several build folders for building different manuals from the same source code.

The usual way to submit changes is to create a patch file (a set of differences from main SVN) and post it to Flyspray, our bug/patch tracker - see WorkingWithPatches on the wiki. A developer with SVN access will then look at it and commit if it's all is ok. If you get really proficient, you might eventually get commit rights yourself.
Title: Re: Cowon D2
Post by: D2+Beginner on September 21, 2009, 05:15:22 AM
Great!
For me the same as fish.
The screen turned on and navigation with keys work well.

Thanks!!!

Title: Re: Cowon D2
Post by: grep on September 21, 2009, 06:46:12 AM
The usual way to submit changes is to create a patch file (a set of differences from main SVN) and post it to Flyspray, our bug/patch tracker - see WorkingWithPatches on the wiki. A developer with SVN access will then look at it and commit if it's all is ok. If you get really proficient, you might eventually get commit rights yourself.
Ah yes, that sounds logical.
I was already wondering where the "quality assurance" would be if you would allow any noob like me to commit stuff to the svn  ;)
Ok, first thing on the list now is to figure out all the prerequisites to do a successfull "manual for the D2" build.
I tried to build smt quickly in a d2 directory in the SVN root, but it's riddled with errors of missing stuff ofcourse.
I must say, having no experience in contributing in an opensource project and finding the learning curve a bit steep, it's rather interesting to see how stuff is being organized.  :)
Title: Re: Cowon D2
Post by: helloworld1 on September 21, 2009, 02:57:15 PM
To those who cannot get Rockbox to boot on D2+ players with new hardware, please try uploading this image to your player using tcctool:

http://www.mediafire.com/?rwuzjzj1ejy

You might find the backlight comes on now, so you might be able to read the screen. However, I wouldn't expect much else to work (the touchscreen certainly won't). Let me know how it goes...

@grep, I've now added an SVG drawing of the D2, so that part of the manual is already done for you! :D

Hi, I have tried flashing the 3.11 original firmware with your attached firmware. The device cannot be turned on after that and I cannot get into the recover mode by pressing and holding the "M" button and turning on. It is really sad. My D2+ is a brick now.
Title: Re: Cowon D2
Post by: shotofadds on September 21, 2009, 05:16:35 PM
Hi, I have tried flashing the 3.11 original firmware with your attached firmware
You weren't supposed to do that, only upload it with tcctool. :o

Anyway, it's not possible to damage a D2/D2+ just by flashing a bad firmware, as it can always be recovered using the built-in USB boot mode.  Are you sure you've reset the device properly and it has a full charge?
Title: Re: Cowon D2
Post by: helloworld1 on September 22, 2009, 09:42:11 AM
Yes, It didn't boot with dual boot mktccboot.
Flashing it with tcctool is OK.

I have found why I cannot use tcctool before. The correct procedure is:
1. Hold "M" button, press reset and then turn on.
2. I should add sudo before tcctool, like:
$sudo ./tcctool -d cowond2 rockbox-newbacklight.bin

lsusb will get this device.
140e:b011 Telechips, Inc. TCC780X-based player (USB Boot mode)

The battery is completely drained. Rockbox cannot charge my battery, so I need to charge it in the original firmware before test it. The backlight is working!

EDIT:
I have tested it briefly. The backlight is working, many else is not including sound ,touch screen. Of course, it is a very good starting point to get the backlight working.
Title: Re: Cowon D2
Post by: grep on September 23, 2009, 08:31:07 AM
After some usefull chatting on IRC, I have decided that for the time being I'm going to concentrate on getting the D2 manual in a somewhat working state added to the svn, and focus first on the hardware buttons and add touchscreen functions later.

To this end I have been making inventory of the button functions and like to run it by you to see if I'm missing something:

In general: Power (long) = Shutdown

In Main Menu:
Minus = up
Plus = Down
Menu = Select

In WPS:
Minus = Volume Down
Plus = Volume Up
Menu = Main menu
Menu (long) = Context Menu

In Context Menu:
Minus = up
Plus = Down
Menu = Select
Power = Back

Ofcourse I need to look at all the plugins and their button assignments, but I want to get the manual going first.

Have I missed anything?
Title: Re: Cowon D2
Post by: Maike on September 23, 2009, 01:21:32 PM
Moin Grep,

in WPS (=While playing screen?) you missed the:

power-button (short): stop (and if selected in bookmarks: create or update bookmark)

Greetings Maike

Title: Re: Cowon D2
Post by: Bkd11 on September 23, 2009, 02:27:42 PM
The (Stop) button was changed to a long press of the top-right touchscreen back in 22594 so that you don't accidentally hit it going from hold.
Title: Re: Cowon D2
Post by: Maike on September 23, 2009, 02:35:12 PM
Sorry,
I will search for a newer version of Rockbox.

Greetings Maike
Title: Re: Cowon D2
Post by: shotofadds on September 24, 2009, 05:31:56 AM
@grep,

I think that's the right approach. Getting a manual of any description to build first is definitely a good step! We can add a touchscreen description later once we know exactly how it's going to work. Once you get something that builds, do post it on Flyspray so that others can contribute.

As far as the hardware keys go, it's unfortunately not as straightforward as it should be:

The POWER key should generally be seen as 'back' or 'cancel'. This should apply to all menus/settings/plugins. However there are a few exceptions currently....

In the main menu I'd like to use POWER to go back to the WPS (ie. effectivley 'cancel' the menu), but I'm not quite sure how to achieve that.

Plugins are a bit more complicated since there are effectively three types and each has been implemented differently:

- simple plugins that don't use a menu (eg. demos). POWER is always 'exit'.

- 'application' style plugins that are effectively an extension of the menu system (eg. disktidy) . POWER is 'back' as usual, and going 'back' from the plugin's main menu exits the plugin.

- 'game' style plugins (eg. blackjack, brickmania), where POWER does nothing at all in the menu! Certain others like the JPEG viewer suffer from this as well, which is a rather nasty and inconsistent UI. I think we should look at fixing these...

@helloworld1, thanks for the report. That's about what I expected, so there's plenty of work still to do! Also, did you try an SD card?
Title: Re: Cowon D2
Post by: helloworld1 on September 24, 2009, 10:04:40 AM
I used the rockbox on my 16G SD card. It is working fine and I can play music on the card(no sound). The file browser called the internal flash microsd1. and the root is the sd card.

The battery driver is a problem, the battery is empty in default and the rockbox will turn off after a while because of the empty battery.
Title: Re: Cowon D2
Post by: shotofadds on September 24, 2009, 10:27:14 AM
Ok, I will add a section to the wiki to say that battery monitoring, DAC power and the touchscreen all need to be updated for the new power management chip.

I'd guess the FM radio won't work either, can you check if it says "HW detected: yes" in System > Debug > FM Radio ?
Title: Re: Cowon D2
Post by: helloworld1 on September 25, 2009, 08:31:13 PM
The fm Hw detected is YES, everything else is 0.

The battery voltage is 3.925V at first, after a while it will jump to 0v.
Title: Re: Cowon D2
Post by: grantmasterflash on September 27, 2009, 03:33:41 PM
A few pages back (while using r22286) I posted about receiving 9 duplicate entries in the database for each music file on my 16gb SDHC card only.  It seemed to only start once I had filled the card with files until there wasn't much space left (~250mb free).  After trying to get to the bottom of what was causing the issue and failing, I eventually reformatted the SDHC card and the problem stopped occurring.  However, I did not fill the card close to capacity immediately after the reformat.  I've been slowly adding tracks from my collection over time.

This has started happening again.  I noticed it first yesterday after upgrading to r22843 and adding more files to the SDHC card so that only 136.8mb were free (14.8gb used).  Again, the dupes only appear for tracks that are on the SDHC card; tracks on the D2 internal memory are not duplicated.  This time, the tracks are duplicated 4-5 times (some tracks appear 4 times, some 5 times). 

I started deleting files gradually from the SDHC card to see if this would resolve the problem.  Each time, I also deleted the .tcd files from .rockbox and reinitialized the db.  After several iterations of this, I now have 1.8 GB of free space on the SDHC card, but still I'm experiencing the dupe db entries problem.

During the initialization of the db, I watch the "Building database" message.  Despite the fact that there are slightly less than 2000 tracks on both the int memory and SDHC, the # of files found in the "Building database" message will go all the way to around 10000 before stopping and informing me of the need to reboot.

The only bug I can find that is similar is FS#8414, although it doesn't appear that it was ever determined exactly what caused the problem.  People there reported resolving it by toggling Directory cache, load db to ram, and auto update, but I've tried these to no avail.  Of course, that bug was reported on an iPod and may not be a good reference point for this problem on a D2, due to the use of an SD card to run Rockbox and save settings.

I defragmented the SDHC card, but it did not resolve the dupe problem.

Anyone else experiencing this with Rockbox on the D2? 
Title: Re: Cowon D2
Post by: GodEater on September 28, 2009, 03:29:21 AM
This doesn't sound like a bug that is specific to the D2, more a general Rockbox one. There have been reports of duplicates being created in the database for a long time, but no-one has figured out what triggers it yet.

I can't personally think of anything specific to the D2 which would cause that at all - so you're likely posting this in the wrong place.

Do a search of the forums for other threads about duplicates in the database, and see if you can't contribute some more info there.
Title: Re: Cowon D2
Post by: grantmasterflash on September 28, 2009, 10:22:06 AM
This doesn't sound like a bug that is specific to the D2, more a general Rockbox one. There have been reports of duplicates being created in the database for a long time, but no-one has figured out what triggers it yet.

I can't personally think of anything specific to the D2 which would cause that at all - so you're likely posting this in the wrong place.

Do a search of the forums for other threads about duplicates in the database, and see if you can't contribute some more info there.

OK.  I thought it might be significant that the only files that are duplicated are ones that reside on the SD card and that files on the D2 internal memory are not duplicated.  Since the SD functionality is a bit unique on the D2 at the moment and my searches didn't turn up any hits where anyone described partial duplicates, I figured I would start here.

Update:

First I noticed that enabling Directory Cache was not being retained after reboots of Rockbox.  Every time I set it to yes, then rebooted, it would be set back to no.

Next I used rbdb.py (from http://www.rockbox.org/wiki/TagcacheDBFormat) to parse my database files, and found that database_4.tcd contained incorrect repeating filenames for every file on my SDHC card. 

For example:

/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/Birthday Party, The/Hits/12_Dead Joe.mp3

/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/Birthday Party, The/Hits/12_Dead Joe.mp3

/The Beatles in Mono/With The Beatles/The Beatles in Mono/With The Beatles/Birthday Party, The/Hits/12_Dead Joe.mp3

/The Beatles in Mono/With The Beatles/Birthday Party, The/Hits/12_Dead Joe.mp3

/Birthday Party, The/Hits/12_Dead Joe.mp3

That last one is the only one that is correct.  So every file on the SDHC card had one correct filename entry and then 4 incorrect entries under some repetition of /The Beatles in Mono/With The Beatles/.  I checked the /The Beatles in Mono/With The Beatles/ and found that it was empty, had a 0 byte filesize, and had a modified date that was several weeks after all the other directories within /The Beatles in Mono (I put all the albums from that boxset on the card at the same time, so they should all have the same modified date).

I removed /The Beatles in Mono/With The Beatles/ from the card, re-initialized the db in Rockbox, and, of course, no dupes.

I also noticed after this that the Directory Cache setting is being retained from boot to boot.

I can only conclude that some unknown corruption to that /The Beatles in Mono/With The Beatles/ directory occurred at some point after I put those files on the card, because I had previously listened to those files without a problem (and as I said earlier, the dupe problem only started occurring again a few days back - which was a few weeks after those files were already in place).  I'm not blaming Rockbox, but it's something I'll keep an eye on since this is the second time the dupe problem has occurred for me.  The next time it happens, I will be much more diligent about noting exactly what changes I made right beforehand, what OS I used to unmount/eject the card (Windows or Linux, I use both), etc.  I know without a doubt though that I made no changes whatsoever to that problematic directory when the dupes began to occur.

The main thing that can be concluded at this point is that using rbdb.py is a very good way to figure out what files/directories are causing duplicated entry problems.  It also seems that the Directory Cache setting may be a clue as to what's going on.
Title: Re: Cowon D2
Post by: shotofadds on October 08, 2009, 06:44:32 PM
I need a volunteer... somebody who has a D2+ that currently does not work with Rockbox (ie. one with the updated power management chip - PCF50635).

Could you unzip this (http://www.mediafire.com/?haistdguxwx) Rockbox build to the root of your D2 (or SD card), then upload this (http://www.mediafire.com/?azije15gmc9) image using tcctool?  Then tell me:

a) if Rockbox boots
b) if the backlight works
c) if you can adjust the brightness in the General > Display > LCD settings menu
d) if battery voltage monitoring works (in the System > Debug menu)
e) if sound works

@grantmasterflash, I didn't see your update until now - glad you got your problem sorted in the end (and for pointing out how these kind of issues can be diagnosed). I wonder what caused that corruption....?
Title: Re: Cowon D2
Post by: GMelchett on October 09, 2009, 02:45:25 PM
I'm not 100% sure that I got an D2+ with PCF50635. I bought the 16 GB variant a few days ago and it came with firmware 2.11 installed and my own built rockbox.bin (3.4.7) didn't work when loading it via tcctool.

However, all tests with provided binaries were executed successfully, except sound. It is very quiet.

@shotofadds, I'm willing to do futher testing. I though about trying to do the needed changes to rockbox to get PCF50635 supported myself. I write Linux drivers on the same ARM architecture as the D2 got for a living.


Another question, I've been looking at Toni's cowond2 emulator, just got it to compile under linux.
However, I'm confused regarding the input data. A few files are required, "d2.bin" which I assume is
the original firmware, then there are two other files "eeprom.bin", and "wrdata.bin" (or rather "test11.bin" that is currently in use.). I can't figure out how to get them. I know what an eeprom is, but
how do I get it out from the player? Also, Toni mention that a complete flash memory dump is
required. Where is that used in the emulator? wrdata.bin? How do you dump the complete flash,
I assume including the flash oob. (Simple "dd if=/dev/<player device>" does the job?)

Maybe the emulator can be useful for find out how flash wear-n-tear is handled.



 
Title: Re: Cowon D2
Post by: shotofadds on October 10, 2009, 11:18:41 AM
I'm not 100% sure that I got an D2+ with PCF50635. I bought the 16 GB variant a few days ago and it came with firmware 2.11 installed and my own built rockbox.bin (3.4.7) didn't work when loading it via tcctool.

However, all tests with provided binaries were executed successfully, except sound. It is very quiet.
That sounds very much like you have the hardware I'm talking about - thanks for testing it out. If that is the case, you will also find the touchscreen won't work because I haven't written the driver for it yet (although it's in progress). If the touchscreen works, you have the older hardware revision.

I'm a bit confused by the quiet sound - I'm not sure what would cause that. Can I ask you a really stupid question, just to check the obvious things like the volume settings and whether you have replaygain enabled? Also, does the FM radio work (is that quiet too)?

Quote
@shotofadds, I'm willing to do futher testing. I though about trying to do the needed changes to rockbox to get PCF50635 supported myself.

I've done a fair amount of work on it already to build the above test images, so I'll get those changes into SVN so you and/or others can test things out some more and try tweaking things yourself... help is always welcome!

Quote
I write Linux drivers on the same ARM architecture as the D2 got for a living.
Excellent, we need more people with low-level experience to get interested in this port! What sort of devices are you working with?

Quote
Another question, I've been looking at Toni's cowond2 emulator, just got it to compile under linux.
However, I'm confused regarding the input data. A few files are required, "d2.bin" which I assume is
the original firmware, then there are two other files "eeprom.bin", and "wrdata.bin" (or rather "test11.bin" that is currently in use.). I can't figure out how to get them. I know what an eeprom is, but
how do I get it out from the player?
I haven't had the chance to get the emulator working yet myself,

The EEPROM is mapped to an 8KB section of memory at 0xE0000000. You'll need to write some code to dump this from the player - either to SD card or via USB. Maybe ask Toni if he already has the code to do it?  Or you/I could write a plugin to do the job.

Similarly the raw NAND flash needs to be dumped either to SD card (if you have a large enough card!) or over USB. Again some custom code will be needed to do this (dd isn't enough as that won't get you the raw NAND blocks / oob).

I haven't looked at the code, but I assume wrdata.bin is a file that gets written to disk by the emulator  (containing NAND writes)?

What I might do is write a plugin that can dump all this stuff to SD card, and then get someone with a 2GB D2 to run it for us. That should make things a bit easier to handle...!

EDIT: The above changes for PCF50635 support are now in SVN. Lots more work to do though! :-\
Title: Re: Cowon D2
Post by: GMelchett on October 10, 2009, 04:03:33 PM
I'm not 100% sure that I got an D2+ with PCF50635. I bought the 16 GB variant a few days ago and it came with firmware 2.11 installed and my own built rockbox.bin (3.4.7) didn't work when loading it via tcctool.

However, all tests with provided binaries were executed successfully, except sound. It is very quiet.
That sounds very much like you have the hardware I'm talking about - thanks for testing it out. If that is the case, you will also find the touchscreen won't work because I haven't written the driver for it yet (although it's in progress). If the touchscreen works, you have the older hardware revision.
Yepp, the touchscreen doesn't work.

I'm a bit confused by the quiet sound - I'm not sure what would cause that. Can I ask you a really stupid question, just to check the obvious things like the volume settings and whether you have replaygain enabled? Also, does the FM radio work (is that quiet too)?
Well, booting your rockbox image was my first, no questions are stupid. And you are right,
some "replaygain" feature was enabled. When I switched it off, both audio and FM radio worked fine  :)

I've done a fair amount of work on it already to build the above test images, so I'll get those changes into SVN so you and/or others can test things out some more and try tweaking things yourself... help is always welcome!

Good! I was just about to ask you for patches.

I write Linux drivers on the same ARM architecture as the D2 got for a living.
Excellent, we need more people with low-level experience to get interested in this port! What sort of devices are you working with?
Custom made ASICs. Platforms for mobile phones.

Quote
I haven't had the chance to get the emulator working yet myself,

The EEPROM is mapped to an 8KB section of memory at 0xE0000000. You'll need to write some code to dump this from the player - either to SD card or via USB. Maybe ask Toni if he already has the code to do it?  Or you/I could write a plugin to do the job.
Sounds like an good task to begin with. I'll begin with it tomorrow.

Quote
Similarly the raw NAND flash needs to be dumped either to SD card (if you have a large enough card!) or over USB. Again some custom code will be needed to do this (dd isn't enough as that won't get you the raw NAND blocks / oob).
Just what I though. Hmm.. since I only have a 2 GB SD card, I need like 16 rounds with a plugin
that dumps out 1 GB+oobs each round. I think that several rounds will work since nobody is
modifying anything on the flash between external boots. (I would be suprised if the TCC chip
touches the flash when doing an external boot. If it does, it won't do wear-n-tear anyway.)
However, it would be much nicer to play around with a raw nand dump from a 2 GB D2.
Oh well, I start with the eeprom-dump plugin first.

Quote
I haven't looked at the code, but I assume wrdata.bin is a file that gets written to disk by the emulator  (containing NAND writes)?
sounds resonable.

Quote
What I might do is write a plugin that can dump all this stuff to SD card, and then get someone with a 2GB D2 to run it for us. That should make things a bit easier to handle...!
Yes, definitly.

Quote
EDIT: The above changes for PCF50635 support are now in SVN. Lots more work to do though! :-\
Excellent. I will have a look.
Title: Re: Cowon D2
Post by: shotofadds on October 10, 2009, 05:19:49 PM
I think you should be ok with multiple rounds, nothing is likely to modify the flash inbetween boots (and especially not if you use tcctool).

I did some earlier work like this using Rockbox's USB MSC interface (so I could dd whatever data I liked from the device by modifying the NAND driver appropriately). But that was rather a hacky approach, and the Rockbox USB stack is still too unreliable on Telechips devices.  :(

btw. I put some information on the wiki about how to read the touchscreen (gleaned from the Cowon firmware), if you feel like playing with that...
Title: Re: Cowon D2
Post by: GMelchett on October 11, 2009, 08:40:51 AM
The eeprom-dump plugin was a piece of cake thanks to the plugin interface.

I guess I understood you wrong, since how to access the touchscreen sounded quite un-i2c-ish to me.
So I just tried to do multiple byte read at register 0x80h and 0x90 from slave 0x90. It works just fine.
Got X and Y in the scale from 0 to 0xFFFF where 0xFFFF is the bottom resp. left end.

I've added some code to button_cowond2.c but not yet got it to work.

I do wonder what chip that sits on address 0x90. But at the moment I'm not curious enough to open up my d2 and have a peak.

Edit: Got the touchscreen to work nicely. It is currently just a hack. @shotofadds: I guess you want a patch. How do you wish to get it "delivered"?

Title: Re: Cowon D2
Post by: shotofadds on October 11, 2009, 10:55:29 AM
Hehe, yes that description does sound silly. But that's actually what the Cowon firmware does!  I will update the wiki to say that normal I2C reads work just fine (note, if you want to put any of your findings on the wiki yourself, you should go to the IRC channel and ask for access).

To submit patches, post them on Flyspray (http://www.rockbox.org/tracker/index.php?type=4), our bug/patch tracker.  For copyright purposes all code submissions must be accompanied by a real name.

Although, how do we name a driver for a device we haven't yet identified? To keep things simple maybe move all of the touchscreen code from button-cowond2.c out to a separate file eg. touchscreen-cowond2.c, which deals with both types?

You should post the eeprom dumper too, then maybe we can extend it to dump other useful things as well. There's no reason why it shouldn't go in SVN (maybe disabled in plugins/SOURCES by default).
Title: Re: Cowon D2
Post by: GMelchett on October 11, 2009, 01:44:18 PM

Weird. I wonder how any other device could work on the I2C bus if you can access "the touchscreen"-chip in that fashion.

I've added both the touchscreen patch and the eeprom dump on the tracker.

Adding a complete flash, including oob, dumping code would make the eeprom dumper more useful. Then someone might give us a nice 2 GB image.

Yes, we definitly need to break out the touchscreen code from button-cowond2. Looks quite hacky now with my code for the unknown-chip. For the moment, I think we should keep the code regarding
the unknown device in the touchscreen-cowond2 file. When we know what it is and/or we find some
other use of it, then we'll give it its own files.

By the way, does the name have to be unique? IE wonder about the cowond2 appendix.

I will have a look at if I can fix the clock. The date is correct but the clock says 00:00:00.
Title: Re: Cowon D2
Post by: shotofadds on October 11, 2009, 01:55:01 PM
Weird. I wonder how any other device could work on the I2C bus if you can access "the touchscreen"-chip in that fashion.
I may have described it wrongly - a slave address is always sent, so other devices should just ignore the data that follows. It seems the Cowon firmware does something very strange:

- send slave address (0x90) followed by register address (0x80/0x90)
- send slave address (0x90) followed by two byte reads

whereas it could just:

- send slave address (0x90), followed by register address (0x80/0x90), followed by two byte reads.

But anyway, it doesn't seem to matter. :)

Quote
I've added both the touchscreen patch and the eeprom dump on the tracker.

Adding a complete flash, including oob, dumping code would make the eeprom dumper more useful. Then someone might give us a nice 2 GB image.
Thanks, I saw those and started making some comments. I will do some work on the dumper plugin...

Quote
By the way, does the name have to be unique? IE wonder about the cowond2 appendix.
No, it's not really necessary, but it's convention for those .c's in the target/ tree to have such a suffix.

Quote
I will have a look at if I can fix the clock. The date is correct but the clock says 00:00:00.
It can't be correct unless the date is coming from a file timestamp or some thing - the RTC is currently trying to read from the PCF50606 (check SVN shortly for a fix) :P
Title: Re: Cowon D2
Post by: helloworld1 on October 12, 2009, 10:00:44 AM
I need a volunteer... somebody who has a D2+ that currently does not work with Rockbox (ie. one with the updated power management chip - PCF50635).

Could you unzip this (http://www.mediafire.com/?haistdguxwx) Rockbox build to the root of your D2 (or SD card), then upload this (http://www.mediafire.com/?azije15gmc9) image using tcctool?  Then tell me:

a) if Rockbox boots
b) if the backlight works
c) if you can adjust the brightness in the General > Display > LCD settings menu
d) if battery voltage monitoring works (in the System > Debug menu)
e) if sound works

@grantmasterflash, I didn't see your update until now - glad you got your problem sorted in the end (and for pointing out how these kind of issues can be diagnosed). I wonder what caused that corruption....?

a. rockbox boots.
b. backlight works.
c. backlgiht brightness works.
d. Battery voltage starts out as 3.925(not correct( but after a while itis 4.098 and is correct.
e. sound works.
f. FM radio works, but the touchscreen is notworking so I cannot select the channel.

GREAT WORK!
Title: Re: Cowon D2
Post by: GMelchett on October 12, 2009, 02:25:22 PM

Quote
It can't be correct unless the date is coming from a file timestamp or some thing - the RTC is currently trying to read from the PCF50606 (check SVN shortly for a fix) :P

@shotofadds: Your rtc patch definitely changed things. On the good side, the seconds are moving and there is a system time that moves at a approximately correct speed. However it says 09:37 when it should be 20:01. The system date says April 23 2005. The date was correct before your rtc patch.

Btw, I'm considering changing the touchscreen calibration code to calibrate two more spots, the (0,0) and (LCD_WIDTH, LCD_HEIGHT) for getting the correct hw values, not just my hardcoded ones.

Title: Re: Cowon D2
Post by: shotofadds on October 12, 2009, 02:27:04 PM
You should find these things work in the main build now, so hopefully there's no need for you to download test images or use tcctool any more! The clock "might" work too, but no promises.

f. FM radio works, but the touchscreen is notworking so I cannot select the channel.
If you can compile your own builds, there is a patch at FS#10671 (http://www.rockbox.org/tracker/task/10671) that implements the touchscreen driver. It still needs a bit of work, but shouldn't be too long before it's in the main build.

ps. it's normal for the battery voltage to start at a set value - it's an average reading and has to start somewhere that isn't zero!
Title: Re: Cowon D2
Post by: shotofadds on October 12, 2009, 02:52:28 PM
@shotofadds: Your rtc patch definitely changed things. On the good side, the seconds are moving and there is a system time that moves at a approximately correct speed. However it says 09:37 when it should be 20:01. The system date says April 23 2005. The date was correct before your rtc patch.
The correct date can't have been read by the old driver, it was probably failing and using the build date as a fallback. The current build reads the correct fields from the PCF chip, but they appear to contain invalid data. What happens if you try to set the time in Rockbox? Does it persist (and does it affect what the Cowon firmware displays)? Maybe the stock firmware is using the TCC7801 RTC instead...

Quote
Btw, I'm considering changing the touchscreen calibration code to calibrate two more spots, the (0,0) and (LCD_WIDTH, LCD_HEIGHT) for getting the correct hw values, not just my hardcoded ones.
In theory only the three spots are needed - does it work at all if you remove your hard-coded scaling?
Title: Re: Cowon D2
Post by: GMelchett on October 13, 2009, 08:50:05 AM
Ah, a build date. That fooled me.  Setting time in rockbox seems to work fine. It was there after a power-off-on cycle. When starting the original firmware, the date was in april 2014. The weird thing then was when I set the time+date back to the correct date+time with the original firmware, both rockbox and the firmware started to report the same date+time, the correct one.

I've updated my touchscreen patch in the tracker. I didn't update the touchscreen calibration code to calculate the hw parameters as well. Maybe it isn't needed.


Edit: After playing around with the unknown touchscreen chip, my guess is that it is an: TI TSC2003.
(http://focus.ti.com/docs/prod/folders/print/tsc2003.html)
Title: Re: Cowon D2
Post by: shotofadds on October 13, 2009, 02:57:50 PM
Ah, a build date. That fooled me.  Setting time in rockbox seems to work fine. It was there after a power-off-on cycle. When starting the original firmware, the date was in april 2014. The weird thing then was when I set the time+date back to the correct date+time with the original firmware, both rockbox and the firmware started to report the same date+time, the correct one.
It's very strange, but that's what the PCF50606 version does too. I don't understand it, especially since the Cowon firmware seems to access the RTC registers in exactly the same way we do. Needs some further investigation. >:(

Quote
Edit: After playing around with the unknown touchscreen chip, my guess is that it is an: TI TSC2003.
(http://focus.ti.com/docs/prod/folders/print/tsc2003.html)

Well spotted. I've had a look at some similar TI devices and no others seem to match except the more recent TSC2007 (which includes a built in median/windowed average filter) - this might be more likely since you reported very little jitter in the results.

http://focus.ti.com/lit/ds/symlink/tsc2007.pdf
Title: Re: Cowon D2
Post by: GMelchett on October 15, 2009, 02:54:44 PM

Yes, indeed strange regarding the date+time.

I though I should try to figure out if any IRQ is connected to the touchscreen device.
Which IRQs are known? Any IRQs that are shared? Which are currently in use by drivers?
I've looked that the list in system-tcc780x.c, some I can guess what they are used for
some are not as clear.
@shotofadds: If you have a time, an IRQ list on the wiki would be welcome! Thanks!
Title: Re: Cowon D2
Post by: shotofadds on October 15, 2009, 04:44:07 PM
Have a look at the TCC7801 datasheet (there was a link floating around here a while ago, if you can't find it I'll send you one if it still works). That'll tell you if an IRQ can be fired from C26. If not don't worry about it as the current implementation is fine.

As for current IRQ usage, I think we only care about TIMER0 (tick), DAI_TX (I2S) and EXT3 (PCF50606) at the moment, although that list is off the top of my head, so I could be wrong. Most are only listed for completeness, with a default "unhandled" handler.

I think we should be responding to the PCF50635 interrupts (it should be on EXT3 like the PCF50606), especially since it will give us an easy way to detect USB/charger insertion.

We're currently using C26 for that (since it worked on older hardware...) but clearly that isn't going to work if the GPIO is now used for the touchscreen.  Could you go into the Debug > HW info screen and see if any GPIOs change when you insert the AC adapter or USB cable?
Title: Re: Cowon D2
Post by: GMelchett on October 16, 2009, 02:09:49 PM

There is a small flaw in last nights touchscreen patch. Since the "last_btn = btn" ended up inside if(tsc200x_is_pressed()) {} the latest button will be repeated on and on until you press somewhere else and that new button gets repeated on and on. IE the line must be outside the if.

I would really appreciate if you could mail me the tcc7801 datasheet. The link on the forum is dead, or rather Telechips now require a password for the files, and the datasheet is nowhere else to be found.

Thanks for the IRQ information. So there is no IRQ for key press/release. Also, finding out which IRQ that is connected to TSC2007 should be of interested. Although pulling works fine.

I tried many times to see if any GPIO pin changed in the "Hardware info" screen, but none did
when I inserted/removed the USB cable.




Title: Re: Cowon D2
Post by: shotofadds on October 17, 2009, 08:28:32 AM
There is a small flaw in last nights touchscreen patch. Since the "last_btn = btn" ended up inside if(tsc200x_is_pressed()) {} the latest button will be repeated on and on until you press somewhere else and that new button gets repeated on and on. IE the line must be outside the if.

You mean I put it in the wrong place - all fixed now though! ;)

Quote
I would really appreciate if you could mail me the tcc7801 datasheet. The link on the forum is dead, or rather Telechips now require a password for the files, and the datasheet is nowhere else to be found.

This is the current working link (http://www.telechips.com/webupload/data_board/122/TCC780_DataSheet_r0.09.pdf).

Quote
I tried many times to see if any GPIO pin changed in the "Hardware info" screen, but none did when I inserted/removed the USB cable.

Ok, we'll need to monitor the PCF50635 interrupts (this should work in pretty much the same way as the existing code). Also does D23 change when you insert the AC adapter?
Title: Re: Cowon D2
Post by: GMelchett on October 17, 2009, 11:47:23 AM


Quote
This is the current working link (http://www.telechips.com/webupload/data_board/122/TCC780_DataSheet_r0.09.pdf).
Hmm.. It looks like the datasheet for TCC780, not TCC7801. Sure that you got it right?

Quote
Ok, we'll need to monitor the PCF50635 interrupts (this should work in pretty much the same way as the existing code). Also does D23 change when you insert the AC adapter?
No idea. An AC adapter wasn't included when I bought my D2+, so I can't test it.
Title: Re: Cowon D2
Post by: shotofadds on October 17, 2009, 12:42:18 PM
Hmm.. It looks like the datasheet for TCC780, not TCC7801. Sure that you got it right?
Yes, it's definitely the correct one. The '01' is the only variant of 780x that made it into mass production, as far as I can tell.

Quote
No idea. An AC adapter wasn't included when I bought my D2+, so I can't test it.
Ok, I'll assume it's the same for now - I can always check the OF disassembly to be sure...
Title: Re: Cowon D2
Post by: GMelchett on October 20, 2009, 01:38:21 PM

Eventhough power management  isn't top priority at the moment, I feel for starting with it.
I'll start with trying to replace the TIMER0 interrupt that does current_tick++ 100 times a second
with the 32 bit timer/counter hw.

Can anyone explain why adc_tick() looks like it does? It looks strange.

 



Title: Re: Cowon D2
Post by: shotofadds on October 20, 2009, 03:08:42 PM
I'll start with trying to replace the TIMER0 interrupt that does current_tick++ 100 times a second
with the 32 bit timer/counter hw.
I don't really see what you'd achieve by changing it. And it could be tricky since the 32bit counter is already being used for the high resolution timer USEC_TIMER - see system-target.h and clock_init().

Quote
Can anyone explain why adc_tick() looks like it does? It looks strange.
Ah OK, I forgot an IRQ in my list - the ADC conversions are clearly IRQ based. ;)

It's quite straightforward: adc_tick() is called once each tick, and it just requests that the CPU starts the ADC conversion process. When that is finished, the ADC interrupt fires and the results are read. Calls to adc_read() just return the cached values.

If by "strange" you mean the #ifdef BOOTLOADER stuff, it's because at one time IRQs did not work in the bootloader - that's not a problem now, so I should remove those lines.
Title: Re: Cowon D2
Post by: GMelchett on October 24, 2009, 03:01:54 AM

You don't achieve much by just replacing the TIMER0 interrupt. But in order to reach good playback hours, you have to aim to reduce the number of wake-ups during idle to just a handful per second.
 
Title: FS#10728 - Cowon D2: Add support for D2 in rbutil
Post by: tomers on October 27, 2009, 07:15:30 AM
Just to let you know, I am working on implementing rbutil support in http://www.rockbox.org/tracker/task/10728

It will hopefully committed in the near future.
Title: Re: Cowon D2
Post by: Gunbuster on October 29, 2009, 09:11:05 AM
Is there any way to rotate the screen (the left of the screen being the top, and the right the bottom) ?
I want to display big covers in 240x240 pixels like i did with my gigabeat F, which is not possible with de default display.
Thank you.
Title: Re: Cowon D2
Post by: tomers on December 03, 2009, 12:26:34 AM
Quote
Is there any way to rotate the screen (the left of the screen being the top, and the right the bottom) ?
I want to display big covers in 240x240 pixels like i did with my gigabeat F, which is not possible with de default display.

Take a look at the themes site: http://themes.rockbox.org/index.php?target=cowond2. Especially, notice the SpartanBlack theme:

(http://themes.rockbox.org/themes/320x240/spartanblack/wps-SpartanBlack_wps.png)


(http://themes.rockbox.org/themes/320x240/spartanblack/menu-SpartanBlack_extras.png)
Title: Re: Cowon D2
Post by: fish on December 09, 2009, 04:48:22 AM
I just want to say thank your for making it work on the newer D2+ Devices.
Finally a usable firmware - the original firmware really suck I think.. I never had a piece of hardware with such a bad usability. But with Rockbox it just rocks :D
Title: Re: Cowon D2
Post by: tomers on December 09, 2009, 07:34:23 AM
Finally a usable firmware - the original firmware really suck I think.. I never had a piece of hardware with such a bad usability. But with Rockbox it just rocks :D

Hi Fish,

I found that Cowon D2 has some usability issues related to keymaps.
If you would like to volunteer and contribute to Rockbox (no need for programming knowledge), I could use your contribution with compiling a list of desirable key-mappings for various screens and plugins on Rockbox, which would make it more usable. I'll try to fix whatever you find :-)
Title: Re: Cowon D2
Post by: shotofadds on December 11, 2009, 07:52:25 AM
Tomers - regarding your recent keymap changes, I really don't agree with some of them.

In the FM Radio screen the +/- keys could previously be used to adjust volume (their natural usage, consistent with the WPS and also how they're used in the OF). Why did you change this to prev/next?

Also in the FM screen, the MENU key would previously open the menu (again the natural, expected function). Now it needs a long-press - why did you do this?

You also removed the second ACTION_TREE_WPS line that I only recently added. What was the reason for this?

Please can you revert these changes.
Title: Re: Cowon D2
Post by: lynix on December 11, 2009, 03:11:42 PM
Hi, there!

I want to thank you guys for working on D2 support :)

I just managed to build the dev tools and install Rockbox on an SD in my D2. Unfortunately I can't hear any sound when playing MP3s while FM radio is working fine... will check this later.

I also have an AC adapter so if I can help by providing some information, just tell me :)
I also speak C and a bit MIPS, if that helps ^^

Thanks again for a firmware that rocks! ;)


lynix

EDIT: removed typo ^^
Title: Re: Cowon D2
Post by: tomers on December 12, 2009, 12:43:25 AM
Tomers - regarding your recent keymap changes, I really don't agree with some of them.

In the FM Radio screen the +/- keys could previously be used to adjust volume (their natural usage, consistent with the WPS and also how they're used in the OF). Why did you change this to prev/next?

Also in the FM screen, the MENU key would previously open the menu (again the natural, expected function). Now it needs a long-press - why did you do this?

You also removed the second ACTION_TREE_WPS line that I only recently added. What was the reason for this?

Please can you revert these changes.

Hi shotofadds, I am sorry to cause a regression with the keymaps. I agree with your comments and reverted the changes you've referred to in r23936. I did not mean to change anything that worked as expected previously, rather to add functionality in areas where things didn't work at all :-) I am sorry if I caused any inconvenience to you or to other D2 users. I am now working on making the D2 more usable, and for every two steps forward, one step might be taken backwards. I'll be more careful now.
Thank you for your feedback!

Tomer
Title: Re: Cowon D2
Post by: robbie on December 14, 2009, 09:14:15 PM
current build is broken now (get an error when opening the file with winrar).
Title: Re: Cowon D2
Post by: saratoga on December 14, 2009, 09:18:14 PM
current build is broken now (get an error when opening the file with winrar).

Works fine for me.  Probably just a problem on your end (or its been resolved since whichever unnamed version you tested).
Title: Re: Cowon D2
Post by: tomers on December 15, 2009, 12:38:44 AM
current build is broken now (get an error when opening the file with winrar).
Do you mean it fully compiles, but the archive created (make zip?) is invalid?
Title: Re: Cowon D2
Post by: tomers on December 15, 2009, 12:45:28 AM
The Cowon D2 manual is released!  ;D

There are some sections which still need some work. Some keymap for plugins, and a description of the player for blind users, etc.
I will fix the keymap issues, but please, could somebody write a short description of the player's structure (buttons, etc.) for a blind person. I know this target is not suitable for blind and visually impaired persons, but still, manuals usually include this section.

In the wiki, there's the following section:

Quote
Most Rockbox functions are usable on the D2/D2+, including music playback and most plugins, but there are a number of shortcomings that prevent it from being a fully supported target:

    * An SD card is required to use many features, since the internal flash memory is read-only in Rockbox.
    * There is only basic touchscreen support.

I would like to know why the touchscreen support is considered basic, and where exactly are the areas which lack proper touchscreen support, so I can fix it.

Regarding the read-only internal flash - does anyone works on it?
Title: Re: Cowon D2
Post by: shotofadds on December 15, 2009, 04:27:40 PM
Thanks for your work on the manual so far!

I would like to know why the touchscreen support is considered basic, and where exactly are the areas which lack proper touchscreen support, so I can fix it.
"basic touchscreen support" == the far-from-ideal 3x3 grid mode. Originally this was only intended to be a stop-gap measure until Rockbox could support touchscreens in a more natural stylus/finger point mode. There is a wiki page about what needs to be done: TouchscreenInterface (http://www.rockbox.org/wiki/WebHome?topic=TouchscreenInterface).

The user can switch between "3x3 Grid" mode (the default) and "Absolute Point" mode. I strongly disagree with 3x3 Grid mode deing the default (it's not an intuitive way to use a touch screen at all) but many, many things need to be fixed before Absolute Point can be made the default:

- some screens (and most plugins) automatically switch to 3x3 Grid Mode without alerting the user
- some screens cannot be used at all in Absolute Point mode
- the default WPS doesn't have any touch areas
- the default theme font is too small to be used comfortably in the menus

There is some work going on towards adapting the various screens to Absolute Point mode (eg. FS#10639, FS#10806) but this is complicated by having to support both 3x3 Grid and Absolute Point modes. I'd rather get rid of grid mode completely, but some devs/users want to keep the choice of both. :-\

I also started a patch (FS#10804) which adds a "touchscreen mode" icon to the status bar, which is really handy for when screens switch mode without alerting the user in any other way.

I tried to get some discussion going on these issues on the dev mailing list a while back, but it seems very few devs are interested in working on this area. So my enthusiasm is somewhat lacking these days.

ps. further discussion of touchscreen work should go in the User Interface and Voice forum as it's not D2 specific.

Quote
Regarding the read-only internal flash - does anyone works on it?

No, no-one's working on it now. I've spent months looking into this, and in my opinion providing write support (compatible with the Cowon firmware) would require a collossal amount of further effort, and we would almost certainly fall foul of some FTL-related patents.

The current situation of booting from an SD card works perfectly well for me, and from the lack of complaints, it seems the majority of users don't mind either. The only difficulty I am aware of is that RbUtil doesn't know about the need to unzip .rockbox to the SD card.
Title: Re: Cowon D2
Post by: tomers on December 15, 2009, 04:56:13 PM
Thanks for the info. I agree with you regarding the touchscreen being immature. I hope that making D2 a stable platform will drive further development in the touchscreen area.

BTW it should be a lot easier now to create a manual to all other touchscreen platforms, too.

Quote
Regarding the read-only internal flash - does anyone works on it?

No, no-one's working on it now. I've spent months looking into this, and in my opinion providing write support (compatible with the Cowon firmware) would require a collossal amount of further effort, and we would almost certainly fall foul of some FTL-related patents.

The current situation of booting from an SD card works perfectly well for me, and from the lack of complaints, it seems the majority of users don't mind either. The only difficulty I am aware of is that RbUtil doesn't know about the need to unzip .rockbox to the SD card.

Then if we make RbUtil automatically detect and choose the SD card as the installation point (if no card inserted it would prompt the user), then can we declare the D2 as a stable target? The touchscreen is ugly and unintuitive to work with at the moment, but it does work and provide full functionality. I really like to see this platform getting stabilized :-)
Title: Re: Cowon D2
Post by: Bkd11 on December 16, 2009, 03:16:06 PM
I noticed since STOP was added to the power button on the main menu there seems to be a bug where STOP is initiated also when you exit the settings and the plugins menus.

Edit: Nevermind, I see it was already changed to BUTTON_MINUS|BUTTON_POWER. Much better! ;)

Edit: @Tomers: Perhaps you can do the same for ACTION_WPS_BROWSE because you sometimes hit it by accident when turning off hold feature.

BTW, glad to see another dev working on the D2.
Title: Re: Cowon D2
Post by: tomers on December 17, 2009, 01:06:06 PM
Edit: @Tomers: Perhaps you can do the same for ACTION_WPS_BROWSE because you sometimes hit it by accident when turning off hold feature.
Done! See r24052.

I also sometimes hit the Menu button by accident when controlling the volume using the buttons, and it gets to the menu. When the DAP is in your packet, it is very annoying to open it and return to WPS. Do you think we should disable this button while in WPS?

BTW, glad to see another dev working on the D2.
Thanks!  :)
Title: Re: Cowon D2
Post by: shotofadds on December 17, 2009, 01:20:36 PM
I also sometimes hit the Menu button by accident when controlling the volume using the buttons, and it gets to the menu. When the DAP is in your packet, it is very annoying to open it and return to WPS. Do you think we should disable this button while in WPS?
If you meant the MENU button then NO!
Title: Re: Cowon D2
Post by: tomers on December 17, 2009, 01:37:48 PM
I also sometimes hit the Menu button by accident when controlling the volume using the buttons, and it gets to the menu. When the DAP is in your packet, it is very annoying to open it and return to WPS. Do you think we should disable this button while in WPS?
If you meant the MENU button then NO!
I did meant it  :-\
Fair enough...
Title: Re: Cowon D2
Post by: 3amsleep on December 19, 2009, 09:13:38 PM
there are ways to introduce a hold-mode buttons,i configures mine to skip tracks and play plause with the top buttons while hold is on and the player is on the WPS and in hold.
Title: Re: Cowon D2
Post by: shotofadds on December 20, 2009, 08:34:50 AM
there are ways to introduce a hold-mode buttons,i configures mine to skip tracks and play plause with the top buttons while hold is on and the player is on the WPS and in hold.
Yes, there's already a patch to do this on Flyspray (FS#10698). There was some discussion about whether it can be included in the main build or not - I think in the end we came to the conclusion that nobody was going to die if it got committed. So I'll look to get it in soon - in the New Year most likely.
Title: Re: Cowon D2
Post by: foth on January 07, 2010, 08:16:16 AM
Hello. First of all, thank you, shotofadds, for your work. I use Rockbox most of the time.
I want to sort out issues I experience, maybe someone could fix them (Or at least add  them to "Cowon D2 Info" page).

SOUND ISSUES
1. On track start, stop, in the end and in the start of most of quiet tracks I hear clicks (they are often in groups - 3 clicks in group).
2. Sometimes I get no sound output. Turn off & turn on helps to solve this problem.

READ/WRITE ISSUES
3. Can't load Rockbox from my SDHC 32 GB A-Data Turbo Class 6.
Get “ATA mount File not found”. Cowon FW loads well.
4. Rockbox can't open some files with long filenames, but standard firmware can. I.e. file with this name “J:\MUSIC\02 Rus1 (MFM02) [BS2B]\07 Патриаршие пруды (сборник авторской песни) (Приложение к журналу 'Stereo _ Video') (2001)\06 Зеленая карета (ст. О. Дриз, пер. Г. Сапгир, муз. А. Суханов).ogg” (from internal memory) (187 chars + 3 chars for extension).

OTHER ISSUES
5. The screen does not turns off when in hold mode. Only backlight turns off.
6. I have a lot of large covers. And it takes time for Cowon to resize cover to fit wps.
6.1. Playback does not starts till the cover is loaded. It should at first start playback and then load cover (as in standard firmware).
6.2. Rockbox reloads cover every time I change track. It should check, if there is need to reload cover.
7. Can't view large pictures when playing music (“not enough plugin memory”). Standard FW can.
8. JPEG viewer shows some pictures not in full screen. I think, it shows embedded thumbnail.
9. In "FM Radio" mode most of Sound Settings doesn't work. Is it possible to remove items that doesn't work.
10. Short battery life (~2x shorter than with standard FW).
Title: Re: Cowon D2
Post by: tomers on January 07, 2010, 09:46:23 AM
1. On track start, stop, in the end and in the start of most of quiet tracks I hear clicks (they are often in groups - 3 clicks in group).

The player and also some other players (e200) are 'hearing' flash memory activity. This doesn't happen on the OF, and it is a known bug. Please browse files and folders on your internal and/or external storage and let me know if this is the click sounds you have been hearing.

4. Rockbox can't open some files with long filenames, but standard firmware can. I.e. file with this name “J:\MUSIC\02 Rus1 (MFM02) [BS2B]\07 Патриаршие пруды (сборник авторской песни) (Приложение к журналу 'Stereo _ Video') (2001)\06 Зеленая карета (ст. О. Дриз, пер. Г. Сапгир, муз. А. Суханов).ogg” (from internal memory) (187 chars + 3 chars for extension).

I've confirmed this bug, and opened FS#10899 (http://www.rockbox.org/tracker/task/10899) for it.

foth, can you please open a separate bug items in Flyspray (http://www.rockbox.org/tracker/index.php?type=2), as I did for item #4? It will be easier for everyone to manage your findings and fix them this way. But keep in mind to research a bit before posting to avoid filling duplicate bugs.
Title: Re: Cowon D2
Post by: foth on January 07, 2010, 01:18:30 PM
Thank you tomers for quick reply!

I think I can't speak English good enough to post items in bugs forum. But I'll try.


1. On track start, stop, in the end and in the start of most of quiet tracks I hear clicks (they are often in groups - 3 clicks in group).

The player and also some other players (e200) are 'hearing' flash memory activity. This doesn't happen on the OF, and it is a known bug. Please browse files and folders on your internal and/or external storage and let me know if this is the click sounds you have been hearing.

I hear clicks on internal and on external memory. I didn't find info about "'hearing' flash memory activity" on bugs forum.

This is what shotofadds said of this issue:

Yes, I hear these clicks too (usually 3 in a row when starting or stopping a track). I'm not sure what is causing them, all I know is that when i first implemented playback on the D2 there were no clicks at all, except at power on/off. Something's obviously broken.
Title: Re: Cowon D2
Post by: tomers on January 08, 2010, 01:10:09 AM
4. Rockbox can't open some files with long filenames, but standard firmware can. I.e. file with this name “J:\MUSIC\02 Rus1 (MFM02) [BS2B]\07 Патриаршие пруды (сборник авторской песни) (Приложение к журналу 'Stereo _ Video') (2001)\06 Зеленая карета (ст. О. Дриз, пер. Г. Сапгир, муз. А. Суханов).ogg” (from internal memory) (187 chars + 3 chars for extension).

I've confirmed this bug, and opened FS#10899 (http://www.rockbox.org/tracker/task/10899) for it.

I've closed FS#10899 (http://www.rockbox.org/tracker/task/10899) as invalid, following comment by Dominik Riebeling (bluebrother):
Quote
Pasting the filename into a text document and saving it in utf-8 encoding yields 288 bytes. MAX_PATH is 260 bytes, so it's not surprising that this path doesn't work.

You can recompile Rockbox yourself with a higher value of MAX_PATH I don't know what are the side-effect of such change, probably it will work, but your player will have smaller audio buffer, which results in somewhat shorter battery life.

If you think this value is too small for most users (I seriously doubt it), you can talk to developers in IRC (http://www.rockbox.org/irc/).
Title: Re: Cowon D2
Post by: tomers on January 08, 2010, 01:18:08 AM
I hear clicks on internal and on external memory. I didn't find info about "'hearing' flash memory activity" on bugs forum.

This is what shotofadds said of this issue:

Yes, I hear these clicks too (usually 3 in a row when starting or stopping a track). I'm not sure what is causing them, all I know is that when i first implemented playback on the D2 there were no clicks at all, except at power on/off. Something's obviously broken.

I'm almost sure I've heard about it somewhere. I don't remember when or where. I think similar bug affects the Sansa e200. I believe the HW is not configured properly. Since I hear this noises immediately after power up, I assume some HW initialization is missing or is done incorrectly.

You can hear these noises really good when deleting a large directory. Try duplicating the .rockbox directory, then start Rockbox and delete the copy. It will take a while to delete the entire directory, and you will hear every bit that gets deleted  :D

shotofadds: Is it possible that audio is not muted (HW-wise) while the DAP is not playing any audio. This suggestion is just a shot in the dark, as I have absolutely no knowledge about it.

Talking about it, I couldn't find any specsheet for the DAP's SoC in the Wiki page. Did you use some documentation for implementation of the D2, or did you only reversed engineered the OF?
Title: Re: Cowon D2
Post by: foth on January 08, 2010, 03:26:13 AM
Quote
Talking about it, I couldn't find any specsheet for the DAP's SoC in the Wiki page. Did you use some documentation for implementation of the D2, or did you only reversed engineered the OF?
This is for shotofadds  :) , i think. I'd like to help in D2 Rockbox progress, but I'm not a programmer at all...

I think for Russian (and Ukraine, Belarus, Kazakh,..., German) language, and maybe for classic music MAX_PATH value is TOO small. I'm not the only one who experienced this problem in Rockbox. The standard firmware supports this path names and has pretty good battery life. Mabe we can increase MAX_PATH at least to 320 FOR D2?


I'd like to share my fmr file for Tomsk Russia, but get "Access Denied".
Tis is the file:
Code: [Select]
99750000:ТВ-2
101700000:Хит FM
102100000:Русское Радио
102550000:Ретро FM
103400000:Европа Плюс
103800000:Динамит FM
104600000:Радио Сибирь
105000000:Эхо Москвы
105400000:Авторадио
106100000:Наше Радио
106600000:Радио Маяк
107100000:Love - Радио
Title: Re: Cowon D2
Post by: tomers on January 08, 2010, 08:54:38 AM
I think for Russian (and Ukraine, Belarus, Kazakh,..., German) language, and maybe for classic music MAX_PATH value is TOO small. I'm not the only one who experienced this problem in Rockbox. The standard firmware supports this path names and has pretty good battery life. Mabe we can increase MAX_PATH at least to 320 FOR D2?

Please bring this subject on IRC, or in the Rockbox general discussion forum, so that other developers can participate in the discussion. I have no opinion for that matter.

I'd like to share my fmr file for Tomsk Russia, but get "Access Denied".

Posting your file here will not help. Please ask in IRC how to post it.
Title: Re: Cowon D2
Post by: GodEater on January 08, 2010, 09:27:45 AM
I think for Russian (and Ukraine, Belarus, Kazakh,..., German) language, and maybe for classic music MAX_PATH value is TOO small. I'm not the only one who experienced this problem in Rockbox. The standard firmware supports this path names and has pretty good battery life. Mabe we can increase MAX_PATH at least to 320 FOR D2?

Firstly, why does the language you're using make any difference to the length of MAX_PATH you need?

Secondly, a change such as this wouldn't affect only the D2, but every Rockbox target.
Title: Re: Cowon D2
Post by: foth on January 08, 2010, 10:17:44 AM
I think for Russian (and Ukraine, Belarus, Kazakh,..., German) language, and maybe for classic music MAX_PATH value is TOO small. I'm not the only one who experienced this problem in Rockbox. The standard firmware supports this path names and has pretty good battery life. Mabe we can increase MAX_PATH at least to 320 FOR D2?

Firstly, why does the language you're using make any difference to the length of MAX_PATH you need?

Secondly, a change such as this wouldn't affect only the D2, but every Rockbox target.

Russian (German,Ukraine,...) words are longer then English.
Title: Re: Cowon D2
Post by: mbk1969 on January 09, 2010, 09:03:08 AM
Firstly, why does the language you're using make any difference to the length of MAX_PATH you need?

It could take up to three bytes to encode (to code) one `national` (i.e. not latin) symbol in UTF. If firmware works with file paths in UTF then programmer must be aware of such possible buffer overrun problem. (In UNICODE the size of every symbol is two bytes.)

If file system tolerates using of such long names then problem lays within firmware source code.

update: I asked my colleague (specialist in file systems) and he stated that in FAT long file names are stored in UNICODE
Title: Re: Cowon D2
Post by: Ton on January 20, 2010, 08:30:21 AM
I don't know if this is the right place to mention it. If not, please tell me.
Also, I posted about this too in the iAudiophile forums.

Imo there is a fault in the D2 manual, regarding firmware numbers, which could cause confusion. On page 15 it says that for D2+ and 1.xx or 3.xx, you need D2_P.bin and for 2.xx and 4.xx D2N_P.bin. As far as I can see it should be the other way around.
Title: Re: Cowon D2
Post by: shotofadds on January 20, 2010, 04:00:00 PM
I answered this on your other post:

The 2.xx and 3.xx firmwares are non-DAB/DMB, and the filename indicates this with the 'N' suffix.

So, yes, it looks like the instructions are wrong and they should be fixed.
Title: Re: Cowon D2
Post by: 4nykey on January 22, 2010, 05:54:12 AM
The 2.xx and 3.xx firmwares are non-DAB/DMB, and the filename indicates this with the 'N' suffix.

So, yes, it looks like the instructions are wrong and they should be fixed.
This was taken from the wiki: http://www.rockbox.org/wiki/CowonD2Info#Installation, so it'll also need an update.
Title: Re: Cowon D2
Post by: markV on January 28, 2010, 10:42:34 AM
Yes, there's already a patch to do this on Flyspray (FS#10698). There was some discussion about whether it can be included in the main build or not - I think in the end we came to the conclusion that nobody was going to die if it got committed. So I'll look to get it in soon - in the New Year most likely.

Is your patch FS#10698 (hold-mode buttons) included in the main build / svn tree now?
Title: Re: Cowon D2
Post by: shotofadds on January 28, 2010, 01:43:57 PM
No not yet. I'll try and do it soon, but I haven't really had much time for Rockbox work recently.
Title: Re: Cowon D2
Post by: tomers on February 07, 2010, 04:11:21 AM
Color depth of Cowon D2's LCD screen

According to JetAudio's web site (http://www.jetaudio.com/products/cowon/d2/), the LCD screen is 24-bit (16 million colors), but the D2's configuration file (http://svn.rockbox.org/viewvc.cgi/trunk/firmware/export/config/cowond2.h?view=markup) contains the following line:

Quote
#define LCD_DEPTH  16

I wonder why this value is not set to 24. There is no other player whose LCD_DEPTH is >16, therefore it could be that Rockbox does not support higher values.

I would be glad if someone can clarify this.
Title: Re: Cowon D2
Post by: shotofadds on February 07, 2010, 10:52:58 AM
....it could be that Rockbox does not support higher values.
You said it. There's no 24-bit (RGB 888) LCD driver in Rockbox, and there wouldn't be a huge advantage writing one just for the D2, since according the LCD datasheet it is actually only 18-bit. Cowon's UI also uses 16-bit, btw (although it's possible it achieves a higher depth using native YUV mode for video playback...)
Title: Re: Cowon D2
Post by: Josef K. on February 21, 2010, 12:41:41 PM
I'm planing to buy D2+ (I'm afraid it'll be unavailable soon).

Quote from: Wiki CowonD2Info page
Newer D2+ hardware revisions use an updated power management chip, and some
functionality is not yet implemented on these players (eg. touchscreen support).

So my question is: is there a touchscreen support (3x3 Grid mode) in Rockbox for newer D2+ version? And, if it's not, is it still possible to use Rockbox just with DAPs buttons?

Thanks a lot for an answer!
Title: Re: Cowon D2
Post by: markV on March 04, 2010, 11:03:32 PM

Quote
Regarding the read-only internal flash - does anyone works on it?

No, no-one's working on it now. I've spent months looking into this, and in my opinion providing write support (compatible with the Cowon firmware) would require a collossal amount of further effort, and we would almost certainly fall foul of some FTL-related patents.

The current situation of booting from an SD card works perfectly well for me, and from the lack of complaints, it seems the majority of users don't mind either. The only difficulty I am aware of is that RbUtil doesn't know about the need to unzip .rockbox to the SD card.

Then if we make RbUtil automatically detect and choose the SD card as the installation point (if no card inserted it would prompt the user), then can we declare the D2 as a stable target? The touchscreen is ugly and unintuitive to work with at the moment, but it does work and provide full functionality. I really like to see this platform getting stabilized :-)

Hi developers !

I am using Rockbox on my D2 since the time it's able to write on the SD card (even before that). 

I used to install from svn and everything was fine.  Then last time I update from RButil to see what was going on there... 

Wow !  I installed themes and all...  I must say Rockbox make my D2 really better !!!  Compared to OF, among others: easier to use (in general and, particularly playlists), giving a better database management, a real "resume play" on start up, nice usable themes !  At first I thought I would miss the "absolute point" touchscreen mode, but this touchscreen, being relatively small, is more functional and easier to use in 3x3 mode.

Thanks, great work !

MarkV
Title: Re: Cowon D2
Post by: darthvim on March 05, 2010, 07:18:03 AM
Hi

i am using rockbox on 3 different sdhc-cards and it runs perfect, or at least nearly perfect ;)
sometimes i've got the problem that i turn the d2 on and select a file to play but no sound comes out of the headphones. therefor i turn the player off and on again, after this precedure it works perfect...
if i found out when it happens i'll post again a message.

it would be great if i could be able to use the + and - buttons in holdstate as FF and REW (would save a lot of battery power using this buttons insted of the display ...).
i hope i didn't skip this adjustment in the settings menue.
Title: Re: Cowon D2
Post by: Ezraghast on March 05, 2010, 06:08:46 PM
darthvim, check out this thread on iaudiophile regarding buttons in holdstate for rockbox http://iaudiophile.net/forums/showthread.php?t=28467
Title: Re: Cowon D2
Post by: saratoga on April 03, 2010, 02:20:59 AM
Would someone run test_codec against all the files in this folder:

http://download.rockbox.org/test_files/

and then post the log file?  I'd like to see how we perform on various armv5 targets.
Title: Re: Cowon D2
Post by: Ezraghast on April 03, 2010, 10:32:40 PM
Is test_codec available as a plugin inside rockbox? I thought the D2 had a telechips or is that an ARM child too?
Title: Re: Cowon D2
Post by: saratoga on April 03, 2010, 10:40:21 PM
Is test_codec available as a plugin inside rockbox? I thought the D2 had a telechips or is that an ARM child too?

Yes, although you need to add "test_codec.c" to /apps/plugins/SOURCES.  Then it becomes available as a viewer. 

Telechips is the SOC vendor, ARM designed the CPU.
Title: Re: Cowon D2
Post by: Ezraghast on April 03, 2010, 10:58:12 PM
so i need to compile a D2 build with test_codec.c?
Title: Re: Cowon D2
Post by: saratoga on April 03, 2010, 11:53:05 PM
Results are here:

http://www.rockbox.org/wiki/CodecPerformanceComparison#Telechips_TCC7801_ARM926EJ_S
Title: Re: Cowon D2
Post by: saratoga on April 05, 2010, 12:53:54 AM
Looking at my D2 build, it seems IRAM isn't used for codecs.  Is there a reason for this?  I see its in the lds file.
Title: Re: Cowon D2
Post by: anten44733 on April 10, 2010, 04:16:32 AM
Hello I from Russia
I make out my cowon D2 + 16Gb
Here are my photos in high resolution
Hopefully this will help developers

http://cowonworld.ru/forum/viewtopic.php?f=8&t=3258&sid=3f9078ac70d9631204cc2c7ca2930fe4
Title: Re: Cowon D2
Post by: adb3 on April 14, 2010, 03:56:26 PM
Quote from: Wiki CowonD2Info page
Newer D2+ hardware revisions use an updated power management chip, and some
functionality is not yet implemented on these players (eg. touchscreen support).

So my question is: is there a touchscreen support (3x3 Grid mode) in Rockbox for newer D2+ version? And, if it's not, is it still possible to use Rockbox just with DAPs buttons?

I just put Rockbox on my Newer D2+, the absolute pointing mode works well.
Title: Re: Cowon D2
Post by: Ezraghast on April 16, 2010, 08:14:59 PM
3x3 mode works well for me too.  :D

I know this isn't really a discussion/bug report thread but I've had a problem with the scrobbler plugin in all revisions I've tried to date: it writes the .scrobbler.log header to the file only intermittently. If a log is submitted and deleted, it seems the Last.fm Log playback setting has to be disabled and reenabled in order for it to be written again. This only matters when trying to use QTScrobbler of course or some other scrobbling client and the header is easily inserted but it's a little inconvenience I hadn't run into on other rockboxed players. Has anyone else experienced this? (I have a D2+ with patched FW3.11)
Title: Re: Cowon D2
Post by: Frits on April 27, 2010, 12:40:17 PM
I have a D2+ dab with firmware 4.13
I can't find a Rockbox version for my player.
Will it ever come?
Title: Re: Cowon D2
Post by: karashata on April 27, 2010, 01:01:17 PM
Frits:

First of all, ports aren't planned, they're worked on by interested individuals who own the hardware and are willing to contribute in some way or another to the project.

That said, it looks like the D2+ has been mentioned (quite recently) in this thread as working (at least for a couple people), so you could try using the D2 build (assuming that's the build these people are using) and seeing if it works on your DAP or not.

Be advised that the port is listed as unstable currently so things may not always work exactly as they should. Also, be sure to ask people for help if you have any trouble and describe your problems in detail.
Title: Re: Cowon D2
Post by: Fullmoon on May 01, 2010, 07:08:05 AM
Ahem.
Sorry, I'm not sure, where I should ask this. So...

Could radio frequency range be shifted down to 70 MHz?

I know that different region settings in COWON firmware answer for different radio ranges, IIRC, down to 78 MHZ. On the other hand, I don't know details about hardware limitations.
Title: Re: Cowon D2
Post by: Ezraghast on May 01, 2010, 08:53:40 PM
I have a D2+ dab with firmware 4.13
I can't find a Rockbox version for my player.
Will it ever come?

Hi Frits, look here http://andrew92.centelia.net/ to see instructions and links to the patched firmwares. Just make sure to check your FW version. You'll want to be using one 4.xx See here also http://iaudiophile.net/forums/showthread.php?t=25285

Quote
Ahem.
Sorry, I'm not sure, where I should ask this. So...

Could radio frequency range be shifted down to 70 MHz?

I know that different region settings in COWON firmware answer for different radio ranges, IIRC, down to 78 MHZ. On the other hand, I don't know details about hardware limitations.

Hi Fullmoon. Did you try it in the hardware thread? According to the wiki the radio chip is the Sanyo LV24000. The main (or only) developer for the D2/D2+ is shotofadds and he or she seems to be absent for a while from here and from the D2 threads over at iaudiophile.
Title: Re: Cowon D2
Post by: Frits on May 07, 2010, 07:08:38 AM
I have a D2+ dab with firmware 4.13
I can't find a Rockbox version for my player.
Will it ever come?

Hi Frits, look here http://andrew92.centelia.net/ to see instructions and links to the patched firmwares. Just make sure to check your FW version. You'll want to be using one 4.xx See here also http://iaudiophile.net/forums/showthread.php?t=25285

I have downgraded the fw version from 4.13 to 4.12 but it won't work.

I have tried this.

 Download mktccboot.exe from here
- Download bootloader-cowond2.bin from here
- Download the original v4.12 D2_P.bin from here
- Put them all in the same folder, eg. C:\firmware
- Open a command window and run the following commands:

Code:

cd /d C:\firmware
mktccboot D2_P.bin bootloader-cowond2.bin D2_P-patched.bin

This should have created a new file, D2_P-patched.bin, which you should copy to your D2 and rename to D2_P.bin. Reboot the D2 and all should be fine...

Title: dissortions @ 48khz
Post by: motorbit on May 07, 2010, 06:30:19 PM
hey, i think i found a bug or such.

lately, Ive been expecting some strange dissortions ( a high crackle) when i played audiofiles i  ripped some DVDs @ 16bit/48kHz.
also, Rb became irresponsible once when i was attempting to play one of these files, but a reset fixed it. i do´nt know whitch file caused Te crash and that crash was not reproducible.


i try ed various settings:
fl ac, ogg & ape each with some different settings off gain and with a -6db hard limiter.


to make sure my Rb isn't outdated or such , i made a clean install, what  fixed the problem. the oldest Rb version i tryed was r25836 and the most recent was  r25892.

original d2 Fw wont play flac @48kHz, but both oog and ape played fine with 2.13 cowon Fw.

all files played fine in rockbox after i re sampled them to 16bit/44.1kHz with foobar.
Title: Re: Cowon D2
Post by: longfeng328 on May 08, 2010, 10:16:30 PM
Hi there,im a code learner,i want to contribute to the RB's developing on D2.

now i think the usb issues is most necessary to be solved,e.g. usb charging or data transferring.
Onced done,we can set RB the first-boot firmware.

so could anybody tell me which files of the sources' code  should be concerned?
Title: Re: Cowon D2
Post by: saratoga on May 08, 2010, 10:26:45 PM
so could anybody tell me which files of the sources' code  should be concerned?

Check out:

/firmware/target/arm/usb-tcc.c

and

/firmware/target/arm/tcc780x/*

Also, /firmware/SOURCES lists most of the D2 specific files if you search it for "D2".
Title: Re: Cowon D2
Post by: longfeng328 on May 08, 2010, 11:01:21 PM
saratoga,Thank you very much!
Title: Re: Cowon D2
Post by: saratoga on May 08, 2010, 11:23:53 PM
It seems USB on the TCC chips is fairly well along, so hopefully with the datasheet and some debugging it can be made to work. 
Title: Re: Cowon D2
Post by: shotofadds on May 18, 2010, 08:16:34 AM
It seems USB on the TCC chips is fairly well along, so hopefully with the datasheet and some debugging it can be made to work. 
It's been used for logf-over-usb and also to dump raw data from the NAND chips via UMS, but reliability is poor and frequently stalls or freezes the player. Unfortunately my knowledge of USB is zero, so I didn't ever look into it further.

Controlling/monitoring charging should be fairly straightforward as it is controlled by the power management chip, but there's a slight complication because we have to runtime-detect whether there is a PCF50606 or 50633 present. There's a datasheet available for both chips, so implementation should be straightforward enough.

Apologies I've been away for so long, but "real life" commitments are keeping me plenty busy enough at the moment.

Edited to add:

Looking at my D2 build, it seems IRAM isn't used for codecs.  Is there a reason for this?  I see its in the lds file.

When I first started the port, I did have IRAM working and used for codecs, but for some unknown reason performance was actually worse than without. It was never investigated fully, so IRAM remains disabled.
Title: Re: Cowon D2
Post by: funman on May 21, 2010, 08:06:43 AM
Looking at my D2 build, it seems IRAM isn't used for codecs.  Is there a reason for this?  I see its in the lds file.

When I first started the port, I did have IRAM working and used for codecs, but for some unknown reason performance was actually worse than without. It was never investigated fully, so IRAM remains disabled.

Looking at crt0.S for D2, IRAM isn't cached or buffered.
s/1001aee0/1001aeec/ in tcc780x/crt0.S should do it.

btw would it be simpler to use map_section/ttb_init/enable_mmu functions from mmu-arm.S, rather than using the OF setup ?
Title: Re: Cowon D2
Post by: saratoga on May 25, 2010, 01:19:06 AM
Looking at my D2 build, it seems IRAM isn't used for codecs.  Is there a reason for this?  I see its in the lds file.

When I first started the port, I did have IRAM working and used for codecs, but for some unknown reason performance was actually worse than without. It was never investigated fully, so IRAM remains disabled.

Looking at crt0.S for D2, IRAM isn't cached or buffered.
s/1001aee0/1001aeec/ in tcc780x/crt0.S should do it.

btw would it be simpler to use map_section/ttb_init/enable_mmu functions from mmu-arm.S, rather than using the OF setup ?

Enabling it would be nice, since I think its real SRAM on the D2.  You'll probably get a little bit of a battery boost. 
Title: Re: Cowon D2
Post by: shotofadds on May 25, 2010, 08:03:26 PM
Looking at crt0.S for D2, IRAM isn't cached or buffered.
s/1001aee0/1001aeec/ in tcc780x/crt0.S should do it.

I had a couple of hours to get my dev box back up to speed tonight, and the results with IRAM and the above tweak are pretty good (if not earth-shattering). On a random sample of FLAC and MP3s I'm getting test_codec results about 10% faster than the figures on the CodecPerformanceComparison page - eg. FLAC is up to 2100%. I'll do some more conclusive testing later and get this committed (if it proves stable), since the improvement is definitely worth having.

Quote
btw would it be simpler to use map_section/ttb_init/enable_mmu functions from mmu-arm.S, rather than using the OF setup ?

Almost certainly.  ;)
Title: Re: Cowon D2
Post by: shotofadds on May 26, 2010, 06:29:46 PM
I've run test_codec several times over the full set of sample tracks with IRAM enabled and haven't run into any problems, so things appear to be stable. Improvements against the latest test on the CodecPerformanceComparison wiki (r25447, no IRAM) are:

AAC-HE +6%
Cook +14..16%
FLAC +7%
MP3 +7%
MPC +12%
AAC-LC +10..14%
Vorbis +13..17%
WMA +16%

APE/ALAC/WavPack are all more-or-less unchanged. I've attached the latest test_codec log to this post (tested using r26288 + IRAM).

Regarding battery life, I doubt even these improvements will make a lot of difference. There has been very little experimentation with power management / clocking changes / turning off outputs etc on this device, so I think codec performance is the least of our worries.  ;)

Also, while doing the above tests I did (re)discover that both the core and the MPA codec (at least) will attempt to put things in IRAM sections even if USE_IRAM is undefined. This is the reason for the current .lds hacks for this CPU, and should really be put right as it causes undefined instruction errors in the case of the MPA codec.

EDIT: Looks like some hackery in mad_iram.h is responsible for the MPA codec putting things in .icode/.ibss when it shouldn't. Not sure I'm the best person to tackle that, though.
Title: Re: Cowon D2
Post by: longfeng328 on May 27, 2010, 09:29:21 PM
shotofadds,your attached file is empty...  :-[
Title: Re: Cowon D2
Post by: shotofadds on May 28, 2010, 12:52:30 PM
So it was. I've fixed it now.
Title: Re: Cowon D2
Post by: saratoga on May 28, 2010, 01:16:44 PM
http://www.rockbox.org/wiki/CodecPerformanceComparison#Telechips_TCC7801_ARM926EJ_S

Updated.
Title: Re: Cowon D2
Post by: mbk1969 on May 28, 2010, 01:39:03 PM
Are binaries of "current build" built with that "IRAM"-optimization ?
Title: Re: Cowon D2
Post by: saratoga on May 28, 2010, 01:45:12 PM
Are binaries of "current build" built with that "IRAM"-optimization ?

Nope.
Title: Re: Cowon D2
Post by: mbk1969 on May 28, 2010, 01:50:18 PM
Will be ?
Title: Re: Cowon D2
Post by: shotofadds on May 28, 2010, 01:51:00 PM
Once I've commited it, yes.  :P

btw. Thanks for updating the table saratoga, I would have done it myself but I can't seem to download parse_testcodec.pl (403 Forbidden on the wiki link). Also how did you calculate those percentages? Mine were effectively "the previous test took xx% longer", which is probably not quite right.
Title: Re: Cowon D2
Post by: saratoga on May 28, 2010, 02:01:57 PM
I just used the script (which indeed doesn't seem to download right now):

$oldfile{$key}->[1]-$newfile{$key}->[1])/$oldfile{$key}->[1]*100+100

so basically (old - new)/old
Title: Re: Cowon D2
Post by: shotofadds on May 29, 2010, 07:23:33 PM
The 6% improvement in MP3 decoding speed seems to have resulted in an improvement in battery life of about 45 minutes (to 18h30m, playing VBR ~190k MP3s from SD). You might get better results with Vorbis / WMA / MPC files, or without an SD card inserted.

I'll get these changes committed soon.
Title: Re: Cowon D2
Post by: funman on May 30, 2010, 07:49:38 AM
this (http://www.rockbox.org/wiki/bin/viewfile/Main/CodecPerformanceComparison?filename=parse_testcodec.pl.txt) link seems to work (I got here through the revisions of the script)
Title: Re: Cowon D2
Post by: shotofadds on May 31, 2010, 05:12:58 PM
The IRAM change is now committed, although I wouldn't get too excited about it as it doesn't make a huge difference.  Also committed this weekend was a patch from FS#11240 (http://www.rockbox.org/tracker/task/11240) that extends the volume range down to -89dB.
Title: Re: Cowon D2
Post by: mbk1969 on June 01, 2010, 06:12:17 AM
I got my nose in Wolfson WM8985 spec and became curious about fully customizable three analog ouputs of this chip. By default Rockbox disables not used outputs, right? And wich output is used in D2 - LOUT2/ROUT2 or LOUT1/ROUT1?

update: D2 with original firmware can play video with line audio signal through the pseudo-usb connector and I think that OUT3/OUT4 outputs are used for that. It can be checked with added  advanced settings for enabling theese outputs (and with such cable)...
Title: Re: Cowon D2
Post by: motorbit on June 01, 2010, 05:13:53 PM
line out is a feature missed forever by some users.
albeit, personally i would not care to much. but i guess it might worth implying it if possible without to much work.
Title: Re: Cowon D2
Post by: shotofadds on June 01, 2010, 06:19:56 PM
It's been a long time since I looked at this. LOUT1/ROUT1 is definitely used for the headphone output, and I *think* LOUT2/ROUT2 is used for the audio portion of the TV-out cable. This could be wrong, of course, and even if correct there might need to be some extra logic to enable it.

The code currently assumes L/ROUT1 for headphones and L/ROUT2 for line:

http://svn.rockbox.org/viewvc.cgi/trunk/firmware/drivers/audio/wm8985.c?revision=26413&view=markup

but I don't have the appropriate cable(s) to test it.
Title: Re: Cowon D2
Post by: mbk1969 on June 02, 2010, 03:55:30 AM
Thank you for listing. I will dig in. I have a feeling that instead of muting unused outputs in audiohw_preinit() you can disable them - that will be more powersaveable.
I think I am ready to join the RB as developer... will see...

Can you build patched version with audiohw_set_lineout_vol() called somewhere in initialization stage? It can be tested without cable but with proper measure tools.
Title: Re: Cowon D2
Post by: saratoga on June 02, 2010, 10:09:04 AM
Can you build patched version with audiohw_set_lineout_vol() called somewhere in initialization stage? It can be tested without cable but with proper measure tools.

If you've got a line out cable, maybe you should try it and see.
Title: Re: Cowon D2
Post by: mbk1969 on June 02, 2010, 11:21:36 AM
ok, I`ll try
Title: Re: Cowon D2
Post by: motorbit on June 04, 2010, 02:54:00 PM
when i first used rb i hated it - meanwhile i dont use the of anymore.
bit thanks for all that work you had put in.



btw, im expecting a bug with rb:
i often have quite harsh crashes of the player when i plug it onto the usb cable. ill have to use the reset button than to reactivate it.

when i plug my switched of player onto the usb cable with hold engaged, my player will crash most of the time.

when i plug in my switched off player onto the cable with hold disengaged, my player will crash rarely.

when i plug in my switched on player onto the cable it will never crash no mater if  rb is launched or the of.


so, its not a big issue, albeit i often forget to switch off hold, its not a big thing to press the reset button. just wondering if anybody else expiriences this issue. my player is a 16 gig d2+ btw - on of the first d2+ that still do have  the old powermanagement chips.

Title: Re: Cowon D2
Post by: buk on June 15, 2010, 05:58:42 PM
so could anybody tell me which files of the sources' code  should be concerned?

Check out:

/firmware/target/arm/usb-tcc.c

and

/firmware/target/arm/tcc780x/*

Also, /firmware/SOURCES lists most of the D2 specific files if you search it for "D2".

I made a patch regarding USB a while ago (FS#9917 (http://www.rockbox.org/tracker/task/9917)).
As said even with those changes USB was unstable. Btw the patch correct a bug in usb_drv_send_nonblocking.
Title: Re: Cowon D2
Post by: RockBoxy on July 24, 2010, 06:38:20 AM
I'm not a programmer myself but may I ask you guys a question?

I'm really interested in the wavpack lossles recording function for my cowon D2+.

Do you think there is a chance the voice record function will be ready soon?
If not would someone be so kind to start working on this function?

Title: Re: Cowon D2
Post by: BasculeTheFule on July 31, 2010, 12:57:31 PM
Hi.

I have just bought what I am guessing is one of the last new Cowon D2+ to be had in the UK.

I've been using an X5 and latterly an X5L with Rockbox for some time and had forgotten how frustrating the default Cowon UI can be.

I'd like to Rockbox the D2+ but note that the D2 port is currently unstable. Given that the D2 seems to be making way for the D3, what are the chances of the port progressing to a stable state and further developed?

Also, just how usable is the unstable build, and is there any risk associated with installing it at this point? Is it correct that I will need to get an SD card if I want to be able to save any changes I make to Rockbox (should I install it) at this point?

Cheers,

BTF
Title: Re: Cowon D2
Post by: shotofadds on August 03, 2010, 05:08:23 PM
I'd like to Rockbox the D2+ but note that the D2 port is currently unstable. Given that the D2 seems to be making way for the D3, what are the chances of the port progressing to a stable state and further developed?

Also, just how usable is the unstable build, and is there any risk associated with installing it at this point? Is it correct that I will need to get an SD card if I want to be able to save any changes I make to Rockbox (should I install it) at this point?
Unfortunately the D2/D2+ port has reached a bit of a dead-end, as there is really only one developer (me) involved in the port, and it works "well enough" for me as it is. Since no-one else seems to be interested in developing it, this is where it will stay for the time being. All the good work done by the rest of the Rockbox team will still be built into the D2 port, but there might not be any D2-specific updates for a while.
 
Having said that, the port is quite usable in its current state (especially if you download one of the designed-for-touchscreen themes from the themes site). "Unstable" just means that some significant features are missing, it doesn't mean that the player is unstable while running Rockbox.

And yes, the recommended way to run the D2 port at the moment is to install Rockbox to an SD card - you will need this to save settings/playlists etc as Rockbox can only access the internal memory in read-only mode.

I hope that helps, and you aren't scared off trying Rockbox by the "unstable" tag. If you have any trouble there are some very helpful people around here or at the iAudiophile forums.  8)
Title: Re: Cowon D2
Post by: BasculeTheFule on August 03, 2010, 06:14:19 PM
Thanks for the update!

I had a feeling the project might have ground to a halt, hence the post.

I am waiting for an SD card to arrive in the post and will load up Rockbox just as soon as it gets here in the hope that it does a better job than the 2.13 firmware I currently have installed!

I was thinking about selling my X5L, but to be honest would have to think twice about that if it meant being stuck with the Cowon UI on the D2+.

Cheers,

BTF
Title: Re: Cowon D2
Post by: cowonoid on August 12, 2010, 11:12:27 AM
I am curious: there were so many hours and days of work spent on backwards-engineering the D2 by disassembling the firmware;
wouldn't it be more effective to find out about the exact shematic? Look for some defect D2s or buy one (everyone interested spents a few $) or even use the own one cautiously and disassemble it (like the guys from anythingbutipod)? Measure each pin of a chip with an ohmeter and look where it is connected to and during that tipping the information into Eagle layout designer?

With the shematic and the datasheets one could do the greatest things! Even get more out of the hardware than Cowon does (f.e. unused ports of ICs). The "rockbox module" could then be built on a platform, which has the most basic controls over the hardware and is not driven by pieces of disassembled code (which is maybe the reason for annoying "bugs" like just 20% of battery life).

Knowing all the hardware and how it is connected would give a feeling like I build the whole device myself. That would contribute to motivation and speed of development.

I mean: this device is really nice! With a better firmware than the original one I probably would use it for the next 40 years without getting tired of it (buying 2 more now for spare :)).

Wouldn't it be worth it to get fully familiar with all the devices structure? I even guess, that doing that from the beginning would have spared time.


Or am I wrong?

Title: Re: Cowon D2
Post by: torne on August 12, 2010, 11:34:37 AM
wouldn't it be more effective to find out about the exact shematic? Look for some defect D2s or buy one (everyone interested spents a few $) or even use the own one cautiously and disassemble it (like the guys from anythingbutipod)? Measure each pin of a chip with an ohmeter and look where it is connected to and during that tipping the information into Eagle layout designer?
Not really, for several reasons:
1) Not every component in a given player has a public datasheet, or can even be identified at all. It doesn't help to know how something is connected if you don't know what it *is*.
2) Most connections are obvious and boring (e.g. buses), there's no need to figure most things out this way at all.
3) Testing with an ohmmeter doesn't actually guarantee there's a plain trace between two things.
4) You have to basically destroy the player to be able to get anything like a full picture, since there's no other way to get to the contacts of a BGA package :)
5) It's really time-consuming and tedious. It's not at all guaranteed to be faster than disassembling the firmware...

Occasionally it's useful to know how certain things are connected (e.g. GPIOs that have no obvious function) and someone will investigate the hardware, but generally a schematic would add little value, and it's really not as easy to produce one as you suggest.
Title: Re: Cowon D2
Post by: saratoga on August 12, 2010, 11:40:36 AM
I am curious: there were so many hours and days of work spent on backwards-engineering the D2 by disassembling the firmware;
wouldn't it be more effective to find out about the exact shematic? Look for some defect D2s or buy one (everyone interested spents a few $) or even use the own one cautiously and disassemble it (like the guys from anythingbutipod)? Measure each pin of a chip with an ohmeter and look where it is connected to and during that tipping the information into Eagle layout designer?

About 99% of the interesting stuff is all on the main system on a chip, so the traces wouldn't tell you much.
Title: Re: Cowon D2
Post by: cowonoid on August 12, 2010, 02:04:54 PM
1) Not every component in a given player has a public datasheet, or can even be identified at all. It doesn't help to know how something is connected if you don't know what it *is*.

For sure. However, every part of the D2 seems to be identified and there was a time at which even the TCC7801 datasheet was available to the public (and for some people it probably still is)

3) Testing with an ohmmeter doesn't actually guarantee there's a plain trace between two things.

Then an oscilloscope and applied AC to the contacts. There surely is a way to check on physical connection.

4) You have to basically destroy the player to be able to get anything like a full picture, since there's no other way to get to the contacts of a BGA package :)

If I have the datasheet and thus the PIN descriptions and locations; couldn't I guess the traces? (the traces must leave the chip somewhere)

5) It's really time-consuming and tedious. It's not at all guaranteed to be faster than disassembling the firmware...

Occasionally it's useful to know how certain things are connected (e.g. GPIOs that have no obvious function) and someone will investigate the hardware, but generally a schematic would add little value, and it's really not as easy to produce one as you suggest.

Probably it would be much work, but with a different result than disassembling the firmware: you would know the whole architecture and could build up your own rockbox low-level firmware, which has nothing todo with the original one.

About 99% of the interesting stuff is all on the main system on a chip, so the traces wouldn't tell you much.

You mean, it's in the software for the TCC processor? With rockbox all the original soundprocessing software is screwed up anyway, isn't it?

What I mean is: there are people in this forum speaking about building an own DAP dedicated for rockbox (which is amazing!)
What would be the difference between this player and the D2? Isn't it, that you know every connection and the intention of every single part?
Title: Re: Cowon D2
Post by: saratoga on August 12, 2010, 02:26:39 PM
You mean, it's in the software for the TCC processor?

Hardware and software.  What I'm saying is theres very little of the player on the board.  Most of it is inside a single chip.  Finding traces doesn't help if nothing of importance uses traces. 

What I mean is: there are people in this forum speaking about building an own DAP dedicated for rockbox (which is amazing!)
What would be the difference between this player and the D2? Isn't it, that you know every connection and the intention of every single part?

You pick parts that are all well documented, and then you don't bother with ones that would require reverse engineering software (like the D2's flash translation layer).
Title: Re: Cowon D2
Post by: peaceful1 on August 27, 2010, 02:05:52 AM
guys in the last few weeks I cant use new rockbox builts, mostly they don't boot any more, can anyone give me a clue what to do ?!
Title: Re: Cowon D2
Post by: mc2739 on August 27, 2010, 07:13:12 AM
guys in the last few weeks I cant use new rockbox builts, mostly they don't boot any more, can anyone give me a clue what to do ?!

This problem was reported on the bug tracker: FS#11558 (http://www.rockbox.org/tracker/task/11558)

But it was reported to be fixed as of build r27864 and the task was closed.  Please try the latest build to see if the problem has indeed been resolved.
Title: Re: Cowon D2
Post by: shotofadds on August 27, 2010, 01:02:13 PM
There's no reason why this behaviour would have changed between r27860 and r27864, so the problem is not "fixed" - it's just not manifesting itself at the moment.  r27646 did change some drivers, but the code changes are trivial and won't have caused the problem.

I think these kind of issues started happening intermittently after the build was switched to the EABI compiler - I've also seen reports of strange things like one or both earphones sometimes not having any sound.

But at the moment I don't have the time to investigate and fix it, unfortunately.
Title: Re: Cowon D2
Post by: peaceful1 on August 27, 2010, 01:29:52 PM
There's no reason why this behaviour would have changed between r27860 and r27864, so the problem is not "fixed" - it's just not manifesting itself at the moment.  r27646 did change some drivers, but the code changes are trivial and won't have caused the problem.

I think these kind of issues started happening intermittently after the build was switched to the EABI compiler - I've also seen reports of strange things like one or both earphones sometimes not having any sound.

But at the moment I don't have the time to investigate and fix it, unfortunately.
Well shotofadds, it’s not important we all can use the old builts ,I just thought it’s good to say the details happening that’s all. We all appreciate all you did for D2 I personally don’t see any need of more development it does all we need.
Thanks again.


Title: Re: Cowon D2
Post by: funman on August 27, 2010, 08:04:49 PM
But at the moment I don't have the time to investigate and fix it, unfortunately.

Do you know at which point / in which driver it fails?

Perhaps developers who don't have a D2 could give a hand on this.
Title: Re: Cowon D2
Post by: Bkd11 on August 31, 2010, 02:57:06 PM
Do you know at which point / in which driver it fails?

For me the problems started at r27123. Like shotofadds said, right after the EABI was enabled. I've seen various intermittent problems. I think andrewthecoder over at http://iaudiophile.net//forums/showthread.php?t=37064&page=2 described the most common ones best, so here is a quote from him.

Quote from: andrewthecoder
Revision 27090 is what I'm using, and have been using since whenever it was it was committed.
I've tried various times to update to newer builds, but I've intermittently experienced one of the following:
1) Freezing on a black (but backlight on) screen immediately after the bootloader
2) Muted audio, despite all functions seemingly working fine
3) Audio heavily panned to one channel, output volume lower than usual

Usually hard-resetting (holding power switch for 10 seconds), then switching on again worked to get it to boot normally, but sometimes it would require several of these reset cycles before it would work, "several" ranging from 1 to 20.
This frustrated me enough to revert to an older build, in my case 27090.

Building the database also seems to cause it to freeze/lockup in my experience. There have been a few times I actually had to delete all the database files from the .rockbox folder on my sd card just to get it to boot again.

I've been happily running rockbox on my d2 for over 2 years now and haven't experienced these specific problems until after r27123.
Title: Re: Cowon D2
Post by: shotofadds on September 01, 2010, 06:17:48 PM
I've been trying to reproduce some of these errors tonight, but I can't make anything go wrong using r27966 (or with r27822 as reported in FS#11558). My D2 boots properly each time, I have audio in both ears, and the database appears to work fine.

Can anyone point me to a rockbox.zip that exhibits any of these problems? I have no doubt that a problem still exists somewhere, but it's hard to track down when the symptoms don't show themselves...
Title: Re: Cowon D2
Post by: mbk1969 on September 02, 2010, 06:58:58 AM
I`ve met same problems with absent audio (and with audio in one channel) on my D2+. I do work around by loading original firmware and loading back to Rockbox. Build version is r27627. I can mail you the archive file with RB folder...

Title: Re: Cowon D2
Post by: shotofadds on September 05, 2010, 11:08:25 AM
Thanks mbk1969. I tried your r27627 zip and got the "no audio" problem on the 2nd time I booted Rockbox, although it has worked properly every time after that (about 10-15 boots so far).

The strange thing was, on the "no audio" occasion I heard the usual pops and clicks on bootup and shutdown, so the audio outputs are definitely enabled. That suggests to me it might be something in the PCM driver rather than the audio hardware driver, and indeed there was a change in that area in r26253 (http://svn.rockbox.org/viewvc.cgi?view=rev;revision=26253). This sounds ominous:

Quote
Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops.

I will check through that code with a fine-toothed comb and get back to you...

NOTE: I haven't seen any black screens or failures to boot up in this build - that is clearly a different problem and will need more investigation.
Title: Re: Cowon D2
Post by: shotofadds on September 05, 2010, 05:18:52 PM
Looking at that PCM change, the driver code changes look sane and in any case the change was made a long time before anyone started reporting issues. And it wouldn't explain muting in one ear only, so I think we can rule that one out.

So... the finger points at EABI again. To try and identify if this is the cause or not I have built two versions of r28000, one without EABI and one with.

Please could everyone who has seen these issues try both versions for a few days and report back for each version:

 a) how many times you have booted it
 b) how many times audio was missing in one or both ears
 c) how many times you got a black screen or freeze on bootup

Version 1: http://www.megaupload.com/?d=41QHGF6S
Version 2: http://www.megaupload.com/?d=CAYFO7X0
Title: Re: Cowon D2
Post by: mbk1969 on September 06, 2010, 09:25:13 AM
Results for version 1:
- first load - OK ;
- second load - audio absent ;
- third load - audio only in one channel ;
- fourth load - OK...

Installing version 2...

Results for version 2:
- no failure at all for at least 20 attempts.
Title: Re: Cowon D2
Post by: shotofadds on September 06, 2010, 06:29:51 PM
Can you guess which version was built with the --no-eabi option?  ;D

Now we "just" need to track down the bug, wherever it may be. I fixed some delay loops that got optimised out by the EABI compiler a few months ago, and at the time I verified that the generated code was the same for both compilers. So those shouldn't be the problem.

At least in the meantime people can use the Version 2 link above for a nice new working version of r28000...
Title: Re: Cowon D2
Post by: mbk1969 on September 07, 2010, 07:04:03 AM
Yeah, no need to guess. -)


For me it is strange thing - to optimize drivers code. Codecs - may be, but drivers...
Title: Re: Cowon D2
Post by: funman on September 07, 2010, 07:49:26 AM
Here "optimized out" means "removed completely by compiler"

Optimizing drivers (with gcc -O options) is necessary I think, the difference between -O0 (no optimizations at all) and -O (a few optimizations) can be quite big in terms of performance and size.
Title: Re: Cowon D2
Post by: mbk1969 on September 07, 2010, 01:08:42 PM
Optimizing drivers (with gcc -O options) is necessary I think, the difference between -O0 (no optimizations at all) and -O (a few optimizations) can be quite big in terms of performance and size.

Definitely, but arn`t stability and predictability more valueable and preferable things for a driver (then perfomance and size)? I mean the code for D2 built without EABI was able to steer the device, and then came EABI and the new code gains more perfomance and less size but also unstability...
Title: Re: Cowon D2
Post by: saratoga on September 07, 2010, 01:15:41 PM
Definitely, but arn`t stability and predictability more valueable and preferable things for a driver (then perfomance and size)? I mean the code for D2 built without EABI was able to steer the device, and then came EABI and the new code gains more perfomance and less size but also unstability...

We didn't switch to EABI because it optimizes better for the D2.  We switched because we wanted all ARM devices using the same compiler.  Discussing what is "more valuable" for a specific port doesn't really make sense since this isn't about the D2 specifically.
Title: Re: Cowon D2
Post by: Bkd11 on September 08, 2010, 06:49:39 PM
Hey shotofadds,

Would you mind posting a patch/diff of your r28000 non-eabi build? That way I can update the 'Buttons in Hold Mode' builds with "stable" builds. I tried just reverting r27123 a while ago but that obviously didn't work.  ;D

Thanks in advance.
Title: Re: Cowon D2
Post by: mbk1969 on September 08, 2010, 07:07:05 PM
Look, guys... If it sounds like a blame then I failed to deliver my point of view. I only dare suggest (to shotofadds) that it could be easier to disable optimization for driver type of sources (in make files or in sources themselves by pragmas) and forget about such things as `optimized` timeout loops. Such step could eliminate dependency of functionality (operability) from compilers intrinsic  implementations/differences.
I did not touch the compiler choice at all.
Title: Re: Cowon D2
Post by: funman on September 08, 2010, 11:03:57 PM
@Bkd11 : just use tools/configure --no-eabi , no patch needed.

@mbk1969 : disabling optimizations for the whole rockbox build (i.e. using -O0) is:

Using -O0 *manually* on individual files is a good idea though it could help figuring out the problem.

Just run make V=1 to see the full gcc command line, and paste it with -O option changed to -O0, it might work with more or less modifications needed without making rockbox too much slow/fat.

EDIT: i don't think gcc support changing optimizations or other parameters through pragmas but if you know how i'd like to know
Title: Re: Cowon D2
Post by: Bkd11 on September 08, 2010, 11:55:36 PM
@Bkd11 : just use tools/configure --no-eabi , no patch needed.
Thanks  :)

Edit: Unfortunately I get a bunch of errors that I don't get when I do a normal ../tools/configure
Code: [Select]
/home/brian/rockbox/apps/dsp_arm.S: Assembler messages:
/home/brian/rockbox/apps/dsp_arm.S:53: Error: bad instruction `ldmpc cond=lt,regs=r4'
/home/brian/rockbox/apps/dsp_arm.S:63: Error: bad instruction `ldmpc regs=r4'
/home/brian/rockbox/apps/dsp_arm.S:118: Error: bad instruction `ldmpc cond=lt,regs=r4-r10'
/home/brian/rockbox/apps/dsp_arm.S:137: Error: bad instruction `ldmpc regs=r4-r10'
/home/brian/rockbox/apps/dsp_arm.S:170: Error: bad instruction `ldmpc cond=lt,regs=r4'
/home/brian/rockbox/apps/dsp_arm.S:181: Error: bad instruction `ldmpc regs=r4'
/home/brian/rockbox/apps/dsp_arm.S:231: Error: bad instruction `ldmpc cond=lt,regs=r4-r6'
/home/brian/rockbox/apps/dsp_arm.S:245: Error: bad instruction `ldmpc regs=r4-r6'
/home/brian/rockbox/apps/dsp_arm.S:308: Error: bad instruction `ldmpc cond=lt,regs=r4-r9'
/home/brian/rockbox/apps/dsp_arm.S:330: Error: bad instruction `ldmpc regs=r4-r9'
/home/brian/rockbox/apps/dsp_arm.S:393: Error: bad instruction `ldmpc regs=r4-r11'
/home/brian/rockbox/apps/dsp_arm.S:450: Error: bad instruction `ldmpc regs=r4-r11'
/home/brian/rockbox/apps/dsp_arm.S:513: Error: bad instruction `ldmpc regs=r4-r11'
/home/brian/rockbox/apps/dsp_arm.S:560: Error: bad instruction `ldmpc regs=r4-r8'
Title: Re: Cowon D2
Post by: funman on September 09, 2010, 12:56:04 AM
Probably too old binutils which don't support the gas macros?

Which version of arm-elf-as do you have? rockboxdev.sh should install 2.16.1
Title: Re: Cowon D2
Post by: Bkd11 on September 09, 2010, 02:41:17 AM
Well this might not be the proper forum to continue this discussion, but I ran tools/rockboxdev.sh selecting all options.

Then preceeded with tools/configure --no-eabi  as you instructed.

Code: [Select]
Normal build selected
Using source code root directory: /home/brian/rockbox
Using arm-elf-gcc 4.0.3 (400)
Using arm-elf-ld 2.16.1

But still received same errors as in my post above.  :(

Title: Re: Cowon D2
Post by: mbk1969 on September 09, 2010, 07:37:03 AM
EDIT: i don't think gcc support changing optimizations or other parameters through pragmas but if you know how i'd like to know

http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html
:
#pragma GCC optimize ("string"...)
This pragma allows you to set global optimization options for functions defined later in the source file. One or more strings can be specified. Each function that is defined after this point will be as if attribute((optimize("STRING"))) was specified for that function. The parenthesis around the options is optional. See Function Attributes, for more information about the optimize attribute and the attribute syntax.

The `#pragma GCC optimize' pragma is not implemented in GCC versions earlier than 4.4.

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes
:
optimize
The optimize attribute is used to specify that a function is to be compiled with different optimization options than specified on the command line. Arguments can either be numbers or strings. Numbers are assumed to be an optimization level. Strings that begin with O are assumed to be an optimization option, while other options are assumed to be used with a -f prefix. You can also use the `#pragma GCC optimize' pragma to set the optimization options that affect more than one function. See Function Specific Option Pragmas, for details about the `#pragma GCC optimize' pragma.

This can be used for instance to have frequently executed functions compiled with more aggressive optimization options that produce faster and larger code, while other functions can be called with less aggressive options.

http://gcc.gnu.org/onlinedocs/gcc/ARM-Pragmas.html#ARM-Pragmas
Title: Re: Cowon D2
Post by: torne on September 09, 2010, 07:51:30 AM
Yes, it's possible, but the point you are missing is that GCC with no optimisations produces *spectacularly* wasteful code, since it doesn't generally bother to even keep local variables in registers... -O0 even for what you consider to be not-performance-critical code will generally turn out to be super slow...
Title: Re: Cowon D2
Post by: shotofadds on September 09, 2010, 07:56:13 AM
There's also no point in adding #pragmas to individual files, because once you have figured out which file(s) to change, you might as well solve the problem properly rather than working around it. Don't fret, it will get fixed soon enough.

Also note, the D2 build no longer works "out of the box" with the --no-eabi option (for a different reason to without Bkd11's errors): you also need to disable use of IRAM in apps/codecs/libmad/mad_iram.h.
Title: Blackscreen - current release r28058 !!!
Post by: AsusFreak on September 10, 2010, 03:23:12 AM
Hi all.

By the way: an old problem came back I think:
r28058 does not start anymore. Only the bootloader is shown then i get the blackscreen and have to wait some minutes before being able to boot into OF.
We had a same issue some weeks ago (see closed FS#11558).
My last actual working build is r28051.

See FS#11618:
http://www.rockbox.org/tracker/task/11618
Title: Which source file has the code for polling the HOLD button for dual boot on D2 ?
Post by: mneedes on September 11, 2010, 11:36:36 AM

(NEVERMIND... I just found it.  It is in an assembly language file, LOL.  firmware/target/arm/tcc780x/crt0.S)

The telechips bootloader used by the D2 is different from several other bootloaders (e.g.: ipod bootloader) in that it doesn't poll the HOLD button in its main() entry point (bootloader/telechips.c).  My question is WHERE is the source code that polls the HOLD button for the D2 ?

(NEVERMIND... I just found it.  It is in an assembly language file, LOL.  firmware/target/arm/tcc780x/crt0.S)

Thanks!
Matt
Title: Re: Cowon D2
Post by: shotofadds on September 12, 2010, 04:42:08 PM
r28058 does not start anymore. Only the bootloader is shown then i get the blackscreen and have to wait some minutes before being able to boot into OF.
We had a same issue some weeks ago (see closed FS#11558).
My last actual working build is r28051.

I can re-create this problem here, and it looks like r28054 triggered it (r28051,52,53 all work correctly for me). It seems to be a code alignment problem, since inserting 3 NOPs into main.c makes the problem go away, at least temporarily. But I don't understand why we haven't hit this problem any time in the past 3 years...

Leave it with me a while longer and I'll find a proper fix.

I've also spotted a potential cause of the missing audio channels - but I need to do some more testing to confirm it.

EDIT: It's the MCFG |= 1 line in system-tcc780x.c that causes the black screens in some builds. I'm trying to work out whether this is even needed at all, but can't for the life of me work out why this hasn't been a problem before.
Title: Re: Cowon D2
Post by: AsusFreak on September 14, 2010, 10:02:28 AM
I can re-create this problem here, and it looks like r28054 triggered it (r28051,52,53 all work correctly for me). It seems to be a code alignment problem, since inserting 3 NOPs into main.c makes the problem go away, at least temporarily. But I don't understand why we haven't hit this problem any time in the past 3 years...

Leave it with me a while longer and I'll find a proper fix.

Thanks for taking care of it, shotofadds.

Edit:
r28078 is starting correctly again. I do not know what causes the right booting now but it rocks again - hooray!

So for me the last point's not working is the aspect of redrawing conditionals with timing but this is a minor point...

Title: Re: Cowon D2
Post by: shotofadds on September 14, 2010, 01:45:16 PM
r28078 is starting correctly again. I do not know what causes the right booting now but it rocks again - hooray!

I can 100% guarantee that this is temporary, it'll stop working again in a few builds time. I can put in a temporary fix, but to solve it permanently I need to better understand why this has only just started happening after nealry 3 years of working builds...

EDIT: I've been working on this some more tonight and have come to the conclusion that this whole area in system-tcc780x.c smells fishy. It claims to "do with the OF does", but that's not quite true. The OF runs this code before the ARM caches have been enabled, whereas we run it with the caches enabled.

Lo and behold, if I disable the data cache before running this code the problem goes away.... so it looks like I have found a workaround (though I still need to test this works in bootloader builds before I can commit a "fix"). This whole area is in need of some  tidying up and further investigation as to what the code is actually doing, though.
Title: Re: Cowon D2
Post by: motorbit on September 15, 2010, 05:31:15 PM
Quote
The OF runs this code before the ARM caches have been enabledif
Quote
if I disable the data cache before running this code the problem goes away.... so it looks like I have found a workaround

workaround? to me* it rather sounds as if you found the surce and a proper fix to the problems we faced with some of the later builds.

nice work :)



*me no know nothing about this code^^

Title: Re: Cowon D2
Post by: funman on September 16, 2010, 12:13:13 AM
BTW would replacing the MMU setup in crt0.S by calls to mmu-armv4.S help debug this?

(with respect to caches)
Title: Re: Cowon D2
Post by: Alex_Nsk on September 17, 2010, 12:27:32 AM
Hi! Is there are anybody who really knows in what formats audio data is transfered into the codec from SoC Telechip? Right now I'm trying to use more audiophile version of DAC with D2+ DAP. Just cant establish connection in both I2S and Left justified/right justified 16/24 bit formats. There is or digital noise or very very quiet sound in most lucky case...Is there are DSP/PCM mode??? Is it could be changed by rockbox software??
Title: Re: Cowon D2
Post by: saratoga on September 17, 2010, 12:42:30 AM
Hi! Is there are anybody who really knows in what formats audio data is transfered into the codec from SoC Telechip? Right now I'm trying to use more audiophile version of DAC with D2+ DAP. Just cant establish connection in both I2S and Left justified 16/18/20/24 bit formats. There is or digital noise or very very quiet sound in most lucky case...Is there are right justified standart???

According to the WM8985 datasheet, it supports all of those formats, see the "device description" chapter, and register 0x04 specifically.
Title: Re: Cowon D2
Post by: BurntOfferings on September 23, 2010, 07:11:47 PM
Hello there! can I an any way help with getting Line-in working? That feature is really important for me, but I have no clue where to start... I'm not a total newbie in programming, but I have no clue how reverse-engineering a firmware is done. Nonetheless, I'll try my best to get that working :P
Title: Re: Cowon D2
Post by: preglow on September 28, 2010, 02:34:17 PM
Hello there! can I an any way help with getting Line-in working? That feature is really important for me, but I have no clue where to start... I'm not a total newbie in programming, but I have no clue how reverse-engineering a firmware is done. Nonetheless, I'll try my best to get that working :P
I'm actually kinda working on this at the moment. Line in seems to be what is connected to the audio interface by default, so it should just be a matter of configuring the 7801 correctly and writing interrupt handlers. Making the builtin mic work will require some disassembly work to figure out where the input select multiplexer is connected.
Title: Re: Cowon D2
Post by: tails_ on October 07, 2010, 01:05:54 PM
Hi. I have 8GB D2+ and have 2 small issues:

1. Charger status is always absent
2. touchscreen problem:
    then you touch screen near edges it detects touch first in that place and then upper\lefter\downer\righter for about 15-30 pixels

P.S. Is USB mode still being developed?
Title: Re: Cowon D2
Post by: motorbit on October 28, 2010, 07:11:41 AM
hi, i just updated my rb to r28368 because my old installationd coul not read from the memory disc rb was installed to after it started from that disc flawless.

anyway, i do have some nasty problems with the new verstion.

the most annoying one is related to volume controls.

with most tracks, volume control will work fine
with some tracks, volume controls are a bit disturbed, like with some sudden balance l/r and / or volume jumps.
with some tracks, volume +/- wont do anything. going to settings -> sound settings -> volume and changing the volume there will reliable make my touchscreen inresponsive so ill have to restart the player to fix this.

a second problem is, that sometimes when i try to start rb ill get an checksume missmatch error and rb shuts down immidiately.
in this cases, ill have to copy over a fresh rb install to fix it.
this problem occours often after i booted into the original fw and have had a database  rebuild there.

Title: Re: Cowon D2
Post by: Ton on November 01, 2010, 09:14:45 AM
(I also posted this message in the iaudiophile forums, but have not found a solution yet)

Today, after not haven't used my Rockboxed D2+ for some time, I installed the latest version of Rockbox on the SD card. To my surprise however, every now and then my player doesn't boot properly. I see the Rockbox screen for a few seconds and then my screen turns bright and is frozen. I can only use the reset button then and start again. One time it does boot then, but another time I get the same problem. It is very randomly. I didn't have this problem before. Until the last time I used the player ( a few months ago) everything was o.k.
To exclude that it has to do with the SD card, I also tried another card but same problem.
When Rockbox does boot properly I see a short "flash" between the initial Rockbox screen and the final screen. I don't know if this is normal.
What could be wrong or what could I be doing wrong ?
FWIW, I have FW 3.13 installed.
Title: Re: Cowon D2
Post by: Bazirker on November 02, 2010, 01:07:09 AM
(I also posted this message in the iaudiophile forums, but have not found a solution yet)

Today, after not haven't used my Rockboxed D2+ for some time, I installed the latest version of Rockbox on the SD card. To my surprise however, every now and then my player doesn't boot properly. I see the Rockbox screen for a few seconds and then my screen turns bright and is frozen. I can only use the reset button then and start again. One time it does boot then, but another time I get the same problem. It is very randomly. I didn't have this problem before. Until the last time I used the player ( a few months ago) everything was o.k.
To exclude that it has to do with the SD card, I also tried another card but same problem.
When Rockbox does boot properly I see a short "flash" between the initial Rockbox screen and the final screen. I don't know if this is normal.
What could be wrong or what could I be doing wrong ?
FWIW, I have FW 3.13 installed.


I'm having a similar problem, where I had an older version for a long time with no trouble and the new release is breaking it.  For me, it will sometimes boot correctly but other times will go from the rockbox bootup screen to a black (blank) screen and will stay frozen until it either decides to let me reboot it (also happens in a random period, sometimes is seconds, sometimes is never) or until I plug it into USB.  I have an original D2 but it's running D2+ firmware 2.13.  I am running rockbox from an SD card, but have been doing that for some time now with no problems.
Title: Re: Cowon D2
Post by: mbk1969 on November 02, 2010, 07:48:32 AM
Guys, try this version http://www.megaupload.com/?d=41QHGF6S  from shotofadds` post http://forums.rockbox.org/index.php?topic=10164.msg171379#msg171379
Title: Re: Cowon D2
Post by: Ton on November 02, 2010, 08:35:54 AM
Thanks mbk1969.
The link you provide seems to be the version 1 in shotofadds post, whereas I understand from that post that version 2 is the one that works correctly.
Am I right and should I try the other one, version 2 ?

Btw, I luckily had a backup of the version I used before (r24332-100124) and everything is fine now again. However with that old version I cannot use a lot of new skins.

Update: I tried both versions meanwhile.
-Version 1: 25 boots, no problem, working fine
-Version 2: 15 boots, 3 times bright screen and freezing
So it is version 1 I need apparently and accordingly to your reply above.. That would be contrary to the post that you linked to. Am I right ?


Title: Re: Cowon D2
Post by: motorbit on November 02, 2010, 07:07:34 PM
thank you, mbk1969

both versions refused to start as soon as /.rockbox/tagnavi_custom.config was present. modified tagnavi.config works fine.
database still is pretty slow with my monster 200+ tracks albums, but i guess its the weak d2´s processors fault and i can live with that one.

v2
-refused to start up once, showing me some thin, horizontal, fast up and down moving white lines on a black background. had to use the reset button to restart.

-when increasing / decreasing volume, sometimes i will have one speaker muted. upping/downing volume for just one press always fixes it, and muting wont come back when i undo the last change. this happens quite regularly, like 2 -3 times when upping from  -70 to -15
note: this is NOT the new muting i had with the newer rockbox builds. i always have had this phenomena happening with rb, ever since i first used it and its not a serious problem at all for me.
aside of this, this version running fine.


v1
i didn't tested it long enough to be sure but it seemed to work correct.
anyways,  from all i read persistent muting issue may not be fixed with this version.

ill test v2 for 1 more day, than i will change to  v1 for  2 days  (or until i run into serious problems).
i will report back than.
Title: Re: Cowon D2
Post by: mbk1969 on November 02, 2010, 07:31:35 PM
Sorry, I missed the link - supposed to give the link to version 2 because it works fine on my D2+. And I am glad that you`ve tested both versions. Best practice ever! =)
Title: Re: Cowon D2
Post by: franky on November 04, 2010, 04:03:22 AM
Same for me. I compiled yesterday the latest svn tree (r28478) but after the booting screen the D2 just froze. Not always, but maybe 3 out of 4 times or so. v1 doesn't do that for me, i haven't tried v2.

===EDIT===
Removing MCFG |= 1 helped, i could run my own compiled version now.

Concerning the question whether V1 or V2 is eabi... I do use my own bootloader which was compiled with eabi. Is this maybe the key why some people can run v1 and others v2 without problems?
Title: Re: Cowon D2
Post by: Josef K. on November 05, 2010, 01:54:07 PM
I flashed my new D2+ with RB yesterday & I can confirm new build issue (after star screen D2 froze). V1 works fine for me, I didn't test v2.

First of all: BIG THANK YOU all involved, original FW is just pathetic and Rockbox totally supersede it.
(I'm familiar with RB for a long time running it on my X5L)

I've got one question:
I can't get how to set up time in Rockbox. In original FW I sat up the right time, but RB got different one and I can't find the way to solve this. Maybe it isn't implemented yet? According to the shotofadds post on iaudiophile forum time should work...
Title: Re: Cowon D2
Post by: mbk1969 on November 05, 2010, 03:37:57 PM
system->time & date
Title: Re: Cowon D2
Post by: Josef K. on November 05, 2010, 05:02:47 PM
system->time & date
:-[ I am stupid, I was looking for it at settings/general/system...  :-[ Thanks a lot! ;D
Title: Re: Cowon D2
Post by: Ton on November 09, 2010, 01:04:42 PM
Hey, it seems that the latest build for the D2, r28538, works fine again.
I booted 25x subsequently and no bright or black screens and no more freezing.

Title: Re: Cowon D2
Post by: reloadead on November 10, 2010, 05:41:02 AM
Hi everyone,

First of all : congratulations to all developpers for this great software, it really boosts my cowon D2 functionnalities.

My comment about Ton's problem : I had the same annoying bug since a few versions of rockbox, my player started and then a black screen appeared. I had to restart it three or four times so as it eventually worked. This morning I installed a new build 28546 and tried it a couple of times : no problem at this time, everything seems to be ok, no flash, no black screen anymore.

Don't know in which build It was corrected (can a developper tell me that ?) but it seems fixed.

Thanks again, in the name of all Rockbox users !

Title: Re: Cowon D2
Post by: motorbit on November 19, 2010, 07:02:38 PM
dunno...
still having some major problems aside from not booting up sometimes.

worst for me:
when playing high bit rate ogg´s (500kbps)  will make the volume control irresponsible with enabled equalizer. this is happening with all recent versions, and with both r2800 versions.´m pretty (but not 100%) sure this problem was *not* introduced when the latest codec optimizations of r24XXX. i rather guess this problem may have been introduced when the volume range was increased to -90db.

i think there may be one other (not to serious) problem  that  could be common to all never versions that lead to hard crashes of rb so the player has to be reseted with the reset-button. this happens verry rarely, and so far i was unable to provoke this bug reliable but plugging or unplugging the usb connection seems to trigger it.
Title: Re: Cowon D2
Post by: helloworld1 on November 24, 2010, 07:42:42 AM
nov 23's build crashed when using fm radio and shows only white screen after booting.
Title: Re: Cowon D2
Post by: Demonrage on November 27, 2010, 12:57:36 PM
hi just wondering, how's the issue with potentially losing an sd card to rockbox with the d2 now? someone told me the chances are slim to none but i wanna make sure before i load anything on my 8gb sd
Title: Re: Cowon D2
Post by: mad on November 28, 2010, 10:19:22 PM
hi just wondering, how's the issue with potentially losing an sd card to rockbox with the d2 now? someone told me the chances are slim to none but i wanna make sure before i load anything on my 8gb sd
I don't think there is any danger now. I've been using it with a 32GB sandisk
Title: Re: Cowon D2
Post by: Josef K. on November 30, 2010, 04:42:21 PM
hi just wondering, how's the issue with potentially losing an sd card to rockbox with the d2 now? someone told me the chances are slim to none but i wanna make sure before i load anything on my 8gb sd
I use A-DATA Secure Digital 32GB Turbo SDHC Class 10 without any problems  :)
Title: Re: Cowon D2
Post by: othalan on December 05, 2010, 12:07:44 PM
Reading through this thread it appears the D2 development is more or less dead.  Is that still the case?

I am happy with the current functionality, but would like a few additional features.  I am even willing to write the code myself!

Of most interest to me is adding support for using the built-in mic.  Can you give me an overview of what work needs to be done to be able to record from the built-in mic?

Title: Re: Cowon D2
Post by: Demonrage on December 11, 2010, 04:02:13 PM
Reading through this thread it appears the D2 development is more or less dead.  Is that still the case?



that's what it seemed like to me. Front page for the d2 still says "user has been warned!!" about sd cards. I'm surprised yet still wary since the last posters on here sd they are using 32 gb sd cards running rockbox. Still teetering though cause the d2's eq is pretty decent and i love the flash skins and flash support.
Title: Re: Cowon D2
Post by: kfoltman on December 17, 2010, 05:55:13 PM
The audio output seems to fail randomly on this 2GB D2, either on startup or later - and the only way to reenable it is booting the original firmware.

The MP3 decoding etc. seems to continue running (at least the plugins like the oscilloscope/spectral analyser seem to imply that), there's just no output.

Is that a known bug?
Title: Re: Cowon D2
Post by: saratoga on November 14, 2011, 06:08:20 PM
Test build for the D2 with FS#12352 included:

http://duke.edu/~mgg6/rockbox/rockbox+fs12352.7z

Would be very interested to know if it works on the D2(non +) before I blind commit it. 
Title: Re: Cowon D2
Post by: nick_p on November 15, 2011, 09:53:42 AM
Test build looks good on the original D2;

 - Still plays!
 - Detects both USB & dedicated charger.
 - Charging in RB appears to register greater current when checking before & after in OF.
 - Car mode detects both chargers and plays/ pauses on insertion/ extraction.
 - After charging in RB, charger still recognised in OF (phew).
Title: Re: Cowon D2
Post by: zaq1 on November 16, 2011, 03:13:27 AM
Yep, it works.

Why on the few latest builds the menu only shows 3 items at a time?
With huge spaces in between...
Title: Re: Cowon D2
Post by: nick_p on November 16, 2011, 06:55:42 AM
I think it's to make selecting menu items in Absolute Point touchscreen mode easier (though I don't know why this is on by default and that is off).

You can fix it with Settings > General Settings > Display > Touchscreen Settings > Line Padding in Lists > Off

Or add the following to config.cfg

list padding: off
Title: Re: Cowon D2
Post by: zaq1 on November 16, 2011, 07:59:09 AM
Excellent! Nice easy fix... ;D
Title: Re: Cowon D2
Post by: zaq1 on December 05, 2011, 05:41:17 AM
Whats wrong with the latest current build for D2? The RB logo shows up for 3 seconds then the player just switches off...
It will start eventually but it may take 20 tries. Also it goes thru the battery like crazy. Usually full charge would go for days, with the new CB it only lasts about 1/3 as long.
Title: Re: Cowon D2
Post by: Tigerite on September 28, 2012, 05:05:04 AM
I am keen to restart development on the D2 rockbox port - however, I can't build the latest version with --no-eabi (the VirtualBox image doesn't install the 4.0.3 gcc any more and I don't know if it's possible to disable in 4.4.4). This is necessary because the current build still has the problem of audio not working sometimes or being garbled, and taking several seconds to boot - it was even freezing altogether at times, though this issue seems to have been resolved by compiling the bootloader (with EABI).

Can anyone give me some pointers as to where to start? I tried to get the D2 emulator to work as well, but can't figure out how to get a dump of the NAND. Would Debian nanddump suffice (it can include OOB data)?
Title: Re: Cowon D2
Post by: gevaerts on September 28, 2012, 05:13:28 AM
You should be able to get an older rockboxdev.sh to build the pre-eabi toolchain
Title: Re: Cowon D2
Post by: Tigerite on September 28, 2012, 05:48:35 AM
I tried to follow the manual instructions at http://www.rockbox.org/wiki/CrossCompiler but binutils wouldn't build, I had a stack trace error. Mind you, those look pretty out of date, so maybe using a previous version of the shell script is a better option - I'll have another bash at it.

Ideally, I'd like to find out what is causing the EABI build to have the problems, as I think long-term it's got to be the better solution, but I don't really know where to start on that..
Title: Re: Cowon D2
Post by: saratoga on September 28, 2012, 09:23:32 AM
The  pre eabi version of roxkboxdev.sh should work fine. We all used it back in those days.
Title: Re: Cowon D2
Post by: Tigerite on September 28, 2012, 05:08:53 PM
Well, I got binutils to compile but gcc is another matter, as http://www.rockbox.org/gcc/rockbox-multilibs-arm-elf-gcc-4.0.3_3.diff seems to no longer exist.. does anyone happen to have a copy? Google threw up a blank, I'm afraid..

EDIT: Never mind, found it in the tracker: http://www.rockbox.org/tracker/task/10436?getfile=20040
Title: Re: Cowon D2
Post by: bluebrother on September 28, 2012, 06:46:58 PM
The patches are also available in the www git repository: http://git.rockbox.org/?p=www.git;a=tree;f=gcc

Looks like version 3 of that patch was forgotten though (which is a bit strange if rockboxdev.sh used it)
Title: Re: Cowon D2
Post by: Tigerite on September 29, 2012, 12:17:56 PM
Thanks for all the help, I managed to get the latest rockbox to compile with --no-eabi! I had to change lib/rbcodec/dsp/eq.c slightly though as gcc 4.0.3 is fussier than 4.4.4 - it was giving me an "initializer element is not constant" error. Does the below seem sane, I've never been too hot when it comes to C++ pointers?

Code: [Select]
--- a/orig/rockbox/lib/rbcodec/dsp/eq.c
+++ b/dev/rockbox/lib/rbcodec/dsp/eq.c
@@ -75,9 +75,9 @@ void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting)
                                                  unsigned long Q, long db,
                                                  struct dsp_filter *f) =
     {
-        [0]                    = filter_ls_coefs,
-        [1 ... EQ_NUM_BANDS-2] = filter_pk_coefs,
-        [EQ_NUM_BANDS-1]       = filter_hs_coefs,
+        [0]                    = &filter_ls_coefs,
+        [1 ... EQ_NUM_BANDS-2] = &filter_pk_coefs,
+        [EQ_NUM_BANDS-1]       = &filter_hs_coefs
     };
 
     if (band < 0 || band >= EQ_NUM_BANDS)
@@ -98,8 +98,8 @@ void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting)
 
         /* Convert user settings to format required by coef generator
            functions */
-        coef_gen[band](0xffffffff / NATIVE_FREQUENCY * setting->cutoff,
-                       setting->q ?: 1, setting->gain, filter);
+        (*coef_gen[band])(0xffffffff / NATIVE_FREQUENCY * setting->cutoff,
+                          setting->q ?: 1, setting->gain, filter);
     }
 
     if (mask == eq_data.enabled)

I believe the last change isn't strictly needed, as the compiler should figure it out anyway, but I decided to err on the side of caution (and clarity)..
Title: Re: Cowon D2
Post by: Tigerite on September 30, 2012, 02:57:11 PM
I spoke too soon.. although the firmware compiles fine under 4.0.3 and binutils 2.16.1, the codecs don't; libtremor has lsl instructions which 2.16.1 doesn't like. I tried instead to use 2.20.1 but that causes problems in mod.c with "relocation truncated to fit: R_ARM_PC24" errors. So now I'm a bit stuck really..
Title: Re: Cowon D2
Post by: saratoga on September 30, 2012, 03:08:54 PM
What was compiling a current build with the old compiler going to accomplish exactly?  I don't see that its really worthwhile if you're trying to troubleshoot a problem in the audio driver. 
Title: Re: Cowon D2
Post by: Tigerite on September 30, 2012, 04:47:05 PM
My reasoning was that, back on page 59, shotofadds managed to fix the problem of audio either not working or only coming through one channel (and that's with a much older release than the current) by building with the --no-eabi option. The problem is that this issue only happens intermittently - and it's still occurring with the firmware built with the older gcc and binutils, so it must be something in the codecs. If it was every time then I'd have at least a fighting chance of finding the problem..
Title: Re: Cowon D2
Post by: saratoga on September 30, 2012, 05:26:33 PM
My reasoning was that, back on page 59, shotofadds managed to fix the problem of audio either not working or only coming through one channel (and that's with a much older release than the current) by building with the --no-eabi option.

Yeah, but once you got that to compile, how would that help you actually solve the problem?
Title: Re: Cowon D2
Post by: phr on November 02, 2012, 03:20:36 AM
I'm glad to see renewed interest in the D2 port.  The D2 is really excellent hardware and crappy OEM firmware.  It's compact, has good audio, long battery life, relatively easily replaceable battery, and a full sized SD slot that's known to accept 128GB SDXC cards (though there is apparently some trouble using them with rockbox).  This feature has gotten more interesting very recently, with the introduction of 256GB cards from Lexar (available from bhphoto.com though very expensive, at least for now).  I still use my D2 regularly.
Title: Can powering off while charging be enabled?
Post by: v0rtex99 on February 25, 2013, 11:26:43 AM
Hello All,
Not sure if this is the correct place to discuss new features for Rockbox on the D2, but I have an addition that would really make my day. I have two D2+ players and I would like to use one with my home stereo as my full time music player. For this to work easily I would like to have the player plugged into a USB power adapter all the time so I don't have to worry about it being charged. The only catch with the way Rockbox works on the D2+ now is that the player can't be turned off when charging. So on to my question, would it be possible to enable turing off the player while using Rockbox and charging?
Thanks so much!
Title: Re: Cowon D2
Post by: saratoga on February 25, 2013, 12:09:10 PM
Probably not.
Title: Re: Cowon D2
Post by: [Saint] on February 25, 2013, 12:29:57 PM
It would be fairly trivial to wire a USB cable with a switch on the power lines. That would work for your uses if I understand correctly.
Then, you could also use the car adapter mode which automatically pauses playback and shuts down after the idle timeout period when no power is detected, and wakes the device and resumes playback when power is detected.

This seems like it would be a good, albeit fairly hacky, semi-solution (obviously the device will only be charging when it's on, as opposed to full-time, but this should be sufficient as long as the USB port is providing the full 500mAh) to your problem.


[Saint]

EDIT: If you wanted to get really geeky, there are in-line switches out there that can take input from a programmable IR remote.
*EDIT 2: Bums... it seems car adapter mode functions from DC alone, and not USB.
Title: Re: Cowon D2
Post by: phr on April 10, 2013, 02:16:19 AM
If anyone cares, a new version of the D2 has been announced, called the D20.  It may be different enough internally to not be able to run the D2 Rockbox port, but it looks similar on the outside.  Some info is here and there is also an anythingbutipods thread:

http://iaudiophile.net/forums/showthread.php?t=41643

Title: Re: Cowon D2
Post by: niggle on April 28, 2015, 01:28:13 PM
Hi everybody!
Is anyone with this problem since one year maybe??
(http://1.bp.blogspot.com/-5OX_7NQ7Vb0/VLkZs0zQk7I/AAAAAAAABJo/uaV_9ap5V3Q/s1600/panic.jpg)
It makes me very unhappy not be enjoying the last builds...
Please help!

Cheers!
Title: Re: Cowon D2
Post by: cereal_killer on April 28, 2015, 02:24:20 PM
Hey niggle,

there are already reports of that problem. See:
Hello wilkes5,

I also get the panic message on my D2+, but it seems, that the latest builds are buggy. I have no problems with 3.13.

The mesage is: *PANIC*
dc_writeback_callback () - Could not write to sector 81 93 (error -1)
pc: 2005C064 sp:200B3228
bt end

I have talked about that to pamaury on IRC and he kindly tried to help and even provided a test build, but no luck.

Maybe someone can have a look at this problem too?

Greetings,
c_k

I hope this bug gets fixed soon.
Title: Re: Cowon D2
Post by: niggle on April 28, 2015, 03:21:13 PM
Thank you cereal_killer!

We'll wait...

Title: Re: Cowon D2
Post by: andiator on April 23, 2016, 06:28:41 PM
Well, it's been a while since my last visit here :)

Last days I compiled and installed the latest version, with the known panic error.
After some playing around it seems to be a problem with writing or creating files. The first one is "nvram.bin".
(I added only view logf outputs)

Code: [Select]
fat_create_file("nvram.bin",200F01E4,200F0234)
cache_commit()
dc_commit_all()
dc_write_callback() ---> *PANIC*
After that  "nvram.bin" has been created with zero size.

The next start:
Code: [Select]
dc_cach_probe()
dc_write_callback() ---> *PANIC*

If I copy this file from the old installation, the D2 doesn't crash at start, but trying to change a setting, play a music file or at power off it crashes.
Then an empty "config.file" is created, but the settings are not saved.

Copying ".playlist_control" and "config.cfg" seems to be a workaround for this crash. The changed settings and the playing position are NOT lost, so the writing does work. But it still crashes at the power off.

I hope this info can help to find the problem, I can only provide more logf information and test the changes, since I have no idea how the file system works.

P.S.
In the storage.c in the function storage_write_sectors() this piece of code is called:
Code: [Select]
#if (CONFIG_STORAGE & STORAGE_NAND)
    case STORAGE_NAND:
        return nand_write_sectors(IF_MD(ldrive,)start,count,buf);
#endif

NAND? I thought it is RO (read only) on D2 because we not really understand the anti wearing algorithm. Is that the cause for the *PANIC*?

Greetings,
Andiator
Title: Re: Cowon D2
Post by: A11A on December 20, 2019, 05:56:35 AM
Is anyone still interested in the D2? I'm considering fixing, or at least creating workarounds for, what handful of major issues are currently present.

As a workaround to crashing on newer builds: if you wipe the partition table of internal storage so that only your SD card is available to Rockbox, it will stop it from crashing, however, if you boot back up into stock firmware it will format internal storage and cause Rockbox to crash again. Formatting internal storage as something Rockbox doesn't support will likely also work, but its also still likely that booting stock firmware will still cause it to be reformatted back to FAT32.
Title: Re: Cowon D2
Post by: cereal_killer on December 20, 2019, 11:26:42 AM
Hello A11A,

great, that you are also interested in fixing the D2 builds. I think, that if Rockbox on the D2 would completely run on SD card (by disabling the internal storage in Rockbox), the problems of Rockbox not being able to write to flash would be gone. You could then still use the OF. Check this thread for mor information:

http://forums.rockbox.org/index.php/topic,51522.0.html

Greetings
c_k
Title: Re: Cowon D2
Post by: A11A on December 20, 2019, 02:47:53 PM
I was thinking of doing that exact thing saratoga suggested, it shouldn't take much to do so, you just need to get Rockbox to mount the sdcard first and treat it as if it's internal storage.

In regards to writing to NAND, a driver without wear leveling could be implemented with writing disabled by default and a warning about potentially damaging your NAND if you decide to enable it. In regards to wear leveling, would this Linux kernel released by telechips be of any use? https://github.com/cnxsoft/telechips-linux

Now if only I can get a toolchain to compile, having issues due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90677 and I'm getting a weird segfault on gcc 8.3.0. Going to try using 4.9.3 next.
Title: Re: Cowon D2
Post by: Milardo on December 20, 2019, 02:52:04 PM
I was thinking of doing that exact thing saratoga suggested, it shouldn't take much to do so, you just need to get Rockbox to mount the sdcard first and treat it as if it's internal storage.

In regards to writing to NAND, a driver without wear leveling could be implemented with writing disabled by default and a warning about potentially damaging your NAND if you decide to enable it. In regards to wear leveling, would this Linux kernel released by telechips be of any use? https://github.com/cnxsoft/telechips-linux

Now if only I can get a toolchain to compile, having issues due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90677 and I'm getting a weird segfault on gcc 8.3.0. Going to try using 4.9.3 next.

Hi, l'd like to ask, is the cowon m2 similar to the cowon d2? I read somewhere on this forum that it maybe possible to convert the d2 port to m2?
Title: Re: Cowon D2
Post by: A11A on December 20, 2019, 03:29:28 PM
Hi, l'd like to ask, is the cowon m2 similar to the cowon d2? I read somewhere on this forum that it maybe possible to convert the d2 port to m2?
This isn't really where you should be asking, but if you want to help get an M2 port going you should probably collect info about the M2 into a wiki page similar to https://www.rockbox.org/wiki/CowonD2Info from threads like http://forums.rockbox.org/index.php?topic=50936.0 and then start a thread like this one for that device.
Title: Re: Cowon D2
Post by: A11A on December 20, 2019, 07:27:24 PM
If anyone wants to run Rockbox off an SD card only to stop crashes, here's a quick patch to disable mounting NAND
Code: [Select]
diff --git a/firmware/export/config/cowond2.h b/firmware/export/config/cowond2.h
index d4623381fc..1d94e9a93a 100644
--- a/firmware/export/config/cowond2.h
+++ b/firmware/export/config/cowond2.h
@@ -58,10 +58,11 @@
 /* define this if you have a flash memory storage */
 #define HAVE_FLASH_STORAGE
 
-#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
+//#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
+#define CONFIG_STORAGE (STORAGE_SD)
 #define HAVE_MULTIDRIVE
 #define HAVE_HOTSWAP
-#define NUM_DRIVES 2
+#define NUM_DRIVES 1
 
 #define CONFIG_NAND NAND_TCC

EDIT: I just found out that this exact same patch came up 2 years ago in a different D2 thread
Title: Re: Cowon D2
Post by: cereal_killer on December 21, 2019, 07:32:07 AM
If anyone wants to run Rockbox off an SD card only to stop crashes, here's a quick patch to disable mounting NAND

Thank you A11A. I have been recently thinking of playing with my D2. As I have more files than the OF will accept and I'd like to use the OF too sometimes, I'll partition the SD card to hide most of the files from the OF. Will this patch work with this setup?
Title: Re: Cowon D2
Post by: burkjavier on December 21, 2019, 11:55:29 AM
I'd certainly test any new builds out.  My D2 doesn't get a heck of a lot of use these days, but it's running the last build I had created (last year I guess).   Probably about due for a refresh.

Title: Re: Cowon D2
Post by: niggle on December 21, 2019, 05:46:26 PM
I'm interested, and I can test too.
Long live the D2!
Title: Re: Cowon D2
Post by: A11A on December 21, 2019, 07:27:49 PM
Here's a build, latest dev version as of this post, with internal storage disabled.
Usual disclaimer applies, I'm not responsible if your player explodes, burns your house down, starts WW3, etc.
https://ipfs.io/ipfs/QmZX79WhrjMYXY9z4NV8wqoN5oN9jrvW9emm7igvJXXUbk

EDIT: Here's a second extremely experimental build with NAND access enabled and a workaround for crashing: https://ipfs.io/ipfs/QmRBJEiwF7KsdX5Dy1eezufH64jpvDeMFd5zgcjcSsN5pZ

edit again: forgot to include the experimental patch
Code: [Select]
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index 73d92a5215..71cc7c5f81 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -867,7 +867,8 @@ int nand_write_sectors(IF_MD(int drive,) unsigned long start, int count,
     (void)start;
     (void)count;
     (void)outbuf;
-    return -1;
+    //return -1;
+    return 0;
 }
 
 #ifdef HAVE_STORAGE_FLUSH
Title: Re: Cowon D2
Post by: niggle on December 22, 2019, 01:41:47 PM
no more *PANIC* with any of these builds!
Title: Re: Cowon D2
Post by: A11A on December 23, 2019, 02:37:45 AM
Well, I tried turning on USB support and quickly figured out why it's not on by default. It's too slow to be usable and usually hardlocks your entire player.

Other than those write-related panics, USB being entirely non-functional, are there any other major issues specific to D2 builds? I've noticed some minor annoyances like battery being inaccurate.

A quick explanation of that NAND workaround: what that build with NAND enabled does is essentially pretend it's written data to NAND even though it hasn't, rather than returning a failure when it tries, so it appears as if you can make changes even though you can't and they're not saved.

Also, a sidenote regarding builds/links I post that are on IPFS, IPFS (https://ipfs.io/) works somewhat like bittorrent and I'd recommend installing ipfs-desktop (https://github.com/ipfs-shipyard/ipfs-desktop) along with ipfs-companion (https://github.com/ipfs-shipyard/ipfs-companion) then re-downloading them once those are set up so that you keep a local cache of those builds on your machine that gets served to others, otherwise they could disappear if my node is offline and nobody has downloaded them from a gateway in a while. There's also a way to keep things locally stored permanently but explaining how to do so is out of the scope of a forum post here.
Title: Re: Cowon D2
Post by: niggle on December 23, 2019, 05:27:24 AM
A11A, thanks for your work!!  :)
Title: Re: Cowon D2
Post by: A11A on December 23, 2019, 05:41:28 AM
I wonder if that one line hack in the NAND code is good enough to add upstream, since right now D2 builds are completely broken without it.

Also, I was messing around with espeak a bit and got this, so here's some Caribbean Stephen Hawking-esque voice files for my build too if wanted [english gb and us]: https://ipfs.io/ipfs/QmaDMnHpntdzpdXX633NFfCPiQkUHsuK9zyQTp3G86281R/
Title: Re: Cowon D2
Post by: cereal_killer on December 27, 2019, 06:37:40 PM
I wonder if that one line hack in the NAND code is good enough to add upstream, since right now D2 builds are completely broken without it.

If I understand saratoga and Bilgus in that thread right (http://forums.rockbox.org/index.php/topic,51522.0.html) this should be commitable. Maybe the D2 will be a stable port then.

I'll test your buidl and will give feedback. Thank you!

By the way: is anyone interested in themes and flash skins for the D2/D2+? I gathered over 100 over the last years and I am happy to share them.
Title: Re: Cowon D2
Post by: A11A on December 27, 2019, 10:43:10 PM
Maybe the D2 will be a stable port then.
Definitely not, it would need proper write support and probably recording support too.
Right now it should technically be classified as an "unusable" port because it doesn't actually work out of the box at all, the tiny change to how NAND writes return would bump it back to an unstable build as it functions but lacks features.

By the way: is anyone interested in themes and flash skins for the D2/D2+? I gathered over 100 over the last years and I am happy to share them.
Might be a good idea to archive those somewhere, perhaps using IPFS, I can walk you through setting up IPFS if you need help, just message me.
Title: Re: Cowon D2
Post by: raidraid on May 05, 2020, 07:28:08 AM
Shouldn't this code of "panic" solution be added to repository? In my opinion it is better to have at least normal working playback in future than have nothing.
Title: Re: Cowon D2
Post by: speachy on May 24, 2020, 07:38:56 AM
I just committed the NAND-disabling patch, see ea9ed2f9e8.

Title: Re: Cowon D2
Post by: gargoyles2 on December 18, 2023, 03:06:24 PM
I also sometimes hit the Menu button by accident when controlling the volume using the buttons, and it gets to the menu. When the DAP is in your packet, it is very annoying to open it and return to WPS. Do you think we should disable this button while in WPS?
If you meant the MENU button then NO!

do you have the plugin to dump the eeprom.bin of cowon d2? and the eeprom file?
Title: Re: Cowon D2
Post by: gargoyles2 on December 19, 2023, 02:00:35 PM
I just committed the NAND-disabling patch, see ea9ed2f9e8.

do you have the datasheet of cowon d2? i am learning about it
Title: Re: Cowon D2
Post by: gargoyles2 on December 19, 2023, 02:01:26 PM
I just committed the NAND-disabling patch, see ea9ed2f9e8.

do you have the datasheet of the tcc7801 of the Cowon d2? I am learning about it