Need troubleshooting help, tired of rebooting :)

Need troubleshooting help, tired of rebooting :)

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
[LBF]Vache
Posts: 24
Joined: 01 Apr 2008, 22:56

Need troubleshooting help, tired of rebooting :)

Post by [LBF]Vache »

hello everybody

i post here cause i have been switching to linux (ubuntu 7.10) lately, and i really would like to play spring under linux

unfortunately few annoying bugs keeps me from doing so

1. The mouse is slow. I've echoed the line that's supposedly needed in the .bash_profile file. It didnt change a thing, even after restarting and echoing it 4 times.

after a while under linux i understood the file was a configuration file for bash kinda stocking environnment variables.

Strangely enough when i opened the file there was only the line about SDL mouse, and no other, as if i created the file when i echoed to it.

i tried to run the export manually but i'm really not sure that it's the way it's supposed to work :(

so please help me with that ! i can't play with that dumb slow mouse. I could play in windowed mode, but i don't like the feeling of it

2. The sound is stuttering badly. This is less important , i could play without sound even if i'd prefer not to. I'm on a laptop with a quite common realtek chip. Other apps using audio works fine, even though i don't know if they use openal or not.

3. I tried running the windows spring under wine, and it ran perfectly smoothly (wich tells a lot, even if i don't know what ...) but i don't know how to link it to a lobby, either the windows or the linux one.

thanks !
[LBF]Vache
Posts: 24
Joined: 01 Apr 2008, 22:56

Re: Need troubleshooting help, tired of rebooting :)

Post by [LBF]Vache »

i just found "solutions" to both of my problems :

1. First the sound, cause this is interresting in case anyone gets the same problem. I found the solution on vdrift wiki, and followed this procedure :
If the engine sound is very broken or choppy sounding, and you hear some noise or crackling, you need to tell OpenAL to try to use a different sound backend. If you don't have an ~/.openalrc file, create it with these contents, or modify your current one to look like this:

(define devices '(native alsa sdl arts esd null))
(define alsa-device "dsp0")
(define speaker-num 2)
;(define sampling-rate 22050)

The important line here is the "define devices" line, OpenAL attempts to use each of those sound output methods in order. It uses the first one that works; in some cases native will work best, in other cases perhaps alsa. If Gnome is running its sound daemon, esd would be the best choice, while KDE usually uses artsd.
this worked instantly without restarting. Maybe those in charge of the linux installation wiki should put that in it in case someone runs in the same problem.

2. for the mouse problem, running the export cmd in a terminal and then launching spring worked. Still, i'd like to find a way to make my .bash_profile file work.

sorry i posted , and found a solution just after :) . Still this could help other people since i'm running a very standard ubuntu install.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: Need troubleshooting help, tired of rebooting :)

Post by bibim »

Salut Vache ;)

the .bash_profile file is only executed if you are using bash as a login shell. If you use another shell, or if you don't use it as a login shell, then it won't be executed.

Some extracts of "man bash":
A login shell is one whose first character of argument zero is a -, or one started with the --login option.
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: Need troubleshooting help, tired of rebooting :)

Post by Vadi »

Glad you got it solved :-)
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: Need troubleshooting help, tired of rebooting :)

Post by LordMatt »

[LBF]Vache wrote:i just found "solutions" to both of my problems :

1. First the sound, cause this is interresting in case anyone gets the same problem. I found the solution on vdrift wiki, and followed this procedure :
If the engine sound is very broken or choppy sounding, and you hear some noise or crackling, you need to tell OpenAL to try to use a different sound backend. If you don't have an ~/.openalrc file, create it with these contents, or modify your current one to look like this:

(define devices '(native alsa sdl arts esd null))
(define alsa-device "dsp0")
(define speaker-num 2)
;(define sampling-rate 22050)

The important line here is the "define devices" line, OpenAL attempts to use each of those sound output methods in order. It uses the first one that works; in some cases native will work best, in other cases perhaps alsa. If Gnome is running its sound daemon, esd would be the best choice, while KDE usually uses artsd.
Dude awesome! Thanks for posting this, it fixed the crackle in the dynamic music widget for me. Now it sounds crystal clear. :D I have added this to the Linux setup wiki.
[LBF]Vache
Posts: 24
Joined: 01 Apr 2008, 22:56

Re: Need troubleshooting help, tired of rebooting :)

Post by [LBF]Vache »

hey ! thanks for the answers :)

salut bibim :) merci pour les infos !

glad i could be of some help matt !

i just made a temporary solution, using a script that exports the sdl mouse settings before launching lobby, and it's working flawlessly now.

meanwhile i'll explore this login shell problems, wich seems to be quite complicated. I kinda understood that ubuntu still used bash as a login shell but not as a system shell (using dash instead). So i'll dig up to find how this works. Ubuntu forums seems more appropriate to solve this question anyways :)

This is not very important , i'm fully happy now since i just need to use windows for music productions, all others needs (coding, gaming) being handled on linux !
[LBF]Vache
Posts: 24
Joined: 01 Apr 2008, 22:56

Re: Need troubleshooting help, tired of rebooting :)

Post by [LBF]Vache »

for those running in the same bash_profile problem

create a springlauncher file with gedit or alike text editor,in your home directory containing the following
#!/bin/bash
export SDL_MOUSE_RELATIVE=0
springlobby
make it executable with
chmod 755 springlauncher
then create a springlobby.desktop file in your desktop directory (lot's of chances it's ~/Desktop/ if you're running an english system) containing the following:
[Desktop Entry]
Name=Spring Lobby
Comment=Play real-time strategy games using the Spring engine
Exec=~/./springlauncher
Icon=springlobby.svg
Terminal=false
Type=Application
Categories=Application;Game;StrategyGame;
and do the same chmod than you did before. on my system :
chmod 755 ~/desktop/springlobby.desktop
If you don't want to have a shortcut on your desktop, you can simply edit your springlobby launcher to look like the one above. to locate it type
locate springlobby.desktop
but is likely in the /usr/share/applications/ directory

and voila !
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: Need troubleshooting help, tired of rebooting :)

Post by LordMatt »

You can alternatively rename the spring executable that springlobby looks for to something like _spring.sh and make your shell script there.
Post Reply

Return to “Linux”