VOGONS

Common searches


First post, by Raymond C. Glassford

User metadata
Rank Newbie
Rank
Newbie

This post pertains to the Linux version of DOSBox 0.72, and consists of two sections. The first section contains a question; the second section contains suggestions for other users running DOSBox under Linux.

First, a question. The default keybindings do not work on my PC. I am unable to control cycles-up, cycles-down, etc. My mapper.txt file is located at: /home/myuserID/mapper.txt, as are the files: /home/myuserID/.dosboxrc and /home/myuserID/dosbox.conf. I mount my C drive by typing: mount c /home/myuserID/msdos/. Any suggestions as to how to make the default keybindings functional? My mapper.txt file follows.

==================================================

hand_shutdown "key 290 mod1"
hand_capmouse "key 291 mod1"
hand_fullscr "key 13 mod2"
hand_pause "key 19 mod2"
hand_mapper "key 282 mod1"
hand_speedlock "key 293 mod2"
hand_recwave "key 287 mod1"
hand_caprawmidi "key 289 mod1 mod2"
hand_scrshot "key 286 mod1"
hand_video "key 286 mod1 mod2"
hand_decfskip "key 288 mod1"
hand_incfskip "key 289 mod1"
hand_cycledown "key 292 mod1"
hand_cycleup "key 293 mod1"
hand_caprawopl "key 288 mod1 mod2"
hand_swapimg "key 285 mod1"
key_esc "key 27"
key_f1 "key 282"
key_f2 "key 283"
key_f3 "key 284"
key_f4 "key 285"
key_f5 "key 286"
key_f6 "key 287"
key_f7 "key 288"
key_f8 "key 289"
key_f9 "key 290"
key_f10 "key 291"
key_f11 "key 292"
key_f12 "key 293"
key_grave "key 96"
key_1 "key 49"
key_2 "key 50"
key_3 "key 51"
key_4 "key 52"
key_5 "key 53"
key_6 "key 54"
key_7 "key 55"
key_8 "key 56"
key_9 "key 57"
key_0 "key 48"
key_minus "key 45"
key_equals "key 61"
key_bspace "key 8"
key_tab "key 9"
key_q "key 113"
key_w "key 119"
key_e "key 101"
key_r "key 114"
key_t "key 116"
key_y "key 121"
key_u "key 117"
key_i "key 105"
key_o "key 111"
key_p "key 112"
key_lbracket "key 91"
key_rbracket "key 93"
key_enter "key 13"
key_capslock "key 301"
key_a "key 97"
key_s "key 115"
key_d "key 100"
key_f "key 102"
key_g "key 103"
key_h "key 104"
key_j "key 106"
key_k "key 107"
key_l "key 108"
key_semicolon "key 59"
key_quote "key 39"
key_backslash "key 92"
key_lshift "key 304"
key_lessthan "key 60"
key_z "key 122"
key_x "key 120"
key_c "key 99"
key_v "key 118"
key_b "key 98"
key_n "key 110"
key_m "key 109"
key_comma "key 44"
key_period "key 46"
key_slash "key 47"
key_rshift "key 303"
key_lctrl "key 306"
key_lalt "key 308"
key_space "key 32"
key_ralt "key 307"
key_rctrl "key 305"
key_printscreen "key 316"
key_scrolllock "key 302"
key_pause "key 19"
key_insert "key 277"
key_home "key 278"
key_pageup "key 280"
key_delete "key 127"
key_end "key 279"
key_pagedown "key 281"
key_up "key 273"
key_left "key 276"
key_down "key 274"
key_right "key 275"
key_numlock "key 300"
key_kp_divide "key 267"
key_kp_multiply "key 268"
key_kp_minus "key 269"
key_kp_7 "key 263"
key_kp_8 "key 264"
key_kp_9 "key 265"
key_kp_plus "key 270"
key_kp_4 "key 260"
key_kp_5 "key 261"
key_kp_6 "key 262"
key_kp_1 "key 257"
key_kp_2 "key 258"
key_kp_3 "key 259"
key_kp_enter "key 271"
key_kp_0 "key 256"
key_kp_period "key 266"
jbutton_0_0
jbutton_0_1
jaxis_0_1-
jaxis_0_1+
jaxis_0_0-
jaxis_0_0+
jbutton_0_2
jbutton_0_3
jbutton_1_0
jbutton_1_1
jaxis_0_2-
jaxis_0_2+
jaxis_0_3-
jaxis_0_3+
jaxis_1_0-
jaxis_1_0+
jaxis_1_1-
jaxis_1_1+
jbutton_0_4
jbutton_0_5
jhat_0_0_0
jhat_0_0_3
jhat_0_0_2
jhat_0_0_1
mod_1 "key 306" "key 305"
mod_2 "key 308" "key 307"
mod_3

