Teamspeak server on Pi


38 posts   Page 1 of 2   1, 2
by ota-kun » Tue Jan 15, 2013 2:40 pm
Teamspeak does not support arm/Raspberry Pi as server. In some gaming communities like World of Warcraft/Germany Teamspeak is the standard server, which everyone uses. So mumble is no alternative.

As already posted (and copied here) on http://raspberrypi.stackexchange.com/qu ... k-3-server


I got Teamspeak 3 running using qemu running a x86 Debian squeeze. There is some room for improvement for sure, but for now that's what worked for me. I hope I didn't forget something.

First of all thanks to Dietmar and meigrafd of the raspberry pi forum. Without their work I wouldn't have succeeded.

**How to**

**Installing qemu**

1. We need some software `apt-get install git zlib1g-dev libsdl1.2-dev`
2. Download the source of qemu (`wget 198.154.101.186/RaspberryPI/qemudidi2.rar`) already patched by Dietmar for Raspberry pi. It is qemu 0.15.50 from Thoronir, because the support for ARM host seems to be even worse with the current version.
3. Unrar it `unrar x qemuADLI.part1.rar`. You have to use the unrar non-free version ([Link to howto][1])
4. Configure what to compile (takes about a minute)
`./configure --target-list="i386-softmmu" --enable-sdl --extra-cflags="-O3 -mfloat-abi=hard -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk" --audio-drv-list="alsa oss sdl pa" --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus hda"`
5. Now compile `make` (takes half an hour at least)
6. Now install `make install`
7. Now qemu is installed successfully.

**Preparing Debian Image** (using Windows as host)

8. Download and install qemu for Windows ([Link][2])

9. Download Debian netinstall image ([squeeze][3]). I used squeeze, but wheezy might be also good.

10. Create image using `qemu-img.exe create -f qcow2 G:\debian.img 1500M`(smaller size should be suffient too)

11. Install debian x86. I recommend to choose no meta package. `qemu -cpu 486 -hda G:\debian.img -cdrom G:\debian-6.0.4-i386-netinst.iso -boot d -m 512 -smp 1`

12. After installation run the qemu command again, but with some changes `qemu -cpu 486 -hda G:\debian.img -boot d -m 512 -smp 1 -redir tcp:9022::22 -redir udp:1234::9987`. -redir is used to redirect the network from the guest to the hosts ports.

13. Now install less and your favorite editor (like nano, vim,etc.) you like to use `apt-get install less vim`

14. Install OpenSSH Server `apt-get install openssh-server`

15. Install Teamspeak like you usually would do.

16. Connect to teamspeak from you windows host using localhost:1234 (remember above we redirected the port)

17. Test to connect to it via ssh/putty using localhost:9022

18. Shutdown `shutdown -hP now` the image and copy it via scp(winscp) to your pi.

**Run it on the Pi** (Use a SSH for the following commands)

19. Get the missing qemu Bios `wget -O /usr/share/qemu/sgabios.bin http://qemu.weilnetz.de/w32/2012-06-28/sgabios.bin`

20. Start it! `qemu -cpu 486 -hda debian.img -m 150m -smp 1 -redir tcp:9022::22 -redir udp:9055::9987 --nographic`

21. If you get a memory error then try it a few times.

22. If it says starting Grub then wait some minutes (it's booting in the background, but you will never get a prompt here!). Now login with a other SSH terminal to login 'ssh root@localhost -p 9022'

23. Now start Teamspeak and try to log in on port 9055 of the Pi.

24. Shutdown again the qemu guest.

25. Start it again but add -daemonize, so it runs even when you log off. I also made a [script][4] to help me.

**Performance**

My Pi is the 256 MB version overclocked to 1000 Mhz using raspi-config.

The Pi runs constantly at 70% CPU load average. It varies between 50% (using 700 MHz) and nearly 100% using 1000 MHz. But the load shows "0.77, 0.83, 0.80", which is okay.

In the future I hope to either use a native Teamspeak version (my hope is still up) or to use qemu in user mode and better performance with more current version. Time will tell :)

I have yet to test the performance of teamspeak itself, if it is usable for gaming situations. I noticed some milliseconds latence overhead, but not too much to worry yet.

