Emulator Issues #13427
closedDolphinTool convert -f rvz -c bzip always fails with an error
0%
Description
What's the problem? Describe what went wrong.
Attempting to convert an ISO to RVZ with bzip compression always fails with the following error message:
Error: Compression format must be set for WIA or RVZ
What steps will reproduce the problem?
DolphinTool.exe -f rvz -l 5 -b 131072 -c bzip -i any_game.iso -o any_game.rvz
The compression level, block size and the iso being converted aren't relevant to the issue.
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
The error originates in the following code from https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DolphinTool/ConvertCommand.cpp:
// line 252
std::optional<DiscIO::WIARVZCompressionType> compression_o =
ParseCompressionTypeString(options["compression"]);
// a few lines omitted for clarity
if (format == DiscIO::BlobType::WIA || format == DiscIO::BlobType::RVZ)
{
if (!compression_o.has_value())
{
fmt::print(std::cerr, "Error: Compression format must be set for WIA or RVZ\n");
return EXIT_FAILURE;
}
The problem appears to be a mismatch between the command line parser and the ParseCompressionTypeString
function. The CLI expects the string bzip
, but the parsing function expects the string bzip2
:
static std::optional<DiscIO::WIARVZCompressionType>
ParseCompressionTypeString(const std::string& compression_str)
{
if (compression_str == "none")
return DiscIO::WIARVZCompressionType::None;
else if (compression_str == "purge")
return DiscIO::WIARVZCompressionType::Purge;
else if (compression_str == "bzip2")
return DiscIO::WIARVZCompressionType::Bzip2;
else if (compression_str == "lzma")
return DiscIO::WIARVZCompressionType::LZMA;
else if (compression_str == "lzma2")
return DiscIO::WIARVZCompressionType::LZMA2;
else if (compression_str == "zstd")
return DiscIO::WIARVZCompressionType::Zstd;
return std::nullopt;
}
Because of this, it's not possible to use bzip compression. If you pass -c bzip2
to DolphinTool it'll reject that as an invalid choice, but if you use -c bzip
then ParseCompressionTypeString
doesn't recognize the string and the rest of the code thinks the compression format wasn't set.
I don't know how to set up a MSBuild build environment to test this out, otherwise I would've confirmed my findings and opened a PR.
Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.
Yes. Dolphin 5.0-20619.
Is the issue present in the latest stable version?
Yes. Dolphin 5.0-20347.