==================================================

Now, the second section of the post; suggestions for other users running DOSBox under Linux, specifically regarding window-size in windowed mode and audio problems.

I prefer running DOSBox in windowed mode because game graphics are brighter and crisper on my LCD monitor than in full-screen mode. I also prefer the window's aspect-ratio to conform to legacy standards: 640x480, 800x600, etc. I am currently using an aspect-ratio of 800x600, although 1024x768 is also very acceptable. I use 800x600 when I want a second window opened to a game walkthrough (text file, html file, etc.). I can then have the game running in the top portion of the screen, while the text editor or web browser is running in the bottom portion.

To run DOSBox with an aspect-ratio of 800x600 and with the window enlarged for easy visibility, I use the following settings in /home/myuserID/.dosboxrc, with /home/myuserID/dosbox.conf being a carbon copy. See my complete /home/myuserID/.dosboxrc file at the end of this post.

fullscreen=false
windowresolution=800x600
aspect=true
scaler=normal3x

I was experiencing severe sound "stuttering" or drop-outs when running all games, but this problem was resolved after a considerable amount of "tweaking" of the "cycles" setting and a slight increase in the prebuffer setting, just for good measure. For best performance, DOSBox cycles should be fine-tuned for each, individual game, although the same "generic" cycles-setting will run more than one game acceptably. Simply by trial-and-error, I chanced to find the best "cycles" range for the MS-DOS games I now have installed: Doom, Doom 2, Heretic, Hexen, and Strife. I run all games mentioned, except Doom 2, at 10,000 cycles. Doom 2, for some reason unknown to me, demands at least 12,500 cycles for fluid graphics motion, while still avoiding any audio problems. I now have perfect sound effects and music, at least as "perfect" as possible. Sound effects still lag what I see on the screen by about one second, but are played without distortion; music is excellent. See my /home/myuserID/.dosboxrc file below. Also, note my system's hardware configuration. My "cycles" setting will not necessarily be your "cycles" setting.

So, my best recommendation, if you are experiencing DOSBox audio problems under Linux, is to spend considerable time experimenting with the "cycles" setting. Choose the highest setting that gives good, smooth game animation, until a point is reached where audio drop-outs are noticed. I suspect that the limit for each game can be resolved to a very defined range, but begin your testing in large increments, then try to "bracket" down to the optimal setting. Most importantly, do not compound the problem by trying to change too many settings at the same time. Doing that makes isolating any problem more difficult.

==================================================

# This is the configuration file for DOSBox 0.72.
# Lines starting with a # are comment lines.
# They are used to (briefly) document the effect of each option.
# Recommended cycles: Doom 10000; Doom2 12500; Heretic 10000; Hexen 10000; Strife 10000

[sdl]
# fullscreen -- Start dosbox directly in fullscreen.
# fulldouble -- Use double buffering in fullscreen.
# fullresolution -- What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# windowresolution -- Scale the window to this size IF the output device supports hardware scaling.
# output -- What to use for output: surface,overlay,opengl,openglnb.
# autolock -- Mouse will automatically lock, if you click on the screen.
# sensitiviy -- Mouse sensitivity.
# waitonerror -- Wait before closing the console if dosbox has an error.
# priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest,pause (when not focused).
# Second entry behind the comma is for when dosbox is not focused/minimized.
# mapperfile -- File used to load/save the key/event mappings from.
# usescancodes -- Avoid usage of symkeys, might not work on all operating systems.

fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=800x600
output=overlay
autolock=true
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=/home/myuserID/mapper.txt
usescancodes=true

[dosbox]
# language -- Select another language file.
# memsize -- Amount of memory DOSBox has in megabytes.
# machine -- The type of machine tries to emulate: hercules,cga,tandy,pcjr,vga.
# captures -- Directory where things like wave,midi,screenshot get captured.