[1]: http://raspberrypi.stackexchange.com/qu ... ar-nonfree
[2]: http://qemu.weilnetz.de/w32/qemu-w32.exe
[3]: http://cdimage.debian.org/debian-cd/6.0 ... etinst.iso
[4]: http://pastebin.com/a4gBVUgJ
Last edited by ota-kun on Thu Jul 25, 2013 8:10 am, edited 4 times in total.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by ota-kun » Tue Jan 15, 2013 2:41 pm
**Reserved for maybe future use**
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by felix3008 » Tue Jan 15, 2013 3:19 pm
Wow, i'm impressed that you got it to work (at least in a full system emulation).

Good Job!

Felix3008
User avatar
Posts: 40
Joined: Sun Dec 30, 2012 2:04 am
by Jim JKla » Tue Jan 15, 2013 10:17 pm
This is useful if it's not in the wiki soon I'll transpalant it.

ota-kun obviously I will cite you but it would be better if you did it.

;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2198
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by ota-kun » Wed Jan 16, 2013 7:28 am
I would wait a few days until I have some performance information and maybe we have some progress on the qemu in user mode.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by Jim JKla » Wed Jan 16, 2013 8:13 am
No problem I was just flaging it up ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2198
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by sikkom » Sun Mar 31, 2013 8:19 pm
Dear Sir,

Thank you for your tutorial.

Could you please help me with the following: while following your tutorial, I got stuck on step 20, it says Loading Grub and hangs. But sometimes it goes beyond that but hangs anyway while loading linux image.

What do you think I am doing wrong?

thanks
Posts: 1
Joined: Sun Mar 31, 2013 7:40 pm
by ota-kun » Mon Apr 01, 2013 1:18 pm
Nothing is wrong. That is as far it gets on the console, where you start the image of.

Afterwards you have to use SSH to login the started image after some seconds (from a different console of course). That's why you have to redirect the SSH port to 9022 so you can login. So it is very important that SSH is automatically starting in the debian image you run.

Btw. I am no longer using a Pi. I try to support as far as I can.
I decided that for my purpose I use a cheap vServer with more CPU power behind it and less pain with x86 programs like TS or Android SDK.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by Verfin » Tue Apr 02, 2013 11:31 am
What version of gnutls are you using? I'm getting error saying some functions are deprecated during the make.

Code: Select all
  CC    ui/vnc-tls.o
ui/vnc-tls.c: In function ‘vnc_tls_client_setup’:
ui/vnc-tls.c:313:9: error: ‘gnutls_kx_set_priority’ is deprecated (declared at /usr/include/gnutls/compat.h:342) [-Werror=deprecated-declarations]
ui/vnc-tls.c:320:9: error: ‘gnutls_certificate_type_set_priority’ is deprecated (declared at /usr/include/gnutls/compat.h:347) [-Werror=deprecated-declarations]
ui/vnc-tls.c:327:9: error: ‘gnutls_protocol_set_priority’ is deprecated (declared at /usr/include/gnutls/compat.h:344) [-Werror=deprecated-declarations]

How do I fix this?
Posts: 8
Joined: Sun Feb 10, 2013 11:58 am
by Verfin » Tue Apr 02, 2013 3:36 pm
I just compiled and installed gnutls 2.10.4 and it worked. Just in case any one has the same problem!
Posts: 8
Joined: Sun Feb 10, 2013 11:58 am
by advocation » Sun Apr 14, 2013 1:06 pm
Sorry for posting on this, as I am a bit of a noob on this. While trying to configure, I am getting an error "gcc" either does not exist or does not work. gcc is installed (4.6.3), and this appears to be in error to the cflags. I am running on default Raspbian wheezy build. Thanks for any help you can give.
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by ota-kun » Mon Apr 15, 2013 8:20 am
If gcc is installed, then gcc is a correct command.

The information you give are very unspecific. Can you post at which command you stuck and what is the exact error message?
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by advocation » Mon Apr 15, 2013 12:08 pm
The error has to do with the configure statement. When the --extra-cflags are added, it gives the gcc error. If i leave off the extra-flags statement, i can do a make (which will then eventually fail as well). Even more specifically, this statement:
--extra-cflags="-O3 -mfloat-abi=hard -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk"
When this is included (as in step 4), it will produce this error: ' "gcc" either does not exist or does not work.'
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by ota-kun » Mon Apr 15, 2013 12:25 pm
Hmm...strange.

