CDRInfo Forum CDRInfo Forum

Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

Badly Need Help for Packet Writing Steps   Logged in as: Guest
Viewers: 1317 You can click here to see Today's Posts | Most Active Topics | Posts Since Last Visit
  Printable Version
All Forums >> [Optical Storage Software] >> CD/DVD Authoring >> Packet Writing >> Badly Need Help for Packet Writing Steps Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
Badly Need Help for Packet Writing Steps - 7/21/2003 4:28:47 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Hi All group!
Finally I reached a point , where I could get help about Packet Writing. I am doing a project for Packet Writing using C++. Let me Tell u Where I am ?I am using GCE-8041B CDRW of LG.
I studied INF-8090 ,INF-8020 and that Philips 3610 Document
I am following exactly same procedure as specified in those documents.

1) I first try to sense Write Page Parameters by MODE SENSE command
with options to have Current Values of Write Parameters Page
with page id =0x05.
2) After this I try to change Those parameters for Packet Writing as
specified in INF-8090 and other Docs.
3) I think Here problem lies when I change those parameters
4) After Changing those parameters, When I Update those parameters to
CDRW Drive by MODE SELECT COMMAND. When I provide Complete 52
bytes of Write Parameters Page, It always give status register 0x51
and Error Register as 0x51H.

I will not be able to call WRITE Command until I donít get that
Error register to 00 and Status Register CHECK bit Low.
I have tried many permutation of Setting Write Page Parameters But
of no use.

I am badly in need of Some Gurus Help which could provide me with Some Sample Source Code that has complete Sequence of Steps for
FIXED size Packet Writing or Any Hint in problem. I can also provide Source COde I am Using if U require.

A Bundle of thanks in advance.

Regards

Shazi Phil


Post #: 1
RE: Badly Need Help for Packet Writing Steps - 7/21/2003 8:00:00 PM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
Hello dear competitor :-)

What are you doing exactly: MRW or legacy packet-writing? R or RW packet writing? If RW, is your media formatted, and with which options? Can you provide dump of the bytes returned by your device to the mode sense of page 05h and dump of the bytes you want to set with mode select?


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 2
RE: Badly Need Help for Packet Writing Steps - 7/21/2003 9:52:17 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
First of All, A Lot Lot of thanks for the Help.
Second , belief me, I am doing a project for just my hobby.
You have asked Question?
Yes CD is CDRW.
CD is formatted using Nero/InCD really?That thing really made me happy when I saw ur detail that U are project Manager of Nero/InCD.
I will be really thankful to u if u send me any sample Code/Document.
Regards
Shaziphil
The Dump is

//////// Identify Result Data of Identify is as Follows...

H L - D T - S T G C E - 8 4 8 1 B

// Calling Sense Mode and Select Mode Out put

Printing Sense Mode Parameters Data that Read.

Registers Are

Data=00

ATAPI Error=00

ATAPI Interrupt reason=02

Reserved=01

ATAPI #Bytes low=52

ATAPI #Bytes high=0

Drive select=A0

ATAPI status=58



Ready for data transfer of Sense Mode Write Parametrs to Host...

No of bytes from CD-ROM as Write Mode Parameters are 52

...............

Printing Sense Mode Parameters Data that Read. ( With Bytes 0,1,2,,,,,,,,51)

0001 0000 0000 3205 0401 0008 0000 0000 0000 0000 9600 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000 0000 0000



Registers Are



Data=00

ATAPI Error=00

ATAPI Interrupt reason=02

Reserved=01

ATAPI #Bytes low=52

ATAPI #Bytes high=0

Drive select=A0

ATAPI status=58

Printing after Changing Parameters Data for Selct Mode Command

0532 0020 0000 3205 0001 0000 0001 0000 0000 0000 9600 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000 0000 2000

Going To Select Mode......

Ready for data transfer of Select Mode...

No of bytes To be xmt from Host to CD-ROM for Select Mode 52

Select Mode Completed ....

Status Registers After Sending Data Bytes

Data=00

ATAPI Error=54

ATAPI Interrupt reason=03

Reserved=01

ATAPI #Bytes low=0

ATAPI #Bytes high=0

Drive select=A0

ATAPI status=51




(in reply to Shaziphil)
Post #: 3
RE: Badly Need Help for Packet Writing Steps - 7/21/2003 11:54:13 PM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
There exist great software that at the beginning was just a hobby programming ;-)

By formatted media, I meant have you issue a Format Unit command prior to trying to set write parameters for this device?

Source code I will not provide. If you need help in C++ there are great places on the web like codeguru. But I highly recommand the usage of the MMC-spec (see drafts on www.t10.org a bit hard to read but a reference for scsi developers).