language=
machine=vga
captures=/home/myuserID/msdos/temp/
memsize=16

[render]
# frameskip -- How many frames DOSBox skips before drawing one.
# aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler -- Scaler used to enlarge/enhance low resolution modes.
# Supported are none,normal2x,normal3x,advmame2x,advmame3x,hq2x,hq3x,
# 2xsai,super2xsai,supereagle,advinterp2x,advinterp3x,
# tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.
# If forced is appended (like scaler=hq2x forced), the scaler will be used
# even if the result might not be desired.

frameskip=0
aspect=true
scaler=normal3x

[cpu]
# core -- CPU Core used in emulation: normal,simple,dynamic,auto.
# auto switches from normal to dynamic if appropriate.
# cycles -- Amount of instructions DOSBox tries to emulate each millisecond.
# Setting this value too high results in sound dropouts and lags.
# You can also let DOSBox guess the correct value by setting it to max.
# The default setting (auto) switches to max if appropriate.
# cycleup -- Amount of cycles to increase/decrease with keycombo.
# cycledown Setting it lower than 100 will be a percentage.

core=auto
cycles=10000
cycleup=500
cycledown=20

[mixer]
# nosound -- Enable silent mode, sound is still emulated though.
# rate -- Mixer sample rate, setting any devices higher than this will
# probably lower their sound quality.
# blocksize -- Mixer block size, larger blocks might help sound stuttering
# but sound will also be more lagged.
# prebuffer -- How many milliseconds of data to keep on top of the blocksize.

nosound=false
rate=22050
blocksize=2048
prebuffer=30

[midi]
# mpu401 -- Type of MPU-401 to emulate: none, uart or intelligent.
# device -- Device that will receive the MIDI data from MPU-401.
# This can be default,alsa,oss,win32,coreaudio,none.
# config -- Special configuration options for the device. In Windows put
# the id of the device you want to use. See README for details.

mpu401=intelligent
device=oss
config=

[sblaster]
# sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.
# sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.
# mixer -- Allow the soundblaster mixer to modify the DOSBox mixer.
# oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.
# On auto the mode is determined by sblaster type.
# All OPL modes are 'Adlib', except for CMS.
# oplrate -- Sample rate of OPL music emulation.

sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=22050

[gus]
# gus -- Enable the Gravis Ultrasound emulation.
# gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the
# Gravis Ultrasound. (Same IRQ's and DMA's are OK.)
# gusrate -- Sample rate of Ultrasound emulation.
# ultradir -- Path to Ultrasound directory. In this directory
# there should be a MIDI directory that contains
# the patch files for GUS playback. Patch sets used
# with Timidity should work fine.

gus=false
gusrate=22050
gusbase=220
irq1=7
irq2=7
dma1=1
dma2=5
ultradir=/etc/timidity/freepats/freepats.cfg

[speaker]
# pcspeaker -- Enable PC-Speaker emulation.
# pcrate -- Sample rate of the PC-Speaker sound generation.
# tandy -- Enable Tandy Sound System emulation (off,on,auto).
# For auto Tandysound emulation is present only if machine is set to tandy.
# tandyrate -- Sample rate of the Tandy 3-Voice generation.
# disney -- Enable Disney Sound Source emulation. Covox Voice Master and Speech Thing compatible.

pcspeaker=false
pcrate=22050
tandy=auto
tandyrate=22050
disney=true

[joystick]
# joysticktype -- Type of joystick to emulate: auto (default), none,
# 2axis (supports two joysticks,
# 4axis (supports one joystick, first joystick used),
# 4axis_2 (supports one joystick, second joystick used),
# fcs (Thrustmaster), ch (CH Flightstick).
# none disables joystick emulation.
# auto chooses emulation depending on real joystick(s).
# timed -- enable timed intervals for axis. (false is old style behaviour).
# autofire -- continuously fires as long as you keep the button pressed.
# swap34 -- swap the 3rd and the 4th axis. can be useful for certain joysticks.
# buttonwrap -- enable button wrapping at the number of emulated buttons.

joysticktype=none
timed=true
autofire=false
swap34=false
buttonwrap=true

