joosebox
Posts: 1
Joined: Sun Aug 18, 2019 3:09 am

minecraft-pi not launching

Sun Aug 18, 2019 3:13 am

Hi. Im new to the Raspberry Pi but am trying to help my son with something. He just set up his new Pi4 and is trying to run minecraft-pi but a window just pops up and closes when he tries to run it from the GUI. When I try and run it from the command line, I get the following error...
pi@raspberrypi:~ $ minecraft-pi
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x383
Serial number of failed request: 137
Current serial number in output stream: 139
pi@raspberrypi:~ $

I've tried searching for this but have been unsuccessful in finding a solution so far. Any help would be appreciated.

Thanks!

auretrainaud
Posts: 2
Joined: Sun Aug 18, 2019 4:50 pm

Re: minecraft-pi not launching

Sun Aug 18, 2019 4:58 pm

hi
I have also this problem but when i tape "minecraft-pi" on my terminal he tells me "* failed to add service - already in use?"
sorry for misspelling

User avatar
HawaiianPi
Posts: 6819
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: minecraft-pi not launching

Sun Aug 18, 2019 5:36 pm

What OS, and how was it installed?

Assuming Raspbian Buster with desktop (or with desktop and recommended software), try the following.

Open a terminal and type,

Code: Select all

sudo apt update && sudo apt full-upgrade -y
If that finishes without error, reboot, then see if it works.

FYI:
I just installed it on my Pi 4B 4GB model with recently updated Raspbian Buster with desktop and it seems to work fine (launches and plays from the GUI menu or terminal, with no errors).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

auretrainaud
Posts: 2
Joined: Sun Aug 18, 2019 4:50 pm

Re: minecraft-pi not launching

Wed Aug 21, 2019 5:03 pm

this is not good :cry:

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Wed Aug 21, 2019 5:20 pm

Welcome @auretrainaud. What appears to have happened in your case is that the wrapper script (/usr/bin/minecraft-pi) for some reason ran minecraft-pi in legacy mode even though you're running in fkms. You can try forcing it to run with Mesa:

Code: Select all

(cd /opt/minecraft-pi && \
  LD_PRELOAD=libbcm_host.so.1.0 LD_LIBRARY_PATH=lib/mesa ./minecraft-pi)
If that workaround is sufficient, you may wish to debug the wrapper script and let us know why it's not detecting V3D. Or if this doesn't work, let's check assumptions to see if you're actually in KMS or fake KMS (check /boot/config.txt, and lsmod | grep vc4) then proceed from there.

joosebox, your problem is less clear because as HawaiianPi said minecraft-pi normally works out of the box on Buster. Have you changed the windowing system or is there anything special about your monitor? Run:

Code: Select all

xrandr -q
to diagnose.

User avatar
pi-tastic
Posts: 173
Joined: Mon Jul 29, 2019 6:34 pm

Re: minecraft-pi not launching

Wed Aug 21, 2019 8:56 pm

just tried it on my pi4 and it does nothing when i click on it.

can i download the minecraft.deb and run that on this by chance? the real version is more fun.
maccaps.com - bringing life to dead electronics.

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Wed Aug 21, 2019 11:27 pm

pi-tastic wrote:
Wed Aug 21, 2019 8:56 pm
just tried it on my pi4 and it does nothing when i click on it.
What error do you see when you type minecraft-pi at the terminal? This could help match up against the two different errors other users are seeing above.
can i download the minecraft.deb and run that on this by chance? the real version is more fun.
Minecraft Java Edition for Pi looks unlikely to become a standalone deb or ppa in the near future due to its setup process tying to a user's homedir and dependency on Java 8 and OptiFine (both of which also lack debpackage installations). If it's so much more fun, it should still be worth your time to walk through one of the installation tutorials from the Gaming subforum.

Litusiano
Posts: 2
Joined: Sun Jan 12, 2020 8:50 am

Minecraft-pi not launching

Sun Jan 12, 2020 12:50 pm

I tried all the solutions in forum but anything works. When I start minecraft by terminal tells me this:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x387
Serial number of failed request: 137
Current serial number in output stream: 139
But when I start it by the desktop tells me this:
Failed to execute child process "xterm"(No such file or directory)

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Sun Jan 12, 2020 11:13 pm

Welcome to the forums and based on your other post it sounds like you're connecting to a TV. The OP here never followed up, but now we know that was likely the differentiating factor.

Do you get the identical error message with both Mesa and the legacy driver? To switch between those two run sudo raspi-config and find the graphics options. Note if you're on a Pi 4B, Zero, or classic, then you practically have only one option, but it would be good to clarify which one you're testing.

To get past the xterm error, run sudo apt-get install -y xterm. It might not solve everything but at least there's a chance of getting an xterm window with more information.