You are mis-using your mode sense buffer. Notice that you must have the beginning of the page you read been 05h 32h (page code 05h, page length 32h as your device is mmc-3 compatible). This is most likely the bytes "3205" (7-8) -> check for big/low endian, check when the mode page start within your returned buffer (there is a mode parameter header).

I forgot: good luck, you will need it fighting the scsi layer ;)


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 4
RE: Badly Need Help for Packet Writing Steps - 7/22/2003 12:16:23 AM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Thanks again dear for that great help!
I have studied and studied as far as bearable that mmc document.
It does not solve our problem with not at all stating about my problem.
I also doubted the same thing u mentioned that 05 032 case.
Can u bit elaborate at it?
Why I am not getting in the first two bytes of sense mode data and instead of that , I am getting 00 01?
Can u please tell me that it should be 05 032 etc or it is Okay?
Should I Explicitly use 0 and 1 byte of data to be sent as 05 and 32 or not?
I will be really thankful if you at least provide me with setting of ATAPI Command Bytes stting for Sense and Slect Mode and also some help on setting that 52 Bytes for Fixed Packet Mode 1 or Mode 2 Form data Writing?
I will be really thankful to u for this favour?
Regards
Shaziphil

(in reply to Shaziphil)
Post #: 5
RE: Badly Need Help for Packet Writing Steps - 7/22/2003 1:22:10 AM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
I suggest you to use busTrace to analyse you communication with the burner. It might be a bit expensive for non-professionnal purpose, but it makes mmc-stuff much more visual. Take a look at this screenshot for read toc command:

http://www.bustrace.com/bustrace/screenshots/readtoc.htm

With this tool you will be able to see in detail each of your command and bus-trace will plot your error in mal-formed scsi command.


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 6
RE: Badly Need Help for Packet Writing Steps - 7/22/2003 2:36:52 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Dear D Burg!
Thanks for that link. But problem is I am not rinventing the wheel?
:)
I mean I am not doing it with Windows/PC but with a simplest 8051 Microcontroller with a limited memory of 4-8K. That is the Challenge.
So I am using Keil 8051 IDE for programming and seeing results at hyper terminal.
Now please Please help me about that Write Parameters page Sensed Data.
I sent u dumps.. Please see there that I am not getting that Page number 0x05 and 0x32 i.e. Length at Bytes 0 and 1 postion but at differnt like 7th or 8th ? Is it Okay or a Problem?

Then I explictely set that 0 and 1st byte to Page Num 0x05 and Length 0x32? Is it Okay?
Please Guide me with How/What setting to be expected and what setting to be made for Packet Writing Mode Sense and Mode Select for those Write Parmaters Page Data and Command Buffers?
Please Be helping.. I will be really thankful to You for this favour.

Regards
Shaziphil

(in reply to Shaziphil)
Post #: 7
RE: Badly Need Help for Packet Writing Steps - 7/23/2003 12:53:38 AM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
>...with a simplest 8051 Microcontroller with a limited memory of 4-8K. That is the Challenge.

Yep, I think challenge is the good word. :-D But nothing impossible so far.

>Please see there that I am not getting that Page number 0x05 and 0x32 i.e. Length at Bytes 0 and 1 postion but at different like 7th or 8th ? Is it Okay or a Problem?

Yes, this is (nearly, see later) okay but you must understand why you get the start of the mode page there and not at bytes 0/1. It is because the logical unit does not just returns the mode pages, but a mode parameter header of 8 bytes followed by (an) optional block descriptor(s). The mode parameter header is of 8 bytes and the 2 last bytes contain the size of optional block descriptors (in bytes). Now, in your precise case there seems to be an error because you have only 6 of the 8 bytes of the mode parameter header (0001 0000 0000). This seems to be the last bytes of the mode parameter header, meaning that there is no block descriptor, and that after these 6 bytes begins the first returned mode page (3205... with an invert endian than your host).

I recommend to search what happen with the 2 missing bytes of the mode parameter header, this is not normal. But, this is a non-blocking issue.

Now that you know where your mode page starts, you can modify it, *taking in account that it does not begin at byte 0!*

>Then I explicitly set that 0 and 1st byte to Page Num 0x05 and Length 0x32? Is it Okay?

3 times not okay:

- Not okay because you must not move the position of the beginning of the mode page.
- Not okay because you must zero the 6 first bytes of the mode parameter header (that is, everything but the count of block descriptor(s) bytes). If they were block descriptors, you would have to zero the 5 first bytes of these. Fortunately there are none of them in this particular case.
- Not okay because you forget the endian difference between you (the host) and your device (the logical unit). You must write "32 05" instead of "05 32"


