VOGONS


First post, by Annoying Moose

User metadata
Rank Newbie
Rank
Newbie

Hello.

I recently upgraded to Ubuntu Linux 8.10 (amd64), and have found that DOSBox no longer works correctly. Specifically, in every game I have tried so far, the sound has been lagged (and stuttering in games like DN3D) and while the keyboard otherwise seems to work, the arrow keys are completely non-responsive. I have not had these problems prior to upgrading. What is causing this, and how do I fix it?

Thanks for your help.

Reply 1 of 15, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Google not working for you?

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 15, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

lovely (thanks for wd for spotting this)

http://www.ubuntu.com/getubuntu/releasenotes/810
> The X keycodes generated with the new evdev input driver in X.Org
> 1.5 are not compatible with those generated in Ubuntu 8.04 LTS and
> before. If you have configured keybindings for your user with a
> ~/.Xmodmap file, you will need to convert or disable it by hand on upgrade.

this is what is happening. Who thought that it was smart to change the scancodes ?

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 15, by Annoying Moose

User metadata
Rank Newbie
Rank
Newbie
MiniMax wrote:

Google not working for you?

No, in fact. At least, I couldn't find anything relevant to my situation. Are you having a bad day? If you know that someone else has already suffered and resolved my problem, just redirect me and I'll be on my way.

Qbix wrote:

Sorry, I lied when I said I "upgraded". I have been distrustful of Ubuntu's upgrade feature ever since I tried upgrading to 7.10. I did a fresh drive format and install for 8.10.

Reply 4 of 15, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

just redirect me and I'll be on my way

Well he did that.

I did a fresh drive format and install for 8.10.

It seems inherent to 8.10, for whatever reason it seems like they changed
their keyboard stuff so they return different scancodes for part of the keys.

Reply 5 of 15, by Annoying Moose

User metadata
Rank Newbie
Rank
Newbie
wd wrote:

Well he did that.

Ah. When I followed the link the first time, I just saw an offensive gag page and clicked the back button within the first 5 seconds. Clearly, this "justfuckinggoogleit.com" thing is not a very practical substitute for just linking directly to the page. I hope we've all learned a lesson here today.

EDIT: Setting usescancodes=false in dosbox.conf has fixed the keyboard problem but not the sound issues.

Reply 6 of 15, by TeaRex

User metadata
Rank Member
Rank
Member

Setting usescancodes=false is not really an option if you don't use a U.S. English keybord layout in Linux. Arrow keys work, but a lot of the rest of the layout gets screwed up then.

Any idea on how to get to the root of the problem? (beyond "don't use Ubuntu" or "switch your Linux to U.S. English every time you use DOSBox" that is).

Are the used keycodes defined in SDL or in DOSBox proper?

tearex

Reply 7 of 15, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Setting usescancodes=false is not really an option

Yes i know, directly using scancodes was added only for non-us keyboards.

Any idea on how to get to the root of the problem?

Nope.

Are the used keycodes defined in SDL or in DOSBox proper?

The scancodes are what SDL passes to dosbox, which is a direct passthrough
of some os-specific codes. So if the os changes them for some reason, we need
to have a way to detect when to use the new decoding scheme (meanwhile hating
the ones who changed the scancodes) and adapting the decoding.

Reply 8 of 15, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
Annoying Moose wrote:

Clearly, this "justfuckinggoogleit.com" thing is not a very practical substitute for just linking directly to the page. I hope we've all learned a lesson here today.

Jesus thinks otherwise. Instead of giving you a fish and feed you for one day, I am learning you how to fish so you may be feed every day.

Speaking of learning - did you follow the link in my signature on How To Ask Questions? No? I thought as much...

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 9 of 15, by TeaRex

User metadata
Rank Member
Rank
Member

Alright, seems like evdev on Ubuntu 8.10 uses the file /usr/share/X11/xkb/keycodes/evdev to map evdev key names to X scancodes.

I'm attaching the file here. Does this look like a likely culprit? Especially, UP DOWN LEFT RIGHT are mapped to 111 116 113 114.

