Closed hikaricore closed 8 months ago
Recently I added the ability to choose 'dvd' format with a new option -m dvd
, which would then internally use chdman createdvd
. Is that not enough? You would need a recent version of tochd
and chdman
. I do not have standalone PPSSPP installed, so cannot test if it produces any warnings, as I use the emulator as a core in RetroArch.
Could you output what version of the tools you have?
$ chdman | grep '0.'
$ tochd --version
A hunksize option could be added, if its needed. But for this specific problem with PSP conversion, I thought createdvd
is enough with a recent version of chdman
, according to https://github.com/hrydgard/ppsspp/pull/18803#issuecomment-1945260992 .
Thanks for the swift response, and sorry for not providing additional details as I was overly hasty. I'm currently using the latest sable build of build of chdman.
$ chdman --version chdman - MAME Compressed Hunks of Data (CHD) manager 0.263
The problem is not with the lack of createdvd support, but rather that PPSSPP expects a hunk size of 2048 rather than 4096 which is what chdman defaults to with createdvd. This creates strange audio/video errors within PPSSPP and results in the dialog shown in the linked pull on their GitHub. I hope the below helps explain the matter further.
Standard "createdvd" via chdman:
$ chdman createdvd -np 16 -i Ace\ Combat\ -\ Joint\ Assault\ \(USA\).iso -o Ace\ Combat\ -\ Joint\ Assault\ \(USA\)_dvd.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.263 (unknown)
Output CHD: Ace Combat - Joint Assault (USA)_dvd.chd
Input file: Ace Combat - Joint Assault (USA).iso
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
Logical size: 1,768,357,888
Compression complete ... final ratio = 71.8%
$ chdman info -i Ace\ Combat\ -\ Joint\ Assault\ \(USA\)_dvd.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.263 (unknown)
Input file: Ace Combat - Joint Assault (USA)_dvd.chd
File Version: 5
Logical size: 1,768,357,888 bytes
Hunk Size: 4,096 bytes
Total Hunks: 431,728
Unit Size: 2,048 bytes
Total Units: 863,456
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size: 1,271,297,575 bytes
Ratio: 71.9%
SHA1: f3fb705de34f727b28c3ca7565a74747fd9582d0
Data SHA1: eb5295e9295e02ecb3f121e3f5b940a4bd7bf30c
Metadata: Tag='DVD ' Index=0 Length=1 bytes
PSP "createdvd" with 2048 hunk size:
$ chdman createdvd -hs 2048 -np 16 -i Ace\ Combat\ -\ Joint\ Assault\ \(USA\).iso -o Ace\ Combat\ -\ Joint\ Assault\ \(USA\)_psp.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.263 (unknown)
Output CHD: Ace Combat - Joint Assault (USA)_psp.chd
Input file: Ace Combat - Joint Assault (USA).iso
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
Logical size: 1,768,357,888
Compression complete ... final ratio = 68.8%
$ chdman info -i Ace\ Combat\ -\ Joint\ Assault\ \(USA\)_psp.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.263 (unknown)
Input file: Ace Combat - Joint Assault (USA)_psp.chd
File Version: 5
Logical size: 1,768,357,888 bytes
Hunk Size: 2,048 bytes
Total Hunks: 863,456
Unit Size: 2,048 bytes
Total Units: 863,456
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size: 1,217,560,731 bytes
Ratio: 68.9%
SHA1: f3fb705de34f727b28c3ca7565a74747fd9582d0
Data SHA1: eb5295e9295e02ecb3f121e3f5b940a4bd7bf30c
Metadata: Tag='DVD ' Index=0 Length=1 bytes
Oddly enough, the 2048 byte hunk size also creates a marginally smaller file, which isn't terribly relevant just interesting:
$ ls -la
total 4157484
drwxr-xr-x 2 hikaricore users 4096 Mar 10 15:35 .
drwxr-xr-x 3 hikaricore users 24576 Mar 10 15:31 ..
-rw-r--r-- 1 hikaricore users 1271297575 Mar 10 15:34 'Ace Combat - Joint Assault (USA)_dvd.chd'
-rw-r--r-- 1 hikaricore users 1768357888 Mar 10 15:32 'Ace Combat - Joint Assault (USA).iso'
-rw-r--r-- 1 hikaricore users 1217560731 Mar 10 15:35 'Ace Combat - Joint Assault (USA)_psp.chd'`
Thank you again for your time and your work this tool. :)
I see, thank you bringing this topic up. For the moment I have added a new option -H
and --hunksize
. So at the moment you can just download the newest version directly from repo at tochd.py . Hope this helps.
I see, thank you bringing this topic up. For the moment I have added a new option
-H
and--hunksize
. So at the moment you can just download the newest version directly from repo at tochd.py . Hope this helps.
Fantastic. Thank you again. Have a great day. ^_^
Hey all. I was trying to implement this myself and share, but my experience with Python is apparently not up to the task and I kept going in circles breaking tochd in different exciting ways.
As is noted here: https://github.com/hrydgard/ppsspp/pull/18803 the expected hunk size for PSP CHDs is 2048, rather than the chdman dvd default of 4096. This of course results in tochd creating PSP CHDs in an unaccepted format, resulting the the notice shown in the PPSSPP pull above, and audio/video sync trouble with usage.
Ideally we should be able to specify hunk size, or simply add a parameter to choose psp conversion. IE (cd, dvd, psp) so that we can pass the '-hs 2048' flag through tochd to chdman. Sorry if the format of this request leaves a lot to be desired.
Thank you in advance for your insight and assistance.
--AB