That should clarify a bit your problem, although I confirm that reading and setting the mode pages of a device is not the easiest thing on earth.


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 8
RE: Badly Need Help for Packet Writing Steps - 7/23/2003 8:12:41 AM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Hi Deburg !
that is really cool. the way you responded in deatil.. Bundle of thanks.
Now your suggestions, I changes a bit code for mode sense..
Now gives exact out put of
2100 0000 0000 0532 ... ..... .... ..... ...... 60(8+52) bytes
that is differnence now.
But real problem remains there?
First of all if 8 bytes are required for Header of Mode parms, then How I can I get this problem solved becuase there is no info available at LG site for this?
But I yet try to Select Mode with this result.. What I do is I dont make any changes to it and returns it to CDRW via select mode Command
with telling that I am sending 60 bytes in Command Block Packet and LBC and HBC ..
But it yet gives Error ... Invalid Parmeter in Parameters
This is really strange...
Should I explicitely shift positions of Sensed Data to make it start from Byte 9 as told by specs and thus provide it in proper formt whether this is doing or not?
Another Question is that if I get Slect Mode Success ( Pray from God for me :) and then If I give immediate request for Sense Mode for Same , Should I get Updated Values or not?
Last Question is If I get Success in Mode Select , Can I directly call Write 10 command for Fixed size Packet at CDRW or I have to do some other stuff too?
Dear D Burg ... Waiting for You response?
Regards
Shaziphil

(in reply to Shaziphil)
Post #: 9
RE: Badly Need Help for Packet Writing Steps - 7/23/2003 6:41:29 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Ahahhh!
Finally I got my Mode Select Successful.
Thanks and Thanks a lot for Your Nice Suggestion.
Now I am heading towards that PAcket Write.
but I am little confused about that Reserved and UnResrevd Methods and Specially to use Which of them Resreved or Unreserved
Fixed packet or Variable Packet...
Will like your Suggestions to Come So that I can have better understanding.
Any other Suggestion So that I can quickly get through !
But Once again and again thanks for those Suggestion..
If U guide me towards Write Success , I shall be thankful to u ?


Regards
Shazi Phil

(in reply to Shaziphil)
Post #: 10
RE: Badly Need Help for Packet Writing Steps - 7/23/2003 7:49:23 PM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
I highly suggest to do fixed packet writing. Much easier.

What exactly question are still waiting for a reply and which are already solved? (I'm a bit confused)


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 11
RE: Badly Need Help for Packet Writing Steps - 7/24/2003 12:50:29 AM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Thanks again for that suggestion.
Yes Me also concluded the same but was going for for variable. but i am changed mind and will go for packet writing?
I have few More questions whcih realy stuk me now?
1) How to get the LBA or Track where I can write.
2) Should I use reserve command to reserve a block/Track fro me?
3) Here is dump of Read Disc Info?
0020 1E01 0101 0180 2000 0000 0072 0029 FFFF FFFF FFFF FFFF 0000
0000 0000 0000 0000
4) This shows of a CDRW Disk that I formatted with InCD along with
LG? First IS it Okay that I formated the CDRW Disk with ur InCD
and now I am using this for Write with using my own Fromat
Command.. Will that be Okay or I will have to use my own Format
Command? I realy and badly this answer which?
5) Can I just Use Read Track Info after Success in Mode Select with
options of Track flage set to 1 and Track/LBA to 0xFF for Read
Track Info? Will that Work or I will have to Go othe way?
6) If I go for Fix Packet, Can I write just Data in Chunks of 2048
bytes? I shall to calculte/Provide Sync, Headre , Sub Header , EC or Drive will do it for me and I will have to just to provide 2048 bytes and Start LBA or Will have to provide all 2352 bytes?


I really will waiitng for You nice response to These Questions?
Regards
and Once gain Thanks and Bundle of Thanks
Regards
ShaziPhil




(in reply to Shaziphil)
Post #: 12
RE: Badly Need Help for Packet Writing Steps - 7/24/2003 9:14:11 PM   
sp


Posts: 1371
Joined: 3/30/2003
From: Falkland Islands
Status: offline
Sorry fellows for jumping in your interesting conversation. I am very glad for this taking place in this forum.

My suggestion to Shaziphil would be to try to do some burning programming under a "real" processor/OS first. Or perhaps try to follow parallel tracks. See what and how it works under windows (prototyping) and then try the same procedure under the particular IC.
Please go on your conversation, I am glad I can watch it here...
(Personally, I would not start such a project before devoting 1-2 months on reading the standards. BTW is there any NET component available out there? Preferable one written in C# with source code:-)


_____________________________

WM # CI

(in reply to Shaziphil)
Post #: 13
RE: Badly Need Help for Packet Writing Steps - 7/25/2003 4:06:24 PM   
dburg

 

Posts: 224
Joined: 6/10/2003
From: Germany
Status: offline
A good suggestion from sp

1) How to get the LBA or Track where I can write.

If you format your media for fixed packet writing using format unit command, there will be 1 single track on the media. This is the track you will have to write to.