Lastly to follow up on your question in the other thread about alternate resolutions, run:

Code: Select all

    xrandr -q
and post the output here so we can see exactly what your default resolution is and the available alternatives.

User avatar
HawaiianPi
Posts: 6819
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: minecraft-pi not launching

Mon Jan 13, 2020 12:48 am

Those are odd errors. Does Raspbian/Debian still use XFree86? I thought that fell out of favor long ago, due to changes in licensing?

And why would Xterm need to be installed?

With Raspbian Buster (or the previous version, Stretch), I have no such errors.

What are people doing to get those errors?

EDIT:

My Pi4 configuration is as follows.
  • Raspberry Pi 4B 4GB (in Flirc case).
  • Raspbian Buster with desktop.
  • Official USB-C 15.3W (5.1V/3A) power supply.
  • SanDisk Ultra A1 32GB micro SD card.
  • OS has been fully upgraded with sudo apt update && sudo apt full-upgrade -y
  • I have also installed the 64-bit kernel and multiarch support (but I doubt that matters).
My Pi3 configuration is as follows.
  • Raspberry Pi 3B (in 2 layer acrylic case with fan).
  • Raspbian Stretch with desktop.
  • Official micro USB (5.1V/2.5A) Universal power supply.
  • Silicon Power A55 256GB SATA-III SSD with generic USB adapter cable.
  • OS has been fully upgraded with sudo apt update && sudo apt full-upgrade -y
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Mon Jan 13, 2020 3:03 am

HawaiianPi wrote:
Mon Jan 13, 2020 12:48 am
What are people doing to get those errors?
As mentioned above, and in the linked post, the differentiating factor tends to be connecting to a TV rather than a standard computer monitor.

The different resolutions as well as sometimes an interlaced display mode are known to cause problems for LWJGL (with Minecraft Java Edition) as well.

The opcodes and other names still tend to say XFree86 even if it's actually implemented in Xorg.

D3FALT
Posts: 8
Joined: Mon Feb 03, 2020 6:05 pm

Re: minecraft-pi not launching

Tue Feb 04, 2020 3:08 pm

I have the same problem :(. Anyone know the solotion for this. I tried update and it's not working. When I opening the black screen turns on and closes after a few second. Anyone know the solotion for this.

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Fri Feb 07, 2020 3:03 am

Same problem, as in you also see X Error of failed request: BadValue and the other error text as described in the first post? (Provided you run minecraft-pi from the terminal, not the start menu)

If so run

Code: Select all

xrandr -q
and report back what at says.

D3FALT
Posts: 8
Joined: Mon Feb 03, 2020 6:05 pm

Re: minecraft-pi not launching

Fri Feb 07, 2020 10:25 am

Thank you for responding! Yes, I have the same problem. This is what I see when I run xrandr -q:
Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 7680 x 7680
HDMI-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 609mm x 355mm
2560x1440 59.95*+
3840x2160 30.00 25.00 24.00 29.97 23.98
1920x1080 60.00 60.00 60.00 50.00 50.00 59.94 59.94
1680x1050 59.88
1280x1024 75.02 60.02
1440x900 59.90
1280x960 60.00
1152x864 75.00
1280x720 60.00 60.00 50.00 59.94
1440x576 50.00 50.00
1024x768 75.03 70.07 60.00
1440x480 60.00 60.00 59.94 59.94
800x600 72.19 75.00 60.32 56.25
720x576 50.00 50.00
720x480 60.00 60.00 59.94 59.94
640x480 75.00 72.81 66.67 60.00 59.94 59.94
720x400 70.08

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Tue Feb 11, 2020 10:39 pm

I thought I had a monitor where I could test your identical situation, but I tested it just now and it turns out this one is 2560x1600, not 2560x1440. My 2560x1600 config works.

1080p is the tried and true configuration that works for most of us, and apparently you have that available. Could you run:

Code: Select all

xrandr -s 1920x1080
If that works, your desktop will then clearly show in a lower resolution. At that point try running minecraft-pi again.

D3FALT
Posts: 8
Joined: Mon Feb 03, 2020 6:05 pm

Re: minecraft-pi not launching

Wed Feb 12, 2020 6:37 pm

I tried this command and it changed the resoulution, but when I start minecraft-pi by command i see the same error:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x383
Serial number of failed request: 137
Current serial number in output stream: 139

nightsky_sk
Posts: 1
Joined: Thu Apr 16, 2020 11:44 am

Re: minecraft-pi not launching

Thu Apr 16, 2020 11:47 am

I've got the same error, with my display :( Any other recommended solution?

jdonald
Posts: 449
Joined: Fri Nov 03, 2017 4:36 pm

Re: minecraft-pi not launching

Fri Apr 17, 2020 11:33 pm

Sorry the last attempt didn't work out. This time, one thing I spot in D3FALT's settings is that the TV is a max resolution of 7680x7680. I wonder if minecraft-pi is trying to XF86VidModeSwitchToMode into that and failing.

nightsky_sk can you post the output of your

Code: Select all

xrandr -q
so I can get an idea if there's anything in common?

grigorye
Posts: 1
Joined: Tue May 26, 2020 5:43 am

Re: minecraft-pi not launching

Tue May 26, 2020 5:51 am

I also suffer from this:

Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)

