Linux xbmc very slow when run as non-privileged user
#1
Hi,

Installed xbmc on debian with xfce4. I use autologin to non-privileged user, start xfce from .bash_profile, and load xbmc on xfce startup.

Problem: xbmc is so slow it's totally not usable. Even mouse position updates once every 5 seconds or so.

If I run xbmc as root, everything works perfect.
As a temp solution, i have setuid xbmc.bin, which also works fine, but I don't like this mode for a number of reasons.

Anyone has had any similar problems?

The log file below. Any help would be very appreciated Smile

Code:
more xbmc.log
10:40:18 T:3007780656  NOTICE: -----------------------------------------------------------------------
10:40:18 T:3007780656 WARNING: Unable to determine Linux distribution
10:40:18 T:3007780656  NOTICE: Starting XBMC (11.0 Git:Unknown), Platform: Linux (Unknown, 3.2.0-2-686-pae i686). Built on May 10 2012
10:40:18 T:3007780656  NOTICE: special://xbmc/ is mapped to: /usr/share/xbmc
10:40:18 T:3007780656  NOTICE: special://xbmcbin/ is mapped to: /usr/lib/xbmc
10:40:18 T:3007780656  NOTICE: special://masterprofile/ is mapped to: /home/telikas/.xbmc/userdata
10:40:18 T:3007780656  NOTICE: special://home/ is mapped to: /home/telikas/.xbmc
10:40:18 T:3007780656  NOTICE: special://temp/ is mapped to: /home/telikas/.xbmc/temp
10:40:18 T:3007780656  NOTICE: The executable running is: /usr/lib/xbmc/xbmc.bin
10:40:18 T:3007780656  NOTICE: Local hostname: debian
10:40:18 T:3007780656  NOTICE: Log File is located: /home/telikas/.xbmc/temp/xbmc.log
10:40:18 T:3007780656  NOTICE: -----------------------------------------------------------------------
10:40:18 T:3007780656  NOTICE: Setup SDL
10:40:19 T:3007780656  NOTICE: load settings...
10:40:19 T:3007780656  NOTICE: special://profile/ is mapped to: special://masterprofile/
10:40:19 T:3007780656  NOTICE: loading special://masterprofile/guisettings.xml
10:40:19 T:3007780656  NOTICE: Getting hardware information now...
10:40:19 T:3007780656  NOTICE: Checking resolution 12
10:40:19 T:3007780656  NOTICE: Loading player core factory settings from special://xbmc/system/playercorefactory.xml.
10:40:19 T:3007780656  NOTICE: Loaded playercorefactory configuration
10:40:19 T:3007780656  NOTICE: Loading player core factory settings from special://masterprofile/playercorefactory.xml.
10:40:19 T:3007780656  NOTICE: special://masterprofile/playercorefactory.xml does not exist. Skipping.
10:40:19 T:3007780656  NOTICE: No settings file to load (special://xbmc/system/advancedsettings.xml)
10:40:19 T:3007780656  NOTICE: No settings file to load (special://masterprofile/advancedsettings.xml)
10:40:19 T:3007780656  NOTICE: Default DVD Player: dvdplayer
10:40:19 T:3007780656  NOTICE: Default Video Player: dvdplayer
10:40:19 T:3007780656  NOTICE: Default Audio Player: paplayer
10:40:19 T:3007780656  NOTICE: Disabled debug logging due to GUI setting. Level 0.
10:40:19 T:3007780656  NOTICE: Log level changed to 0
10:40:19 T:3007780656  NOTICE: Loading media sources from special://masterprofile/sources.xml
10:40:20 T:3007780656  NOTICE: Using visual 0x22
10:40:20 T:3007780656  NOTICE: GL_VENDOR = Mesa Project
10:40:20 T:3007780656  NOTICE: GL_RENDERER = Software Rasterizer
10:40:20 T:3007780656  NOTICE: GL_VERSION = 2.1 Mesa 7.11.2
10:40:20 T:3007780656  NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.20
10:40:20 T:3007780656  NOTICE: GL_EXTENSIONS = GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_logic_op GL_
EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_paletted_texture GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_text
ure_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_paramet
ers GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EX
T_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_multit
exture GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_3DFX_texture_compression_FXT1 GL_ARB_texture_cube_map GL_ARB_tex
ture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EX
T_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_MESA_resize_buffers GL_NV_b
lend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_SUN_multi_draw_arrays GL_ARB_texture_border
_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_shared_texture_palette GL_EXT_texture_env_dot3 GL_MESA_window_pos G
L_NV_packed_depth_stencil GL_NV_texture_rectangle GL_NV_vertex_program GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_AR
B_shadow_ambient GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_
window_pos GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_depth_clamp GL_NV_fragme
nt_program GL_NV_point_sprite GL_NV_vertex_program1_1 GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ARB_draw_buffers GL_ARB_f
ragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_tex
ture_env_combine3 GL_EXT_depth_bounds_test GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_MESA_ycbcr_texture GL_ARB_de
pth_clamp GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_1
00 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separa
te GL_OES_read_format GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_rectangle GL_ATI_texture_compression_3
dc GL_EXT_pixel_buffer_object GL_EXT_texture_compression_rgtc GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle GL_EXT_texture_sRGB
GL_EXT_texture_shared_exponent GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_s
tencil GL_NV_fragment_program_option GL_APPLE_object_purgeable GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_ATI_texture_mirro
r_once GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_gpu_program_parameters GL_EXT_texture_array GL_EXT_texture_compression_latc G
L_EXT_texture_env_combine GL_EXT_texture_sRGB_decode GL_MESA_texture_array GL_ARB_copy_buffer GL_ARB_draw_instanced GL_ARB_half_float_
vertex GL_ARB_map_buffer_range GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_separate_shader_objects GL_EXT
_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL
_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_EXT_provoking_vertex GL_ARB_robustness
10:40:20 T:3007780656   ERROR: GLX: Same window as before, refreshing context
10:40:21 T:3007780656  NOTICE: UDisks: Added /media/melynas
10:40:21 T:3007780656  NOTICE: UDisks: Added /storage
10:40:21 T:3007780656  NOTICE: start dvd mediatype detection
10:40:21 T:3007780656  NOTICE: initializing playlistplayer
10:40:21 T:3007780656  NOTICE: DONE initializing playlistplayer
10:40:22 T:3007780656  NOTICE: initialize done
10:40:22 T:3007780656  NOTICE: Running the application...
10:40:22 T:3007780656  NOTICE: ES: Starting event server
10:40:22 T:2883574640  NOTICE: ES: Starting UDP Event server on 0.0.0.0:9777
10:40:22 T:2883574640  NOTICE: UDP: Listening on port 9777
10:40:22 T:3007780656  NOTICE: starting zeroconf publishing
10:40:23 T:2829077360  NOTICE: -->Python Interpreter Initialized<--
10:40:45 T:3007780656  NOTICE: Storing total System Uptime
10:40:45 T:3007780656  NOTICE: Saving settings
10:40:45 T:3007780656  NOTICE: stop all
10:40:45 T:3007780656  NOTICE: ES: Stopping event server
10:40:45 T:3007780656  NOTICE: stopping zeroconf publishing
10:40:46 T:2883574640  NOTICE: ES: UDP Event server stopped
10:40:46 T:3007780656  NOTICE: stop dvd detect media
10:40:46 T:3007780656  NOTICE: stop sap announcement listener
10:40:46 T:3007780656  NOTICE: clean cached files!
10:40:46 T:3007780656  NOTICE: unload skin
10:40:46 T:3007780656  NOTICE: stop python
10:40:46 T:3007780656  NOTICE: stopped
10:40:46 T:3007780656  NOTICE: destroy
10:40:46 T:3007780656  NOTICE: closing down remote control service
10:40:46 T:3007780656  NOTICE: unload sections
10:40:46 T:3007780656  NOTICE: destroy
10:40:46 T:3007780656 WARNING: Attempted to remove window 10013 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10014 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10015 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10016 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10017 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10018 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10019 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10107 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10115 from the window manager when it didn't exist
10:40:46 T:3007780656 WARNING: Attempted to remove window 10104 from the window manager when it didn't exist
10:40:46 T:3007780656  NOTICE: closing down remote control service
10:40:46 T:3007780656  NOTICE: unload sections
10:40:46 T:3007780656  NOTICE: application stopped...

sorry for posting in general forum, I thought I was posting in linux section...
Reply
#2
Debug log (level 1) output here: http://pastebin.com/DEnV3AR0
Reply
#3
i've got a feeling standalone mode has a memory leak (this is frodo built from git on ubuntu 12.04) as it seems to eat all my 2gb ram until i only have about 70mb free, i noticed there seems to be 4+ xbmc processes too.

when i stop playing a movie, or exit xbmc it seems to free the ram again.

i've turned off various options like webserver, avahi, airplay, upnp, rss, weather, remote control etc.
Reply
#4
It is certainly nothing related to memory leak, I can't even play a movie because the program is so unresponsive that I wouldn't be able to launch it. I am also running it over xfce, not in standalone mode.
Reply
#5
When you setuid to root, does it use something other than the software rasterizer?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
(2012-06-06, 01:45)jmarshall Wrote: When you setuid to root, does it use something other than the software rasterizer?

I don't know. How do I check? Anything to look for in the logs? Would it help to get debug log when running in setuid mode?

At first, when running as normal user, I saw some warning about not being able to access alsalibs. Adding the user to audio group fixed this, but the slowness problem still exists.

Karolis
Reply
#7
Update: Installed latest xbmc from source (took like a couple hours to compile!), and still having the same problem on debian.
Works perfectly fine when xbmc.bin executed as root, and very slow (not usable) when executed as non privileged user.

Any hints how to check what rasterizer xbmc is using?

Karolis
Reply
#8
10:40:20 T:3007780656 NOTICE: GL_VENDOR = Mesa Project
10:40:20 T:3007780656 NOTICE: GL_RENDERER = Software Rasterizer

pastebin a debug log while running as root.
Maybe you just have to add your user to the video and audio groups?
Reply
#9
OK, I noticed that the compiled from source version of XBMC is running *probably* a little bit smoother than the packaged one, when running as regular user.

I compared the GL_RENDERER in logs of root user and regular user, and the difference is:

root:
Code:
08:48:47 T:3037976368  NOTICE: GL_VENDOR = Tungsten Graphics, Inc
08:48:47 T:3037976368  NOTICE: GL_RENDERER = Mesa DRI Intel(R) 945GME x86/MMX/SSE2

regular user:

Code:
08:50:53 T:3037833008  NOTICE: GL_VENDOR = VMware, Inc.
08:50:53 T:3037833008  NOTICE: GL_RENDERER = Gallium 0.4 on llvmpipe (LLVM 0x209)

The user had already been added to audio group in the past. I tried adding to video group, which didn't seem to help.


XBCM debug log for root user (compiled from source):
http://pastebin.com/JE4Upxcj

XBCM debug log for regular user (compiled from source):
http://pastebin.com/Bd9vHrtL
Reply
#10
must be something with your xorg.conf, as it uses a wrong driver as regular user.
Reply
#11
The problem was in .bash_profile Sad

I had "startx" at the top of .bash_profile for regular user, in order to get xfce start automatically on boot. That however seems to throw an error when l xfce is already started. I have commented out that line and now xbmc seems to be working fine... will need to find another way to start xfce on boot Smile
Reply
#12
using this little profile script works:


Code:
vt=$(fgconsole 2>/dev/null)
(( vt == 1 )) && exec startx -- vt$vt &> ~/.xlog
unset vt
Reply
#13
I have been banging into this exact same problem, and just didn't realize it today, until I found and read this thread.

Well, I *think* it is the same problem.

Like the OP, for me, xbmc is ridiculously slow and essentially unusable, but only, it seems, when it is run under a normal user account. Running it under root causes it to behave reasonably well. And again, it seems that it is all down to the choice of the rasterizer...

Ordinary user:
21:09:16 T:34649175040 NOTICE: GL_VENDOR = Mesa Project
21:09:16 T:34649175040 NOTICE: GL_RENDERER = Software Rasterizer
21:09:16 T:34649175040 NOTICE: GL_VERSION = 2.1 Mesa 7.6.1

root:
21:42:04 T:34649175040 NOTICE: GL_VENDOR = DRI R300 Project
21:42:04 T:34649175040 NOTICE: GL_RENDERER = Mesa DRI R300 (RV380 5B62) 20090101 TCL
21:42:04 T:34649175040 NOTICE: GL_VERSION = 1.5 Mesa 7.6.1

OK, so now I know what the problem is, but I'm still totally confused about how to fix it in my case.

I'm on FreeBSD (*not* Linux), and the xbmc I'm using was just today built and installed from sources (specifically, the current official FreeBSD port, which is xbmc-11.0_6). I also am _not_ using either startx _or_ xfce. I use xinit (with a .xinitrc script) to start X, and I use the fvwm window manager.

So, um, can anybody help me out here? What is the actual correct solution to this problem?

Obviously, if there is a difference in behavior between root and non-root, then there is a permissions problem _somewhere_. But where? I haven't the first clue. Somebody please pass me one.
Reply
#14
I had the same problem but figured the fix. Yes, it is a permissions problem. When run as a normal user the DRI is not accessible and hence the system switches to software rendering rather than hardware one and CPU is consumed almost around 100% which could be verified by top.

In order to fix then make sure your user is granted access to /dev/dri/*
Reply
#15
Thank you, but it would seem that the permissions on /dev/dri/card0 are apparently _not_ the issue.

I did just try an experiment where I changed the permissions on /dev/dri/card0 from 0660 (which they were) to 0666 and then I re-ran xbmc. Alas, the thing was still dog slow after this change of permissions.

So I have no choice but to continue to look into this problem. I do hope that I can get to the bottom of it eventually.

P.S. Permissions on /dev/dri/ itself are 0555. So it seems that that is not the issue either.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc very slow when run as non-privileged user0