VOGONS

Common searches


Reply 20 of 39, by pantercat

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote:

I would not expect a .bin file containing both data and audio tracks to use mode1/2048. All sectors in a source file should be the same size, so the data track should be mode1/2352 (or mode2/2352, sometimes) to match the audio tracks... Otherwise how do you determine the file offset given by the INDEX for track 2?

I agree. It seems bchunk treat mode1/2048 like Raw mode2/2352, at least under some circumstances.

krcroft wrote:

If the user is trying to to rip a BIN+CUE where the BIN is simply an ISO, then they won't have audio tracks anyway

I have always thought the same, but I have found some BIN/CUE where the BIN is really an ISO (according to file) with audio tracks.

PDII has the following CUE:

FILE "PDdlx.bin" BINARY
TRACK 01 MODE1/2048
INDEX 01 00:00:00
TRACK 02 AUDIO
INDEX 00 06:15:24
INDEX 01 06:17:24
TRACK 03 AUDIO
INDEX 00 10:35:07
INDEX 01 10:37:07

PDdlx.bin is an ISO-9660. In bchunk.c, MODE1/2048 matches the case fallback, which indeed is equivalent to Raw MODE2/2352 (sector data at offset 0, 2352 bytes per sector), so bchunk splits PDdlx.bin to another ISO and 2 WAVs.

Reply 21 of 39, by Akuma

User metadata
Rank Member
Rank
Member
krcroft wrote on 2020-10-25, 21:43:

Akuma, you can use: file <binname> and grep for the ISO string to pre-detect these broken scenarios.

If the user is trying to to rip a BIN+CUE where the BIN is simply an ISO, then they won't have audio tracks anyway, in which case they also don't need the CUE.. just mount the ISO straight away. In that scenario, you could suggest that or still generate a cdrom.bat for them.

The CUE is grepped for 2048. If the CUE is broken too, well then its the end of the line in my book. Its troubleshooting at that point anyway. Maybe something in the error message ?

krcroft wrote on 2020-10-25, 21:15:
q: (closed) 1. Copyright / GPL the source a: I want users to know its GPL2, but we can add something extra :D […]
Show full quote

q: (closed) 1. Copyright / GPL the source
a: I want users to know its GPL2, but we can add something extra 😁

Absolutely; it's just recommended that the source file(s) themselves contain a short GPL banner first-thing.

#  SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2002-2020 Akuma (etc..)

Still doubting between GPL-2.0-only and GPL-2.0-or-later

krcroft wrote on 2020-10-25, 21:15:
q: (closed) 2. Highly recommend Bash strict-mode: a: Added: set -eo pipefail (removed 'u' as uninitialized variables are used) […]
Show full quote

q: (closed) 2. Highly recommend Bash strict-mode:
a: Added: set -eo pipefail (removed 'u' as uninitialized variables are used)
Added: IFS=$'\r\n\t' (\r for WIN/DOS compatibility)

Explicit is better (if you can). For the variables that you absolutely want/need to use uninitialized, you can set a default value:

${varname:-defvalue}
Example
echo ${myundefvar:-hello}
Returns: "hello"

This way, -u will still catch any unexpectedly undefined variables. Handy for stuff like: rm -rf "$myvar/"

Added, but

If the variable is empty eg "" you still have the same problem,
>> this doesn't work: echo ${myundefvar:-hello}
because I'm testing if the variable is unset or empty.
>> but this does: echo ${myundefvar:=hello}
in my case this would translate to: echo ${myundefvar:=}

it works with 'pipefail -euo' now.

krcroft wrote on 2020-10-25, 21:15:

q: (open__) 11. Suggest printing the imgmount for the user after encoding.
a: I think a batch file would be better: cdrom.bat ?

Yeah; even more encapsulated, and if you're launching stuff from the DOSBox shell, users can always count on simply running "cdrom" to mount their disk (I'm looking forward to this!).

Added

krcroft wrote on 2020-10-25, 21:15:
q: (open__) 16. Recommended builds for codecs a: imo use the ones from the repo for now. […]
Show full quote

q: (open__) 16. Recommended builds for codecs
a: imo use the ones from the repo for now.

Not suggesting you install stuff or download anything in the shell-script.

But in the README, you could point users to recommended codec sites, which would be especially useful for Windows users running your script via WSL. Alternatively for Windows users, a separate ZIP pack of best-of-the-best executables would get them up and running right away.

Your script is very nicely timed given pre-Windows 10 bash-scripts weren't readily runnable without mingw / msys* / cygwin / etc.. but WSL + Windows 10 makes this accessible to general users. So I think your script has a good change of seeing wide-spread use.