But it looks like switching to native resolution (4K/3840x2160) helped in my case. (Typically I run in 2560x1440).
Any other resultion results in the above error.

Code: Select all

Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 7680 x 7680
HDMI-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 608mm x 345mm
   3840x2160     30.00*+  25.00    24.00    29.97    23.98  
   2560x1440     59.95  
   1920x1080     60.00    60.00    50.00    50.00    59.94    30.00    24.00    29.97    23.98  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x800      59.91  
   1152x864      75.00  
   1280x720      60.00    60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  

fastfret888
Posts: 1
Joined: Fri Feb 26, 2021 12:24 pm

Re: minecraft-pi not launching

Fri Feb 26, 2021 12:27 pm

Install this modded version of Minecraft Pi:

https://github.com/MCPI-Revival

Works like a charm on any resolution :)

FlynnTheAvatar
Posts: 16
Joined: Wed Apr 07, 2021 6:23 pm

Re: minecraft-pi not launching

Wed Apr 07, 2021 6:45 pm

The root cause is this wrapper (https://github.com/XECDesign/mcrpi-wrapper) used by Raspbian's/Raspberry OS' version of minecraft-pi.

It tries to open a rather big fullscreen (2560x1700 pixels). This fails on all systems not using a 4K monitor, and SDL falls back to a window.

Check out the project above, apply the diff, run "make" and replace the libbcm_host.so.1.0 in /opt/minecraft-pi/lib/mesa.

You might need to install a few dev packages to compile the wrapper:

Code: Select all

sudo apt install libgle-dev libgles-dev libsdl-dev
Diff:

Code: Select all

diff --git a/bcm_host.c b/bcm_host.c
index 05ef0cc..4420846 100644
--- a/bcm_host.c
+++ b/bcm_host.c
@@ -359,10 +359,10 @@ counter = 1;


 int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) {
-       *width = 2560;
-       *height = 1700;
+       *width = 640;
+       *height = 480;

-       SDL_SetVideoMode(*width, *height, 32, SDL_FULLSCREEN);// | SDL_RESIZABLE);
+       SDL_SetVideoMode(*width, *height, 32, SDL_RESIZABLE);
        SDL_ShowCursor (SDL_DISABLE);
        return 0;
 }
This will also allow minecraft-pi to run with 4k monitor, if you reduce the screen resolution to 1080p.

Unounited
Posts: 74
Joined: Wed Oct 21, 2020 1:48 pm

Re: minecraft-pi not launching

Mon Apr 12, 2021 2:57 pm

I had the problem once when I launched minecraft and the screen was black. When that happened I assumed there was a setting that made it happen, unfortunately I don't know what the setting is.

iandol
Posts: 5
Joined: Sun Jan 31, 2021 3:12 am

Re: minecraft-pi not launching

Sat Apr 17, 2021 5:03 am

This remains a problem on the latest Rasbperry Pi OS (RPi 400 32bit fully updated using FKMS). Why not remove Minecraft-pi from the distribution if the patches cannot be applied by default? I use 1920x1080 although my display is 4K native.

Code: Select all

\u276f xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 7680 x 7680
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 195mm
   3840x2160     30.00    29.97  
   2560x1440     59.95  
   1920x1080     60.00*   60.00    50.00    59.94  
   1920x1080i    60.00    59.94  
   1400x1050     59.95  
   1280x1024     60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x480       60.00    59.94  
   640x480       60.00    59.94  


FlynnTheAvatar
Posts: 16
Joined: Wed Apr 07, 2021 6:23 pm

Re: minecraft-pi not launching

Sat Apr 17, 2021 5:53 am

It looks like they just used the wrapper without understanding what it does. And for non-4k minitors, everything seems to work fine.

Did you already try my patched version of the wrapper? I forked the wrapper and added my changes: https://github.com/josefwegner/mcrpi-wr ... pen-window

If you trust a random person on the internet, you could use my compiled wrapper:
libbcm_host.so.1.0.tar.gz
(4.86 KiB) Downloaded 57 times
Does it work for you, too?

Return to “Gaming”