[serial]
# serial1-4 -- set type of device connected to com port.
# Can be disabled, dummy, modem, nullmodem, directserial.
# Additional parameters must be in the same line in the form of
# parameter:value. Parameter for all types is irq.
# for directserial: realport (required), rxdelay (optional).
# for modem: listenport (optional).
# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,
# transparent, port, inhsocket (all optional).
# Example: serial1=modem listenport:5000

serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
# xms -- Enable XMS support.
# ems -- Enable EMS support.
# umb -- Enable UMB support.
# keyboardlayout -- Language code of the keyboard layout (or none).

xms=true
ems=true
umb=true
keyboardlayout=US

[ipx]
# ipx -- Enable ipx over UDP/IP emulation.

ipx=false

[autoexec]
# Lines in this section will be run at startup.

==================================================

My system's hardware configuration follows:
--------------------------------------------------
Compaq Deskpro EN, Pentium III 933 MHz, 256 MB RAM, hp L1720 LCD monitor, Nvidia Riva TNT2 AGP Card, Canon BJC-610 Printer, Best Data 56SX92 External Serial Modem, Mandriva Linux 2007.0, kernel 2.6.17-5mdv, KDE 3.5.4, DOSBox 0.72 (compiled from source code)
--------------------------------------------------

Reply 1 of 2, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Hope it is okay for a non-Linux user to butt in...

I assume you have experimented with different types of output? I don't remember if it is NVIDIA or ATI/AMD, but one of them has a significant better (and faster?) OpenGL driver than the other.

Some of these output methods supports scaling the graphics directly in hardware, some do not. If you find a fast output method with hardware scaling, then I don't think there is any need to use the normal3x software scaler. And software scaling means more work for the CPU, so it might help.

Try upping the frameskip 1 or 2 notches. Do you see difference? Less CPU usage? Degraded screen updates?

Mixer and OPL rates? Try dropping down from 22050 to 11025. SoundBlaster emulation is very CPU demanding as pupnik has found out in his efforts to port DOSBox to a mobile device.

Self-compiled DOSBox? Sure you have all the relevant optimization flags turned on? Is that -O3 or something? Inline-assembly? Inline-replacement? Wiser folks than me should know.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 2 of 2, by Raymond C. Glassford

User metadata
Rank Newbie
Rank
Newbie
MiniMax wrote:
Hope it is okay for a non-Linux user to butt in ... […]
Show full quote

Hope it is okay for a non-Linux user to butt in ...

I assume you have experimented with different types of output? I don't remember if it is NVIDIA or ATI/AMD, but one of them has a significant better (and faster?) OpenGL driver than the other.

Some of these output methods supports scaling the graphics directly in hardware, some do not. If you find a fast output method with hardware scaling, then I don't think there is any need to use the normal3x software scaler. And software scaling means more work for the CPU, so it might help.

Try upping the frameskip 1 or 2 notches. Do you see difference? Less CPU usage? Degraded screen updates?

Mixer and OPL rates? Try dropping down from 22050 to 11025. SoundBlaster emulation is very CPU demanding as pupnik has found out in his efforts to port DOSBox to a mobile device.

Self-compiled DOSBox? Sure you have all the relevant optimization flags turned on? Is that -O3 or something? Inline-assembly? Inline-replacement? Wiser folks than me should know.

MiniMax comments are always welcome.

You raised many questions. Excuse me while I fill-out an enrollment form for my local university, apply for post-grad courses in computer science, and run to the mailbox.

Seriously, I do remember doing some experimentation with output variations and my present settings worked best. I also experimented with mixer rates ... lower, higher ... and, again, my present settings worked best. I also recall trying frameskip=1; again, current setting is good to go.

As far as the scaler=normal3x setting is concerned, that was recommended to me by another VOGONS member following my post. It serves to enlarge the window for easy visibility, yet not too large to completely cover a second open window on the screen.

When I compiled DOSBox, I followed instructions as carefully as possible, even taking time to print-out (hard copy) the instructions completely. So, I believe I made the best choices for my hardware and software configurations. Doing more than that would be approaching the realm of rocket science ... and I am just a mortal man.

Thanks very much, MiniMax. I will consider the issues you have raised, and by the time the next DOSBox version is released my feeble brain might be ready for new challenges. In the meantime, I am content and can sleep peacefully.