By the way, the keypad keys are not affected by the problem. So at least you can mentally go back to the age of 84-key keyboards and give that stuck-from-disuse NumLock key a workout... 😁

// translation from evdev scancodes to something resembling xfree86 keycodes.

default xkb_keycodes "evdev" {
minimum = 8;
maximum = 255;

# Added for pc105 compatibility
<LSGT> = 94;

<TLDE> = 49;
<AE01> = 10;
<AE02> = 11;
<AE03> = 12;
<AE04> = 13;
<AE05> = 14;
<AE06> = 15;
<AE07> = 16;
<AE08> = 17;
<AE09> = 18;
<AE10> = 19;
<AE11> = 20;
<AE12> = 21;
<BKSP> = 22;

<TAB> = 23;
<AD01> = 24;
<AD02> = 25;
<AD03> = 26;
<AD04> = 27;
<AD05> = 28;
<AD06> = 29;
<AD07> = 30;
<AD08> = 31;
<AD09> = 32;
<AD10> = 33;
<AD11> = 34;
<AD12> = 35;
<BKSL> = 51;
<RTRN> = 36;

<CAPS> = 66;
<AC01> = 38;
<AC02> = 39;
<AC03> = 40;
<AC04> = 41;
<AC05> = 42;
<AC06> = 43;
<AC07> = 44;
<AC08> = 45;
<AC09> = 46;
<AC10> = 47;
<AC11> = 48;

<LFSH> = 50;
<AB01> = 52;
<AB02> = 53;
<AB03> = 54;
<AB04> = 55;
<AB05> = 56;
<AB06> = 57;
Show last 260 lines
	<AB07> = 58;
<AB08> = 59;
<AB09> = 60;
<AB10> = 61;
<RTSH> = 62;

<LALT> = 64;
<LCTL> = 37;
<SPCE> = 65;
<RCTL> = 105;
<RALT> = 108;
// Microsoft keyboard extra keys
<LWIN> = 133;
<RWIN> = 134;
<COMP> = 135;
alias <MENU> = <COMP>;

<ESC> = 9;
<FK01> = 67;
<FK02> = 68;
<FK03> = 69;
<FK04> = 70;
<FK05> = 71;
<FK06> = 72;
<FK07> = 73;
<FK08> = 74;
<FK09> = 75;
<FK10> = 76;
<FK11> = 95;
<FK12> = 96;

<PRSC> = 107;
// <SYRQ> = 107;
<SCLK> = 78;
<PAUS> = 127;
// <BRK> = 419;

<INS> = 118;
<HOME> = 110;
<PGUP> = 112;
<DELE> = 119;
<END> = 115;
<PGDN> = 117;

<UP> = 111;
<LEFT> = 113;
<DOWN> = 116;
<RGHT> = 114;

<NMLK> = 77;
<KPDV> = 106;
<KPMU> = 63;
<KPSU> = 82;

<KP7> = 79;
<KP8> = 80;
<KP9> = 81;
<KPAD> = 86;

<KP4> = 83;
<KP5> = 84;
<KP6> = 85;

<KP1> = 87;
<KP2> = 88;
<KP3> = 89;
<KPEN> = 104;

<KP0> = 90;
<KPDL> = 91;
<KPEQ> = 125;

<FK13> = 191;
<FK14> = 192;
<FK15> = 193;
<FK16> = 194;
<FK17> = 195;
<FK18> = 196;
<FK19> = 197;
<FK20> = 198;
<FK21> = 199;
<FK22> = 200;
<FK23> = 201;
<FK24> = 202;

// Keys that are generated on Japanese keyboards

<HZTG> = 93; // Hankaku/Zenkakau toggle
<HKTG> = 101; // Hiragana/Katakana toggle
<AB11> = 97; // backslash/underscore
<HENK> = 100; // Henkan
<MUHE> = 102; // Muhenkan
<AE13> = 132; // Yen
<KATA> = 98; // Katakana
<HIRA> = 99; // Hiragana
<JPCM> = 103; // KPJPComma
//<RO> = 97; // Romaji

// Keys that are generated on Korean keyboards

<HNGL> = 130; // Hangul Latin toggle
<HJCV> = 131; // Hangul to Hanja conversion

// Solaris compatibility

alias <LMTA> = <LWIN>;
alias <RMTA> = <RWIN>;
<MUTE> = 121;
<VOL-> = 122;
<VOL+> = 123;
<POWR> = 124;
<STOP> = 136;
<AGAI> = 137;
<PROP> = 138;
<UNDO> = 139;
<FRNT> = 140;
<COPY> = 141;
<OPEN> = 142;
<PAST> = 143;
<FIND> = 144;
<CUT> = 145;
<HELP> = 146;

// Extended keys that may be generated on "Internet" keyboards.
// evdev has standardize names for these.

<LNFD> = 109; // #define KEY_LINEFEED 101
<I120> = 120; // #define KEY_MACRO 112
<I126> = 126; // #define KEY_KPPLUSMINUS 118
<I129> = 129; // #define KEY_KPCOMMA 121
<I147> = 147; // #define KEY_MENU 139
<I148> = 148; // #define KEY_CALC 140
<I149> = 149; // #define KEY_SETUP 141
<I150> = 150; // #define KEY_SLEEP 142
<I151> = 151; // #define KEY_WAKEUP 143
<I152> = 152; // #define KEY_FILE 144
<I153> = 153; // #define KEY_SENDFILE 145
<I154> = 154; // #define KEY_DELETEFILE 146
<I155> = 155; // #define KEY_XFER 147
<I156> = 156; // #define KEY_PROG1 148
<I157> = 157; // #define KEY_PROG2 149
<I158> = 158; // #define KEY_WWW 150
<I159> = 159; // #define KEY_MSDOS 151
<I160> = 160; // #define KEY_COFFEE 152
<I161> = 161; // #define KEY_DIRECTION 153
<I162> = 162; // #define KEY_CYCLEWINDOWS 154
<I163> = 163; // #define KEY_MAIL 155
<I164> = 164; // #define KEY_BOOKMARKS 156
<I165> = 165; // #define KEY_COMPUTER 157
<I166> = 166; // #define KEY_BACK 158
<I167> = 167; // #define KEY_FORWARD 159
<I168> = 168; // #define KEY_CLOSECD 160
<I169> = 169; // #define KEY_EJECTCD 161
<I170> = 170; // #define KEY_EJECTCLOSECD 162
<I171> = 171; // #define KEY_NEXTSONG 163
<I172> = 172; // #define KEY_PLAYPAUSE 164
<I173> = 173; // #define KEY_PREVIOUSSONG 165
<I174> = 174; // #define KEY_STOPCD 166
<I175> = 175; // #define KEY_RECORD 167
<I176> = 176; // #define KEY_REWIND 168
<I177> = 177; // #define KEY_PHONE 169
<I178> = 178; // #define KEY_ISO 170
<I179> = 179; // #define KEY_CONFIG 171
<I180> = 180; // #define KEY_HOMEPAGE 172
<I181> = 181; // #define KEY_REFRESH 173
<I182> = 182; // #define KEY_EXIT 174
<I183> = 183; // #define KEY_MOVE 175
<I184> = 184; // #define KEY_EDIT 176
<I185> = 185; // #define KEY_SCROLLUP 177
<I186> = 186; // #define KEY_SCROLLDOWN 178
<I187> = 187; // #define KEY_KPLEFTPAREN 179
<I188> = 188; // #define KEY_KPRIGHTPAREN 180
<I189> = 189; // #define KEY_NEW 181
<I190> = 190; // #define KEY_REDO 182
<I208> = 208; // #define KEY_PLAYCD 200
<I209> = 209; // #define KEY_PAUSECD 201
<I210> = 210; // #define KEY_PROG3 202
<I211> = 211; // #define KEY_PROG4 203
<I213> = 213; // #define KEY_SUSPEND 205
<I214> = 214; // #define KEY_CLOSE 206
<I215> = 215; // #define KEY_PLAY 207
<I216> = 216; // #define KEY_FASTFORWARD 208
<I217> = 217; // #define KEY_BASSBOOST 209
<I218> = 218; // #define KEY_PRINT 210
<I219> = 219; // #define KEY_HP 211
<I220> = 220; // #define KEY_CAMERA 212
<I221> = 221; // #define KEY_SOUND 213
<I222> = 222; // #define KEY_QUESTION 214
<I223> = 223; // #define KEY_EMAIL 215
<I224> = 224; // #define KEY_CHAT 216
<I225> = 225; // #define KEY_SEARCH 217
<I226> = 226; // #define KEY_CONNECT 218
<I227> = 227; // #define KEY_FINANCE 219
<I228> = 228; // #define KEY_SPORT 220
<I229> = 229; // #define KEY_SHOP 221
<I230> = 230; // #define KEY_ALTERASE 222
<I231> = 231; // #define KEY_CANCEL 223
<I232> = 232; // #define KEY_BRIGHTNESSDOWN 224
<I233> = 233; // #define KEY_BRIGHTNESSUP 225
<I234> = 234; // #define KEY_MEDIA 226
<I235> = 235; // #define KEY_SWITCHVIDEOMODE 227
<I236> = 236; // #define KEY_KBDILLUMTOGGLE 228
<I237> = 237; // #define KEY_KBDILLUMDOWN 229
<I238> = 238; // #define KEY_KBDILLUMUP 230
<I239> = 239; // #define KEY_SEND 231
<I240> = 240; // #define KEY_REPLY 232
<I241> = 241; // #define KEY_FORWARDMAIL 233
<I242> = 242; // #define KEY_SAVE 234
<I243> = 243; // #define KEY_DOCUMENTS 235
<I244> = 244; // #define KEY_BATTERY 236
<I245> = 245; // #define KEY_BLUETOOTH 237
<I246> = 246; // #define KEY_WLAN 238
<I247> = 247; // (not defined in input.h) 239
<I248> = 248; // #define KEY_UNKNOWN 240
<I249> = 249; // #define KEY_VIDEO_NEXT 241
<I250> = 250; // #define KEY_VIDEO_PREV 242
<I251> = 251; // #define KEY_BRIGHTNESS_CYCLE 243
<I252> = 252; // #define KEY_BRIGHTNESS_ZERO 244
<I253> = 253; // #define KEY_DISPLAY_OFF 245

// Fake keycodes for virtual keys
<LVL3> = 92;
<MDSW> = 203;
<ALT> = 204;
<META> = 205;
<SUPR> = 206;
<HYPR> = 207;

indicator 1 = "Caps Lock";
indicator 2 = "Num Lock";
indicator 3 = "Scroll Lock";
indicator 4 = "Compose";
indicator 5 = "Kana";
indicator 6 = "Sleep";
indicator 7 = "Suspend";
indicator 8 = "Mute";
indicator 9 = "Misc";
indicator 10 = "Mail";
indicator 11 = "Charging";

alias <ALGR> = <RALT>;
};