I found that the character ` is still there, which might be confusing. But imo isn't that the problem.

Just for clarification.The statement is one big statement which have to be executed in "one line".
Last edited by ota-kun on Mon Apr 15, 2013 12:32 pm, edited 1 time in total.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by advocation » Mon Apr 15, 2013 12:31 pm
EDIT - Its related to a specific cflag...let me do more work on it and report back on which one. I was able to set the float to hard this time.

EDIT EDIT - Honestly, I have no idea. It's working completely this morning...I guess it needed a night to think about it? I purged and re-installed gcc at some point last night, but I had tried this since then and it still didn't work. *shrug*
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by advocation » Mon Apr 15, 2013 1:03 pm
Well, I just think this isn't destined to be. While doing the make, I get error:
gcc: internal compiler error: Killed (program cc1)

make[1]: *** [translate.o] Error 4
make: *** [subdir-i386-softmmu] Error 2

:cry:

EDIT -- I'll edit my errors in case anyone has them. The fix to this was to add a USB memory stick and use it as a swap file. That error is caused by running out of memory.
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by advocation » Mon Apr 15, 2013 8:39 pm
One last issue (hopefully). I have qemu installed, as well as my build installed and working (with ssh on by default). I put my img file onto my pi, then launch qemu per your command on the pi with the image. I get:
Grub loading.
Welcome to Grub!

--- Then proc. stays at 100% usage and even after waiting 10 minutes, I can not ssh in. When I try to ssh, it seems like it's trying, and after a few minutes I get "host has closed the connection". Any remaining thoughts?

EDIT - After just letting it run after 20 minutes got a segmentation fault. :|
EDIT 2 - After changing grub loader I'm able to see it's getting stuck at "initial ramdisk" and going no further.
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by ota-kun » Tue Apr 16, 2013 8:31 am
How long have you waited after "Welcome to Grub!" message?

It takes some minutes. Watch your CPU load until it gets less than 70%
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by advocation » Tue Apr 16, 2013 1:34 pm
As I mentioned above, I waited over 20 minutes, then eventually got a segmentation fault. After "welcome to grub", it starts to go through the bootup process and It appears to stop displaying on "initial ramdisk".
Posts: 6
Joined: Sun Apr 14, 2013 1:03 pm
by TheSheepKing » Thu Jul 18, 2013 3:43 pm
advocation wrote:As I mentioned above, I waited over 20 minutes, then eventually got a segmentation fault. After "welcome to grub", it starts to go through the bootup process and It appears to stop displaying on "initial ramdisk".

what did you do to go farther
Posts: 3
Joined: Thu Jul 18, 2013 12:52 pm
by ota-kun » Thu Jul 18, 2013 4:41 pm
I made a SSH login on a different terminal to the port specified in the command line arguments.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by TheSheepKing » Sat Jul 20, 2013 7:04 pm
Hi now i got it to connect over SSH and startet my teamspeak server and everything was ok but then i tryed to connect via teamspeak and it failed :(
Posts: 3
Joined: Thu Jul 18, 2013 12:52 pm
by ota-kun » Sun Jul 21, 2013 9:35 am
With this "-redir udp:9055::9987" command line argument the port of TS (9987) of the internal VM is redirected to 9055 .

Have you tried to connect Teamspeak on 9055?

And check the log file of the teamspeak server.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by TheSheepKing » Sun Jul 21, 2013 4:25 pm
i did try to login on that port but it faied. in the log you can see the following :
Code: Select all
2013-07-20 14:09:38.582041|INFO    |ServerLibPriv |   | TeamSpeak 3 Server 3.0.7.2 (2013-05-15 08:09:12)
2013-07-20 14:09:38.939953|INFO    |DatabaseQuery |   | dbPlugin name:    SQLite3 plugin, Version 2, (c)TeamSpeak Systems GmbH
2013-07-20 14:09:38.991303|INFO    |DatabaseQuery |   | dbPlugin version: 3.7.3
2013-07-20 14:09:39.302019|INFO    |DatabaseQuery |   | checking database integrity (may take a while)
2013-07-20 14:09:56.829796|WARNING |Accounting    |   | Unable to find valid license key, falling back to limited functionality
2013-07-20 14:10:06.924406|INFO    |FileManager   |   | listening on 0.0.0.0:30033
Posts: 3
Joined: Thu Jul 18, 2013 12:52 pm
by ota-kun » Mon Jul 22, 2013 7:59 am
You can check with
Code: Select all
netstat -an |less

if the port 9987 (default Teamspeak port) is used in the vm or use this to check if 9055 is used in the Pi host.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am