LBA are address on the media. Basically, once you've formatted your media, you can write any LBA of the track (there only 1 track in our case). It will be up to the filesystem you choose to organize the available space. Of course I highly recommand usage of UDF

2) Should I use reserve command to reserve a block/Track fro me?

I don't think so. At least nothing like this exist in InCD 4. (Or there is one engineer doing code I've not seen.)

3) Here is dump of Read Disc Info?
0020 1E01 0101 0180 2000 0000 0072 0029 FFFF FFFF FFFF FFFF 0000
0000 0000 0000 0000

ok.

4) This shows of a CDRW Disk that I formatted with InCD along with
LG? First IS it Okay that I formated the CDRW Disk with ur InCD
and now I am using this for Write with using my own Fromat
Command.. Will that be Okay or I will have to use my own Format
Command? I realy and badly this answer which?

It depends what you want to do develop first: writing data or formatting disc. And also if you want to add format capability at all to your software.

Of course you will be able to format with InCD then write with your own software.

5) Can I just Use Read Track Info after Success in Mode Select with
options of Track flage set to 1 and Track/LBA to 0xFF for Read
Track Info? Will that Work or I will have to Go othe way?

As far as I know there is no special sequence about mode select and read track info.

6) If I go for Fix Packet, Can I write just Data in Chunks of 2048
bytes? I shall to calculte/Provide Sync, Headre , Sub Header , EC or Drive will do it for me and I will have to just to provide 2048 bytes and Start LBA or Will have to provide all 2352 bytes?

In fixed packet, you provide just the data by packets of 32 blocks (32*2048 bytes). Service blocks are computed by the drive.


_____________________________

David Burg
Software Development,
InCD Project Leader

Nero AG
Im Stoeckmaedle 18
76307 Karlsbad
Germany

fax: +49 (0)7248 928 299

email: dburg@nero.com
http://www.nero.com

(in reply to Shaziphil)
Post #: 14
RE: Badly Need Help for Packet Writing Steps - 7/25/2003 7:24:16 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Well ..De burg what can I say about u.. u are simply great! I wil say u my SIR!
The comments that you have given are really highly valubale for me.. I dont think I could get from any person other than you.. or It would have taken me months to understand that core summary and core issues...
I simply have no words for u...
I have decided if u dont mind, can I dedicate my this hobby project to u.I need ur answer sir Please!
I have not tested ur proposals but I am sure they will work as they worked before....
Sir.. I will come up with any other questions, if I face any problems...
Thanks and Bundle of thanks.
Latest of Project is that I write a packet and CD remains busy,... but I hope this is not big issue.

as far as suggestion of Mr. SP is concerned , Sir I will not agree, becasue I dont want to bog down into third party like MICROSOFT, GNU APIs of operating systems with no knowlege of what is happening at bottom core level for CD access.
Will Soon be here again with other problem.
regards
Shaziphil

(in reply to Shaziphil)
Post #: 15
RE: Badly Need Help for Packet Writing Steps - 7/25/2003 9:46:22 PM   
Shaziphil

 

Posts: 10
Joined: 7/21/2003
From: France
Status: offline
Respected Sir!
Now when I am trying to write at LBA number 65, For this , when I issue Write Command, The Writer Keeps on Light Blowing for ever and never stops
Here are differnt dumps!
MODE SELECT dumps!

0000 0000 0000 0000 0532 0065 0B00 0000 2000 0000 0020 0096 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

READ DISK INFO:_
0020 1E01 0101 0180 2000 0000 0072 0029 FFFF FFFF FFFF FFFF 0000 0000 0000 0000 0000

READ TRACK INFO for #1:-
001A 0101 0007 B200 0000 0000 FFFF FFFF 0000 0000 0000 0020 0004 34C0

NOW When I Issue Write Command :-
Registers are
Before Data and after command:-
Data=34
Error=00
Interrupt reason=01
Reserved=01
Bytes low=255
Bytes high=255
Drive select=A0
status=D0

and after I provide Data:-
Data=34
Error=00
Interrupt reason=01
Reserved=01
Bytes low=255
Bytes high=255
Drive select=A0
status=D0
Both are same!
Can u suggest something!
As Far As I under stand, I think one of following possibilities.
1) I dont close Track/Seesion After I return from Write.
2) I have give Sub Header 2 as 0.. should it be differnet fro Mode 2 form 1.
3) Approximately How much time a CDRW deive take to write 32* 2048 bytes?
Any other critical Write Paremeter that I may be ignoring?
Please I need your suggestion so that I get out of this trouble?
Once again , Sir thanks in advance.
Regards
Shaziphil

(in reply to Shaziphil)
Post #: 16
Page:   [1] 2   next >   >>
All Forums >> [Optical Storage Software] >> CD/DVD Authoring >> Packet Writing >> Badly Need Help for Packet Writing Steps Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.063