// For japanese 106 keyboard.
xkb_keycodes "jp106" {
include "evdev(evdev)"
<HZTG> = 49;
<AC12> = 51;
};

// For brazilian ABNT2 keyboard.
xkb_keycodes "abnt2" {
include "evdev(evdev)"
};

// PC98
xkb_keycodes "pc98" {
include "evdev(evdev)"
};

tearex

Reply 10 of 15, by Annoying Moose

User metadata
Rank Newbie
Rank
Newbie
MiniMax wrote:

Speaking of learning - did you follow the link in my signature on How To Ask Questions? No? I thought as much...

Several things:

  1. You didn't post - allowing me to see your signature - until after I had already asked my question.
  2. I refuse to believe that you've never encountered people on the Internet who don't expect to find useful information in another person's siggy and thus don't even bother reading it.
  3. Everything in "How To Ask Questions" I either heeded or believe is bullshit.

I did a quick search of this forum, the Ubuntu forums, and Google (despite my not being very good at it, usually ending up so general I have millions of results, or so specific the information I want isn't there at all) and read the DOSBox manual before posting here. I chose this forum instead of the Ubuntu forums because my problem regards DOSBox, not Ubuntu. I probably should've guessed that the problem originates in Ubuntu, but there's also the thing where DOSBox is the only application I'm having this trouble with. Finally, if mine is your idea of a stupid, hasty, and rudely-phrased question, perhaps you'd better take another look at the Internet, starting with this forum.

But what really irks me is your attitude towards etiquette. Tell me, if you had an issue of your own (not necessarily DOSBox or even Linux-related), researched it (for good measure, pretend like you're like me and just happen to not be skilled at it), couldn't find a solution on your own, and finally resorted to posting on a forum, which of these responses would you rather receive?

  1. Your issue has already been discussed at http://awebsite.com/page.
  2. Sorry if I'm wrong, but http://awebsite.com/page wasn't down last I checked, idiot.

Heck, you can even leave out that last word from response (b); it's not only rude, but actually less "to the point" (I quote from HTAQ) than response (a). Call me naïve to say that everyone should be polite to each other all the time, but I don't see how it's less naïve than saying that everyone who has the misfortune to be on the receiving end should just be able to "suck it up".

My, it looks like I've gone on a bit of a rant. Seriously, compare the tone of this post with the first one I made. I even made a swear (I can't seem to find the forum code of conduct - irony FTW! - so I hope I'm allowed to do that). I'm thinking I should just leave and never come back again after I find the sound-issue solution I came here for in the first place. You won't miss me, and I sure as heck won't miss you. It sounds like a win-win scenario to me.

Reply 11 of 15, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

There's some stuff about sound stuttering in the readme/dosbox config file,
but guess you already tried that.

Oh and MiniMax is not rude, he just wants to actually SEE that you researched
before posting something (which is not implied in your first posting). But hope
you'll get over it, having fun with, ...something.

Reply 12 of 15, by Annoying Moose

User metadata
Rank Newbie
Rank
Newbie

Okay, I'm feeling better now. I apologize for my earlier outburst. Yes, I had already tried increasing and decreasing the mixer block size. Setting it to 2^9 reduced the lag to negligibility but increased the stuttering, and setting it to 2^13 made the lag murderously insane while significantly reducing but not eliminating the stuttering. Setting it to 2^10 or 2^12 had no noticeable effects.

Reply 13 of 15, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Alright, seems like evdev on Ubuntu 8.10 uses the file /usr/share/X11/xkb/keycodes/evdev to map evdev key names to X scancodes.

So what was pre-8.10 using, not evdev or also evdev just with a different
(or no) scancode remapping? Do you think there's a way to detect that
difference somehow?

Thanks for the info you posted.

Reply 14 of 15, by TeaRex

User metadata
Rank Member
Rank
Member

As I understand it, 8.04 didn't use evdev for the keyboard yet. Checking this will take some time though since currently I don't have it installed any more, nor have I retained the CD. So I'll have to re-download it to check.

tearex

Reply 15 of 15, by TeaRex

User metadata
Rank Member
Rank
Member

I've not checked Ubuntu 8.04 yet, but I've distilled down the difference between the two keycode sets. Since we're talking DOS here I've removed all the keys that don't exist on the 101/102 key MF-II.

Here's the old XFree86 set:

<RCTL> = 109;
<RALT> = 113;
<PRSC> = 111;
<SYRQ> = 92;
<PAUS> = 110;
<BRK> = 114;
<INS> = 106;
<HOME> = 97;
<PGUP> = 99;
<DELE> = 107;
<END> = 103;
<PGDN> = 105;
<UP> = 98;
<LEFT> = 100;
<DOWN> = 104;
<RGHT> = 102;
<KPDV> = 112;
<KPEN> = 108;

And here's the new evdev codes (note that SysRq and Break don't have their own keycodes any more):

<RCTL> = 105;
<RALT> = 108;
<PRSC> = 107;
<PAUS> = 127;
<INS> = 118;
<HOME> = 110;
<PGUP> = 112;
<DELE> = 119;
<END> = 115;
<PGDN> = 117;
<UP> = 111;
<LEFT> = 113;
<DOWN> = 116;
<RGHT> = 114;
<KPDV> = 106;
<KPEN> = 104;

Hope this helps. Now the question remains, how to find out which set to use....

tearex