Added

krcroft wrote on 2020-10-25, 21:15:

This brings up another point:

21: Scan for dependent executables (bchunk, flac, ..) and provide a warning if not found, and either quit or optionally block out just that functionality.

Looking forward to 0.8!

Already implemented in 1.00 😉 and I think you mean 1.08 😁

checkapp(){ file="$1";which "$1" >/dev/null 2>&1 || exit 104;}
104) echo "error: '$file' dependency not found";;

Reply 22 of 39, by Akuma

User metadata
Rank Member
Rank
Member

I need some input :

The command line arguments are getting complicated when I need to implement these:

  • 12. Mono option for mono audio to save disk space
  • 13. Speech option (Jones in the Fast Lane only has voices).
  • 14. variable-bit-rate encodings as a default
  • 15. Filler option (unused space at lowest bit rate and in mono)

I could swap things around: (moving bchunk "swap bytes" as a second argument)
eg: dbx-conv [-s] codec [codec-options-passthrough] /path/to/cue-file

or I can start implementing flags, but this seems more of a hassle, position independent but limiting the options:
eg: -b bitrate -c codec -f cuefile -fi filler -m mono -s byteswap

Let me know

@krcroft: some commandline examples for those suggestions would be real helpful

Reply 23 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

@pantercat -- wow, that's is quite a franken-BIN.

Akuma, I agree with the approach (you're in troubleshooting land). If bchunk chokes on the file, then it should print some kind of error message so you want that to flow through to the user (or redirect stderr to a log and only show it to the user on exit if it exists). Bchunk would return an error code that safe-mode set -e will catch, executing your trap function.

GPL2 vs GPL2+; both set your own bar at GPL2 - which allows hardware manufacturers to use it, modify it, and not share their changes through legal hardware restrictions and DRM terms. Realistically it's just a script.. but who knows, I've telneted into network-audio devices and routers, and found absolutely pathetic and fragile scripting - so I wouldn't put it past hardware manfacturers like Sonos who might one day offer "Digitize your CD collection to digital files today!", similar to those vinyl-to-Mp3 devices today.

The plus, GPL2+, lets someone else relicense it with a newer loopholes-closed GPL. Without the plus, they are bound to only ever license it as GPL2.. which some contributors might not want, especially given the direction of cloud providers (ie: Amazon can earn hundreds of billions in micro-transactions licensing MariaDB-as-a-service, but not give back a dime to the developers). Perhaps profit-sharing above some threshold is something that will be addressed in future GPL revisions.

Regarding the audio-type flags (speech, mono, filler), these should be singular flags:
- Instead of (-fi filler -m mono), just use (-fi , -sp, -m).

22. Per-track settings: Letting users apply these to a subset of tracks is important, because many games use a mix of these types. You could add a -t <tracks> flag that lets users specify a range a-b or list a,b,c; or maybe other formats. Another option is to accept a text file with the desired per-track settings, which might be easier than the above. Users (like me) who care about this stuff are likely to have a record for each game of the track types and how they want them encoded.

23. Force Re-encode flag: Crazy users like me also care about coded improvements, for example, Opus 1.1 -> 1.2 -> 1.3 have each walked up the quality curve while simultaneously lowering their bitrate need to achieve it. It's pretty remarkable. So for me, when a new Opus library comes out, I mass-reencode my entire collection (I've done it twice now).

24. Suggest using command -v executable, as a direct replacement for which. Command -v is a shell built-in (like [[) and is part of the posix standard, so no need to launch the non-posix standard /usr/bin/which executable.

Codec examples.

Vorbis -- Assuming AoTUV-beta 5

oggenc <quality-args> -quiet -o "{outfile}" "{infile}"
  # Speech
speech, simple, mono: --advanced-encode-option lowpass_frequency=13000 --bitrate 44 --downmix
speech, moderate, mono: --advanced-encode-option lowpass_frequency=14000 --bitrate 50 --downmix
speech, complex, mono: --advanced-encode-option lowpass_frequency=16000 --bitrate 52 --downmix
speech, simple, stereo: --advanced-encode-option lowpass_frequency=13000 --bitrate 50
speech, moderate, stereo: --advanced-encode-option lowpass_frequency=14000 --bitrate 56
speech, complex, stereo: --advanced-encode-option lowpass_frequency=16000 --quality 1.4

# Music / Mixed
music, simple, mono: --quality 2.2 --downmix
music, moderate, mono: --quality 2.3 --downmix
music, complex, mono: --quality 2.5 --downmix
music, simple, stereo: --quality 3.5
music, moderate, stereo: --quality 4.3
music, complex, stereo: --quality 5.0

# Filler
filler, simple, mono: --quality -1 --resample 512 --downmix
filler, moderate, mono: --quality -1 --resample 512 --downmix
filler, complex, mono: --quality -1 --resample 512 --downmix
filler, simple, stereo: --quality -1 --resample 512 --downmix
filler, moderate, stereo: --quality -1 --resample 512 --downmix
filler, complex, stereo: --quality -1 --resample 512 --downmix

Opus:

opusenc <quality-args>  --quiet "{infile}" "{outfile}"
  # Speech
speech, simple, mono: --speech --bitrate 24 --downmix-mono
speech, moderate, mono: --speech --bitrate 28 --downmix-mono
speech, complex, mono: --speech --bitrate 36 --downmix-mono
speech, simple, stereo: --speech --bitrate 32
speech, moderate, stereo: --speech --bitrate 36
speech, complex, stereo: --speech --bitrate 40

# Music / Mixed
music, simple, mono: --music --bitrate 50 --downmix-mono
music, moderate, mono: --music --bitrate 56 --downmix-mono
music, complex, mono: --music --bitrate 72 --downmix-mono
music, simple, stereo: --music --bitrate 72
music, moderate, stereo: --music --bitrate 84
music, complex, stereo: --music --bitrate 96

# Filler
filler, simple, mono: --bitrate 1 --downmix-mono
filler, moderate, mono: --bitrate 1 --downmix-mono
filler, complex, mono: --bitrate 1 --downmix-mono
filler, simple, stereo: --bitrate 1 --downmix-mono
filler, moderate, stereo: --bitrate 1 --downmix-mono
filler, complex, stereo: --bitrate 1 --downmix-mono

MP3:

lame <additional-args> --quiet -T -q0 -b4 "{infile}" "{outfile}"
  # Speech
speech, simple, mono: -V7.0 --lowpass 13000 -mm
speech, moderate, mono: -V6.5 --lowpass 14000 -mm
speech, complex, mono: -V6.3 --lowpass 15000 -mm
speech, simple, stereo: -V6.0 --lowpass 13000
speech, moderate, stereo: -V5.7 --lowpass 15000
speech, complex, stereo: -V5.5 --lowpass 16000

# Music
music, simple, mono: -V6.0 -mm
music, moderate, mono: -V5.5 -mm
music, complex, mono: -V5.0 -mm
music, simple, stereo: -V4.5
music, moderate, stereo: -V3.5
music, complex, stereo: -V2.5

# Filler
filler, simple, mono: -mm
filler, moderate, mono: -mm
filler, complex, mono: -mm
filler, simple, stereo: -mm
filler, moderate, stereo: -mm
filler, complex, stereo: -mm

FLAC: all the same, always:

flac -silent -8 -e -p -b 512 -P=4096 -S- --output-name="{outfile}" "{infile}"

Reply 24 of 39, by Akuma

User metadata
Rank Member
Rank
Member

@krcroft: PM sent

krcroft wrote on 2020-10-26, 14:09:

GPL2 vs GPL2+
....
The plus, GPL2+, lets someone else relicense it with a newer loopholes-closed GPL. Without the plus, they are bound to only ever license it as GPL2.. which some contributors might not want, especially given the direction of cloud providers (ie: Amazon can earn hundreds of billions in micro-transactions licensing MariaDB-as-a-service, but not give back a dime to the developers). Perhaps profit-sharing above some threshold is something that will be addressed in future GPL revisions.

Just don't want it to become GPLv3 which imo is way to strict.

krcroft wrote on 2020-10-26, 14:09:

Regarding the audio-type flags (speech, mono, filler), these should be singular flags:
- Instead of (-fi filler -m mono), just use (-fi , -sp, -m).

Tried, but went with the passthrough, its way more versatile and customizable at that point. So I think we should go with a bunch of your presets, something like this:

#Vorbis -- Assuming AoTUV-beta 5
# oggenc <preset> -o "${outfile}" "${infile}"
ogg_default=""
ogg_speech_simple_mono="--advanced-encode-option lowpass_frequency=13000 --bitrate 44 --downmix"
ogg_speech_moderate_mono="--advanced-encode-option lowpass_frequency=14000 --bitrate 50 --downmix"
ogg_speech_complex_mono="--advanced-encode-option lowpass_frequency=16000 --bitrate 52 --downmix"
ogg_speech_simple_stereo="--advanced-encode-option lowpass_frequency=13000 --bitrate 50"
ogg_speech_moderate_stereo="--advanced-encode-option lowpass_frequency=14000 --bitrate 56"
ogg_speech_complex_stereo="--advanced-encode-option lowpass_frequency=16000 --quality 1.4"
ogg_music_simple_mono="--quality 2.2 --downmix"
ogg_music_moderate_mono="--quality 2.3 --downmix"
ogg_music_complex_mono="--quality 2.5 --downmix"
ogg_music_simple_stereo="--quality 3.5"
ogg_music_moderate_stereo="--quality 4.3"
ogg_music_complex_stereo="--quality 5.0"
ogg_filler_simple_mono="--quality -1 --resample 512 --downmix"
ogg_filler_moderate_mono="--quality -1 --resample 512 --downmix"
ogg_filler_complex_mono="--quality -1 --resample 512 --downmix"
ogg_filler_simple_stereo="--quality -1 --resample 512 --downmix"
ogg_filler_moderate_stereo="--quality -1 --resample 512 --downmix"
ogg_filler_complex_stereo="--quality -1 --resample 512 --downmix"

#Opus
# opusenc <preset> "${infile}" "${outfile}"
opus_default=""
opus_speech_simple_mono="--speech --bitrate 24 --downmix-mono"
opus_speech_moderate_mono="--speech --bitrate 28 --downmix-mono"
opus_speech_complex_mono="--speech --bitrate 36 --downmix-mono"
opus_speech_simple_stereo="--speech --bitrate 32"
opus_speech_moderate_stereo="--speech --bitrate 36"
opus_speech_complex_stereo="--speech --bitrate 40"
opus_music_simple_mono="--music --bitrate 50 --downmix-mono"
opus_music_moderate_mono="--music --bitrate 56 --downmix-mono"
opus_music_complex_mono="--music --bitrate 72 --downmix-mono"
opus_music_simple_stereo="--music --bitrate 72"
opus_music_moderate_stereo="--music --bitrate 84"
opus_music_complex_stereo="--music --bitrate 96"
opus_filler_simple_mono="--bitrate 1 --downmix-mono"
opus_filler_moderate_mono="--bitrate 1 --downmix-mono"
opus_filler_complex_mono="--bitrate 1 --downmix-mono"
opus_filler_simple_stereo="--bitrate 1 --downmix-mono"
opus_filler_moderate_stereo="--bitrate 1 --downmix-mono"
opus_filler_complex_stereo="--bitrate 1 --downmix-mono"

#MP3
# lame <preset> -T -q0 -b4 "${infile}" "${outfile}"
mp3_default=""
mp3_speech_simple_mono="-V7.0 --lowpass 13000 -mm"
mp3_speech_moderate_mono="-V6.5 --lowpass 14000 -mm"
mp3_speech_complex_mono="-V6.3 --lowpass 15000 -mm"
mp3_speech_simple_stereo="-V6.0 --lowpass 13000"
mp3_speech_moderate_stereo="-V5.7 --lowpass 15000"
mp3_speech_complex_stereo="-V5.5 --lowpass 16000"
mp3_music_simple_mono="-V6.0 -mm"
mp3_music_moderate_mono="-V5.5 -mm"
mp3_music_complex_mono="-V5.0 -mm"
mp3_music_simple_stereo="-V4.5"
mp3_music_moderate_stereo="-V3.5"
mp3_music_complex_stereo="-V2.5"
mp3_filler_simple_mono="-mm"
Show last 10 lines
mp3_filler_moderate_mono="-mm"
mp3_filler_complex_mono="-mm"
mp3_filler_simple_stereo="-mm"
mp3_filler_moderate_stereo="-mm"
mp3_filler_complex_stereo="-mm"

#FLAC"
# flac <preset> --output-name="${outfile}" "${infile}"
flac_default="flac -silent -8 -e -p -b 512 -P=4096 -S-""
krcroft wrote on 2020-10-26, 14:09:

22. Per-track settings: Letting users apply these to a subset of tracks is important, because many games use a mix of these types. You could add a -t <tracks> flag that lets users specify a range a-b or list a,b,c; or maybe other formats. Another option is to accept a text file with the desired per-track settings, which might be easier than the above. Users (like me) who care about this stuff are likely to have a record for each game of the track types and how they want them encoded.

Nice, onto the suggestion list it goes

krcroft wrote on 2020-10-26, 14:09:

23. Force Re-encode flag: Crazy users like me also care about coded improvements, for example, Opus 1.1 -> 1.2 -> 1.3 have each walked up the quality curve while simultaneously lowering their bitrate need to achieve it. It's pretty remarkable. So for me, when a new Opus library comes out, I mass-reencode my entire collection (I've done it twice now).

A kind of overwrite existing files ?

krcroft wrote on 2020-10-26, 14:09:

24. Suggest using command -v executable, as a direct replacement for which. Command -v is a shell built-in (like [[) and is part of the posix standard, so no need to launch the non-posix standard /usr/bin/which executable.

Fixed

EDIT: Added presets, and we need some average user defaults for mp3/vorbis/opus

Reply 25 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Ugh.. I just lost a huge response post that I was periodically adding to over ~3 hours this morning. 😒
I clicked 'preview' and got the spinning star wheel and frozen display; was unable to get out of it so clicked 'back' and the first first ~10 lines of my posted were retained.

Suggestion 1 for me: shed my trust in this form submission and start typing long responses in gmail (because it auto-saves).

Suggestion 25. for your list - migrate your source and code-review to a git repo tailored exactly for this stuff (github/gitlab/self-hosted). This will let us comment on individual lines. I also know first-hand that github saves form input across 'back' and 'forward' clicks, because I've had long posts saved by this before 😀

Ok.. time to start typing my bigger response in gmail.

Last edited by krcroft on 2020-10-27, 20:18. Edited 1 time in total.

Reply 26 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

23. Force re-encode

Yes, exactly right.. (I shold have said overwrite). This is useful when you get a newer codec version or a variant with a different acoustic model (like Vorbis vanilla vs Vorbis AoTuV b5).

Next suggestions using this tree as an example:

jones
├── flac
│ └── VBR
│ ├── cdrom.bat
│ ├── cdrom.cue
│ ├── track01.iso -> /home/user/dos/cdda/jones/cd/jones/track01.iso
│ ├── track02.flac
│ ├── track02.log
│ ├── track03.flac
│ ├── track03.log
│ ├── track04.flac
│ └── track04.log
├── bchunk.log
├── track01.iso
├── track02.wav
├── track03.wav
└── track04.wav

25. Use FILE "../../track01.iso" BINARY in the CUE files, which is cross-platform (even windows) and supported by all DOSBox variants. It will let users move their ripped directory (or the entire game itself) to other directories or platforms without the link breaking. You can then eliminate the symlink all together.

26. Aggregate the encode logs into a single encoding.log. The individual logs are too cluttering, and in the rare case the user wants to inspect the output, a single log still retains everything.

27. Given WAV is a codec just like OGG and FLAC, leaving the WAV files in the root feels inconsistent. Suggest moving the WAVs to their own directory just like the others and give them a cdrom.bat and cdrom.cue so users can just as easily follow the same pattern and mount the WAVs like they do for the other codecs.

The result of the 25, 26, and 27 will be:

jones
├── flac
│ └── VBR
│ ├── cdrom.bat
│ ├── cdrom.cue
│ ├── track02.flac
│ ├── track03.flac
│ ├── track04.flac
│ └── encoding.log
├── wav
│ ├── cdrom.bat
│ ├── cdrom.cue
│ ├── track02.wav
│ ├── track03.wav
│ └── track04.wav
├── bchunk.log
└── track01.iso

28. Pass-through of options isn't working and the encoding error isn't bubbling up and halting dbx-conv:

$ dbx-conv jones.cue opus --speech --bitrate 24 --downmix-mono

BIN/CUE to ISO/CUE converter v1.08, supports : FLAC,MP3,OGG,OPUS
Copyright (c) 2020 by Akuma under GNU General Public License 2.0

*Converting BIN/CUE to ISO/WAV
- track01.iso exists
*Encoding WAV to OPUS/24
> track02.opus
*Writing CUE sheet
> cdrom.cue
*Writing BAT file
> cdrom.bat

Success

[10:11:27@hoya cd] tree jones
jones
├── bchunk.log
├── flac
│ └── VBR
│ ├── cdrom.bat
│ ├── cdrom.cue
│ ├── track01.iso -> /home/user/dos/cdda/jones/cd/jones/track01.iso
│ ├── track02.flac
│ └── track02.log
├── opus
│ ├── 24
│ │ ├── cdrom.bat
│ │ ├── cdrom.cue
│ │ ├── track01.iso -> /home/user/dos/cdda/jones/cd/jones/track01.iso
│ │ └── track02.log
│ └── VBR
│ ├── cdrom.bat
│ ├── cdrom.cue
│ ├── track01.iso -> /home/user/dos/cdda/jones/cd/jones/track01.iso
│ └── track02.log
├── track01.iso
└── track02.wav

And the FILE entry for the track is missing:

cat jones/opus/VBR/cdrom.cue
FILE "track01.iso" BINARY
TRACK 01 MODE1/2048
INDEX 01 00:00:00
FLAGS DCP
PREGAP 00:02:00
INDEX 01 00:00:00

Encoding errors should halt the process and provide a non-zero return-code to the shell, so people scripting at a higher-level can rely on the error code. In your background subshells, add set -e as well so those errors bubble up to your outer process. (https://unix.stackexchange.com/questions/2965 … e-in-a-subshell)

In this specific example, the options are being passed into the encoder as a single value (instead of $@ or $*). Here's the output from opusenc:

opusenc: unrecognized option '--speech --bitrate 24 --downmix-mono'

29. I really like your suggestion of Presets.

This will let me use the same audio qualities regardless of codec, and let me not have to memorize or reference optimal codec flags:

dbx-conv jones.cue opus -type speech -complexity simple -channels mono
dbx-conv jones.cue ogg -type speech -complexity simple -channels mono
dbx-conv jones.cue mp3 -type speech -complexity simple -channels mono

Internally, you will have the big list of presets all assigned like in your previous post:

opus_speech_simple_mono="--speech --bitrate 24 --downmix-mono"
(etc..)

You can populate what's called an indirect variable:

preset="${codec}_${type:-music}_${complexity:-high}_${channels:-stereo}"

so in the above example, we'd have:

preset=opus_speech_simple_mono

And then you can reference the variable-of-the-variable with: ${!preset}, which will return --speech --bitrate 24 --downmix-mono.

The above example also uses reasonable defaults, so users can provide none, some, or all qualities:

dbx-conv jones.cue opus

dbx-conv jones.cue opus -type speech

dbx-conv jones.cue opus -type speech -complexity low

dbx-conv jones.cue opus -type speech -complexity low -channels mono

Reply 27 of 39, by Akuma

User metadata
Rank Member
Rank
Member

Already ahead of you 😉

Here's a test version, with a preset file.
Happy testing!

FYI: I juggled the command line options a bit
see usage.

*for everyone else: test version, use at own risk!*

Attachments

Reply 28 of 39, by Akuma

User metadata
Rank Member
Rank
Member
krcroft wrote on 2020-10-27, 18:43:

23. Force re-encode

Yes, exactly right.. (I shoud have said overwrite). This is useful when you get a newer codec version or a variant with a different acoustic model (like Vorbis vanilla vs Vorbis AoTuV b5).

Added [-f] force option,so its going to be dbx-conv [-s] [-f] .....

krcroft wrote on 2020-10-27, 18:43:

25. Use FILE "../../track01.iso" BINARY in the CUE files, which is cross-platform (even windows) and supported by all DOSBox variants. It will let users move their ripped directory (or the entire game itself) to other directories or platforms without the link breaking. You can then eliminate the symlink all together.

A relative path in the symlink should fix that, endusers should not need to edit the CUE.

krcroft wrote on 2020-10-27, 18:43:

26. Aggregate the encode logs into a single encoding.log. The individual logs are too cluttering, and in the rare case the user wants to inspect the output, a single log still retains everything.

Esthetics, moving to end of queue

krcroft wrote on 2020-10-27, 18:43:

27. Given WAV is a codec just like OGG and FLAC, leaving the WAV files in the root feels inconsistent. Suggest moving the WAVs to their own directory just like the others and give them a cdrom.bat and cdrom.cue so users can just as easily follow the same pattern and mount the WAVs like they do for the other codecs.

Esthetics, moving to end of queue

krcroft wrote on 2020-10-27, 18:43:

28. Pass-through of options isn't working and the encoding error isn't bubbling up and halting

Is that fixed in the pre-1.08 ?

krcroft wrote on 2020-10-27, 18:43:

29. I really like your suggestion of Presets.

Yeah, I think most users just want to run it once per cdrom, it needs to be easy.

EDIT: Question does a CUE handle multiple codecs, like this ?

FILE "track02.mp3"
TRACK 02 MP3
INDEX 01 00:00:00
FILE "track03.ogg"
TRACK 03 OGG
INDEX 01 00:00:00
FILE "track04.flac"
TRACK 04 FLAC
INDEX 01 00:00:00

Reply 29 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Thanks Akuma.

23. Perfect!

25. Symlinks won't work on Windows; but relative is better on Linux.

I wasn't suggesting users would have to edit their CUE files. When you generate the CUE, simply insert the "../../" string exactly as-is before the track01.iso filename, and DOSBox will have zero issues finding it two-directories up (regardless of where the entire directory tree is located). Give it a try - just use "FILE "../../track01.iso" BINARY " as your first line, and it will open file, and the local symlink to the ISO isn't needed.

28. TBD; I still need to find a bit more time to test 1.08.

29. Yup, I agree!

Yes, DOSBox can handle mixing WAV and OGGs (44.1 KHz and stereo), and those variants using the CDDA patch can mix the other codecs (as well as frequencies and channels).

Reply 30 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

pre-1.08 feedback:

$ dbx-conv

BIN/CUE to ISO/CUE converter v1.08, supports : FLAC,MP3,OGG,OPUS
Copyright (c) 2020 by Akuma under GNU General Public License 2.0

/usr/local/bin/dbx-conv: line 191: $1: unbound variable

Moving your "[[ $# -ge 2 ]] || exit 100" check to line 191, ahead of #1 bchunk ... got me up and running.

Pass-through confirmed working.

Regarding the presets, it would feel more natural if they were agnostic of codec. For example, music_moderate_stereo, should apply to whaetever lossy codec I choose. Syntax, like:

usage: dbx-conv [-s] /path/cue-or-cdrom codec [preset] [options]

(internally, you can then populate $codec_music_moderate_stereo to look up the flags for the given codec)

Reply 31 of 39, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Here are my presets on a per-game, per-track basis.

I've included before-and-after compression results for those curious what can be achieved on limited storage targets (such as generating a game set for the Raspberry Pi), when Opus is used:

AD&D Dark Sun II Wake of the Ravager
- speech_complex_stereo tracks 38 and 39
- music_moderate_stereo (all others)
- Audio 618MiB -> 34 MiB

Alien Virus
- speech_complex_stereo (all)
- 526 -> 31

Alone in the Dark 1
- music_simple_stereo (all)
- 277 -> 16

Alone in the Dark 2
- speech_simple_mono (23 through 63)
- music_moderate_stereo (all others)
- 474 -> 23

Alone in the Dark 3
- speech_simple_mono (24 through 61)
- music_moderate_mono (21)
- music_complex_stereo (20 and 23)
- music_moderate_stereo (all others)
- 410 -> 22

ARSENAL Taste the Power
- music_moderate_stereo (all)
- 680 -> 44

Battle Chess Enhanced
- speech_simple_mono (22)
- music_simple_stereo (others)
- 652 -> 20

Buzz Aldrin's Race into Space
- music_moderate_stereo (all)
- 28 -> 1.6

Destruction Derby
- music_moderate_mono (2, 4 through 9)
- music_simple_stereo (17)
- music_moderate_stereo (others)
- 606 -> 30

Dungeon Keeper
- music_moderate_stereo (all)
- 283 -> 16

Electronic Popple
- music_complex_stereo (12, 14 through 16)
- music_moderate_stereo (others)
- 379 -> 24

Eradicator
- music_moderate_stereo (all)
- 337 -> 21

Fascination
- music_simple_mono (2)
- music_moderate_stereo (others)
- 567 -> 21

Firo & Klawd
- music_moderate_stereo (all)
- 297 -> 18

FX Fighter
- music_simple_stereo (all)
- 523 -> 27

Great Naval Battles Vol IV Burning Steel, 1939-1942
- music_simple_mono (10, 11)
- music_moderate_stereo (others)
- 288 -> 17

Heimdall 2
- music_simple_stereo (all)
- 241 -> 17

Ignition
- music_moderate_stereo (all)
- 330 -> 20

Jones in the Fast Lane
- speech_simple_mono (all)
- 337 -> 6.5

Little Big Adventure
- music_moderate_stereo (all)
- 252 -> 17

Loom
- music_simple_stereo (all)
- 552 -> 28

MechWarrior 2 31st Century Combat
- music_moderate_stereo (all)
- 570 -> 34

MechWarrior 2 Ghost Bear's Legacy
- music_simple_stereo (all)
- 459 -> 28

Micro Machines 2 Turbo Tournament
- music_complex_stereo (all)
- 270 -> 19

Might and Magic IV World (Clouds and Darkside) of Xeen
- speech_moderate_stereo (10)
- speech_simple_mono (others)
- 1.2 GiB -> 20 MiB

NASCAR Racing
- music_moderate_stereo (all)
- 88 -> 4.9

Noctropolis
- music_simple_stereo (all)
- 215 -> 13

Quarantine
- music_complex_stereo (all)
- 426 -> 29

Rayman
- music_moderate_stereo (all)
- 548 -> 33

Realms of Arkania III Shadows over Riva
- music_moderate_stereo (all)
- 287 -> 19

Sam & Max Hit the Road
- music_moderate_stereo (all)
- 125 -> 8.4

Settlers II Gold Edition
- music_simple_stereo (all)
- 276 -> 16

ShadowCaster
- speech_simple_mono (all)
- 74 -> 1.2

Stellar 7
- music_moderate_stereo (all)
- 226 -> 14

Super Stardust
- music_moderate_stereo (all)
- 517 -> 32

The Horde
- music_complex_stereo (all)
- 277 -> 20

The Incredible Hulk
- music_complex_stereo (all)
- 518 -> 35


Tomb Raider Gold

- music_simple_mono (6)
- music_moderate_mono (18)
- filler_simple_mono (28)
- speech_moderate_mono (29 through 60)
- music_moderate_stereo (others)
- 400 -> 19

William Shatner's TekWar
- music_moderate_stereo (all)
- 299 -> 18

Wingstar
- music_complex_stereo (all)
- 367 -> 26

World of Aden Thunderscape
- music_simple_stereo (16 through 21, 23)
- music_moderate_stereo (others)
- 357 -> 21

World Rally Fever
- music_moderate_stereo (all)
- 609 -> 37

Worms
- music_simple_stereo (all)
- 453 -> 22

Worms Reinforcements
- music_simple_stereo (3 through 13)
- music_moderate_stereo (others)
- 566 -> 24

Reply 32 of 39, by Akuma

User metadata
Rank Member
Rank
Member

Nice list mate 😁

krcroft wrote on 2020-10-28, 21:27:

25. Symlinks won't work on Windows; but relative is better on Linux.

I understand the problem 😁 , but I expect users copying those files.
Does it fail on WSL ?

krcroft wrote on 2020-10-28, 21:27:

Yes, DOSBox can handle mixing WAV and OGGs (44.1 KHz and stereo), and those variants using the CDDA patch can mix the other codecs (as well as frequencies and channels).

Working on it.

krcroft wrote on 2020-10-29, 01:02:

Pass-through confirmed working.

Great!

krcroft wrote on 2020-10-29, 01:02:

Regarding the presets, it would feel more natural if they were agnostic of codec. For example, music_moderate_stereo, should apply to whaetever lossy codec I choose. Syntax, like:

usage: dbx-conv [-s] /path/cue-or-cdrom codec [preset] [options]

(internally, you can then populate $codec_music_moderate_stereo to look up the flags for the given codec)

Esthetics, moving to end of queue.

Reply 33 of 39, by Akuma

User metadata
Rank Member
Rank
Member

@krcroft

Preset "proof of concept" script for using preset files.
This was a headscratcher and not the best programming but it works.

Could you take a look at the code and do some testing.

If you have a solution for ditching the "eval" statement, count me in.
For some reason I had trouble passing along the $@ and losing the quotes in the process 😒

I'm happy it works though 😁

EDIT: Forgot to mention that it expects a folder with *.wav files with the name of the preset.

Attachments

Reply 35 of 39, by Akuma

User metadata
Rank Member
Rank
Member
krcroft wrote on 2020-10-29, 01:40:

Here are my presets on a per-game, per-track basis.
....

I took two that were the most interesting and created a preset for them. Replace <codec> with mp3/ogg/flac/opus. Its possible to mix them up, whether that's practical I don't know.

Make sure the most greedy line comes first as the next one overwrites.
* default : set all tracks to preset
* ranges : set range of tracks eg: 9-14 to preset
* track : set single track eg: 5 to preset

Alone in the Dark 3

#preset: Alone in the Dark 3
#
<codec>_music_moderate_stereo=default
<codec>_speech_simple_mono=24-61
<codec>_music_moderate_mono=21
<codec>_music_complex_stereo=20 23

Destruction Derby

#preset: Destruction Derby
#
<codec>_music_moderate_stereo=default
<codec>_music_moderate_mono=2 4-9
<codec>_music_simple_stereo=17

🎉

Reply 36 of 39, by millansoft

User metadata
Rank Newbie
Rank
Newbie

Hello,

Could anybody give me some hint to run this from Windows 10?

I already installed WSL, but not sure how to execute it, I used DOS and Windows 3.11 to W10, not experience with Linux, sorry If I´m asking something dumb

w10.png
Filename
w10.png
File size
16.79 KiB
Views
3039 views
File license
Public domain

Reply 38 of 39, by realnc

User metadata
Rank Oldbie
Rank
Oldbie

This doesn't work for me. Trying to convert the "Screamer 2" bin/cue to Ogg Vorbis:

$ dbx-conv SCREAM2.cue ogg
dbx-conv: line 145: 10#: invalid integer constant (error token is "10#")
*Converting BIN/CUE to ISO/WAV
> track01.iso
dbx-conv: line 331: encoding: unbound variable

The SCREAM2 directory is created and the WAV files are generated. But no ogg files are created in SCREAM2/ogg.

Edit:
Uh, it works if I run "dbx-conv SCREAM2.cue ogg" a second time without deleting the output directory of the first run...