Difference between revisions of "Ventrilo"

From ArchWiki
Jump to: navigation, search
(Mangler is available in the community repository now, change references from the AUR to the community package.)
(23 intermediate revisions by 10 users not shown)
Line 1: Line 1:
== Introduction ==
+
[[Category:Telephony and Voice]]
Ventrilo is a voice communication program for Windows that runs quite well on the latest wine. This article outlines a few workarounds necessary to using Ventrilo naturally on Linux.
+
[[Category:Wine]]
 +
[http://www.ventrilo.com/ Ventrilo] is a voice communication program for Windows that runs quite well on the latest [[Wine]]. This article outlines a few workarounds necessary to using Ventrilo naturally on Linux.
 +
 
 +
{{Note|Running Ventrilo under Wine is no longer necessary; [http://www.mangler.org/ Mangler] is a stable open-source client in the community repository ({{Pkg|mangler}}) that connects to Ventrilo 3.0 servers.}}
  
 
== Global Push to Talk Hotkey ==
 
== Global Push to Talk Hotkey ==
One problem that wine Ventrilo users face is that the push to talk hotkey only being detected when a wine window (such as Ventrilo itself) is in focus. The solution to this is using [http://aur.archlinux.org/packages.php?ID=18058 ventriloctrl], a simple program that sends X input to Ventrilo.
+
One problem that Wine Ventrilo users face is that the push to talk hotkey only being detected when a Wine window (such as Ventrilo itself) is in focus. The solution to this is using [https://aur.archlinux.org/packages.php?ID=18058 ventriloctrl], a simple program that sends X input to Ventrilo.
  
 
=== Finding the input device ===
 
=== Finding the input device ===
The acceptable input devices are in /dev/input/. If you want to use a mouse use the event-mouse in /dev/input/by-id/. For a keyboard use /dev/input/event[#].
+
The acceptable input devices are in {{ic|/dev/input/}}. If you want to use a mouse use the event-mouse in {{ic|/dev/input/by-id/}}. For a keyboard use {{ic|/dev/input/event[#]}}.
  
You'll probably need to do a bit of trial and error to find the proper event number or device. The best way to do this is just to run ventriloctrl /dev/input/[whatever] as root, and press keys or click your mouse and see if it is detected by the program. If it is detected, it will show an example line with a number at the end. That number is the button number that you will use to run ventriloctrl in the future.
+
You will probably need to do a bit of trial and error to find the proper event number or device. The best way to do this is just to run {{Ic|ventriloctrl /dev/input/[whatever]}} as root, and press keys or click your mouse and see if it is detected by the program. If it is detected, it will show an example line with a number at the end. That number is the button number that you will use to run ventriloctrl in the future.
  
For example, my <tt>ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse</tt> shows:
+
For example, my {{Ic|ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse}} shows:
  ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272
+
# ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272
  
 
If that was the button I wanted to use, I would run ventriloctrl with that line in the future.
 
If that was the button I wanted to use, I would run ventriloctrl with that line in the future.
  
 
=== Startup Script ===
 
=== Startup Script ===
Now we'll make a script to run ventriloctrl using the parameters you discovered. This could also be done with an alias or other user-specific methods. Edit your script with your favorite editor and call it whatever you want. Mine is going to be called ventriloctrl+.
+
Now we will make a script to run ventriloctrl using the parameters you discovered. This could also be done with an alias or other user-specific methods. Edit your script with your favorite editor and call it whatever you want. Mine is going to be called {{ic|ventriloctrl+}}.
  
  nano /usr/bin/ventriloctrl+
+
# nano /usr/bin/ventriloctrl+
  
By default, a normal user does not have the access to the /dev/input/ devices that ventriloctrl needs to use. To get around this you can either make a udev rule, or just use sudo. So far, I'm just going to show what your script should look like with sudo.
+
By default, a normal user does not have the access to the {{ic|/dev/input/}} devices that ventriloctrl needs to use. To get around this you can either make a [[udev]] rule, or just use [[sudo]]. So far, I am just going to show what your script should look like with sudo.
  
  #!/bin/sh
+
#!/bin/sh
  sudo ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272
+
sudo ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272
  
 
Of course, the device and event number should be replaced with the ones you found earlier. Essentially you just want to add sudo to the front of your previous input device line.
 
Of course, the device and event number should be replaced with the ones you found earlier. Essentially you just want to add sudo to the front of your previous input device line.
Line 29: Line 32:
 
Make sure your script is executable:
 
Make sure your script is executable:
  
  chmod 755 /usr/bin/ventriloctrl+
+
# chmod +x /usr/bin/ventriloctrl+
  
All done. Now you just need to make the ventriloctrl+ script run when ventrilo runs.
+
All done. Now you just need to make the {{ic|ventriloctrl+}} script run when ventrilo runs.
 +
 
 +
=== Example Ventrilo Startup Script ===
 +
 
 +
We previously made a script to start ventriloctrl. Now, you may wish to make a script that starts ventriloctrl after Ventrilo starts. The tough part about this is determining when Ventrilo has started completely, as it is a Wine app. If anyone else has a better way of doing this please add it. Otherwise, here is my method.
 +
 
 +
Take a look at the first post in the [https://bbs.archlinux.org/viewtopic.php?id=56646 self-made command line utilities thread] on the Arch forums. The script we are going to use from that is the try script.
 +
 
 +
Copy it into a script file such as {{ic|/usr/bin/try}}. Make sure the script is executable.
 +
 
 +
# chmod +x /usr/bin/try
 +
 
 +
Now create another script to start Ventrilo named whatever you want. Mine will be called {{ic|ventrilo}}.
 +
 
 +
# nano /usr/bin/ventrilo
 +
 
 +
In the script, you will first want to cd to your Ventrilo install. By default, this should work for any users that have it installed to their default {{ic|~/.wine}} directory. In my example, I run {{ic|Ventrilo.exe}} and save its pid to the VENT variable, and then I use the try script to run {{ic|ventriloctrl+}} and save its pid to the CTRL variable. Then I wait until VENT finishes, and kill CTRL. The effect? Ventrilo starts and ventriloctrl attempts to start until it does, then it runs until Ventrilo closes. Here is my script:
 +
 
 +
#!/bin/bash
 +
cd ~/.wine/drive_c/Program\ Files/Ventrilo
 +
wine Ventrilo.exe 2>/dev/null & VENT=$!
 +
try ventriloctrl+ & CTRL=$!
 +
wait $VENT
 +
kill $CTRL
 +
 
 +
Also make sure your ventrilo script is executable.
 +
 
 +
# chmod +x /usr/bin/ventrilo
 +
 
 +
That should be it. You should now be able to run Ventrilo with the ventrilo command.
  
 
=== Allowing sudo for ventriloctrl ===
 
=== Allowing sudo for ventriloctrl ===
You might also want to run ventriloctrl with nopasswd for sudo. To do this, edit sudo's config file
+
You might also want to run ventriloctrl with nopasswd for [[sudo]]. To do this, edit sudo's config file:
  
  # visudo
+
# visudo
  
Add a line like the following. %wheel can be replaced with specific usernames if desired, otherwise it'll work for any users in the wheel group.
+
Add a line like the following. {{Ic|%wheel}} can be replaced with specific usernames if desired, otherwise it will work for any users in the wheel group.
  
 
  %wheel ALL=NOPASSWD:/usr/bin/ventriloctrl
 
  %wheel ALL=NOPASSWD:/usr/bin/ventriloctrl
  
[[Category:HOWTOs (English)]]
+
== Mangler and ALSA ==
 +
 
 +
Currently, mangler and mangler-svn from the AUR defaults to using pulseaudio at launch, regardless if it's not installed and will cause the application to hang at the terminal or not start at all. To build Mangler without pulseaudio, edit the PKGBUILD's ./configure line, add --without-pulseaudio, like so:
 +
 
 +
./configure --prefix=/usr --without-pulseaudio
 +
 
 +
Also, should your microphone fail to transmit any audio or should you get an error from a terminal that looks like this:
 +
 
 +
(snd_pcm_set_params) Rate doesn't match (requested 32000Hz, get 0Hz)
 +
 
 +
It is due to the recording device failing to re-sample to the Ventrillo server's rate. To fix this, go Edit -> Settings and then the Audio tab and select Custom for the input device and type in:
 +
 
 +
plughw:X,0
 +
 
 +
Where X is your microphone or recording device ID. To determine your recording device ID:
 +
 
 +
cat /proc/asound/cards
 +
 
 +
The number next to each device is the device ID. Also, don't forget to raise the volume on your recording device through alsamixer.
 +
 
 +
Should none of this work and problems still persist, switching to pulseaudio might be the way to go, at least until Mangler is fixed.
 +
 
 +
== Additional Resources ==
 +
* [http://appdb.winehq.org/objectManager.php?sClass=application&iId=2169 WineHQ's AppDB entry for Ventrilo]
 +
* [http://ubuntuforums.org/showpost.php?p=2662867&postcount=83 Ubuntu Forums Source]

Revision as of 23:13, 19 March 2014

Ventrilo is a voice communication program for Windows that runs quite well on the latest Wine. This article outlines a few workarounds necessary to using Ventrilo naturally on Linux.

Note: Running Ventrilo under Wine is no longer necessary; Mangler is a stable open-source client in the community repository (mangler) that connects to Ventrilo 3.0 servers.

Global Push to Talk Hotkey

One problem that Wine Ventrilo users face is that the push to talk hotkey only being detected when a Wine window (such as Ventrilo itself) is in focus. The solution to this is using ventriloctrl, a simple program that sends X input to Ventrilo.

Finding the input device

The acceptable input devices are in /dev/input/. If you want to use a mouse use the event-mouse in /dev/input/by-id/. For a keyboard use /dev/input/event[#].

You will probably need to do a bit of trial and error to find the proper event number or device. The best way to do this is just to run ventriloctrl /dev/input/[whatever] as root, and press keys or click your mouse and see if it is detected by the program. If it is detected, it will show an example line with a number at the end. That number is the button number that you will use to run ventriloctrl in the future.

For example, my ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse shows:

# ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272

If that was the button I wanted to use, I would run ventriloctrl with that line in the future.

Startup Script

Now we will make a script to run ventriloctrl using the parameters you discovered. This could also be done with an alias or other user-specific methods. Edit your script with your favorite editor and call it whatever you want. Mine is going to be called ventriloctrl+.

# nano /usr/bin/ventriloctrl+

By default, a normal user does not have the access to the /dev/input/ devices that ventriloctrl needs to use. To get around this you can either make a udev rule, or just use sudo. So far, I am just going to show what your script should look like with sudo.

#!/bin/sh
sudo ventriloctrl /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse 272

Of course, the device and event number should be replaced with the ones you found earlier. Essentially you just want to add sudo to the front of your previous input device line.

Make sure your script is executable:

# chmod +x /usr/bin/ventriloctrl+

All done. Now you just need to make the ventriloctrl+ script run when ventrilo runs.

Example Ventrilo Startup Script

We previously made a script to start ventriloctrl. Now, you may wish to make a script that starts ventriloctrl after Ventrilo starts. The tough part about this is determining when Ventrilo has started completely, as it is a Wine app. If anyone else has a better way of doing this please add it. Otherwise, here is my method.

Take a look at the first post in the self-made command line utilities thread on the Arch forums. The script we are going to use from that is the try script.

Copy it into a script file such as /usr/bin/try. Make sure the script is executable.

# chmod +x /usr/bin/try

Now create another script to start Ventrilo named whatever you want. Mine will be called ventrilo.

# nano /usr/bin/ventrilo

In the script, you will first want to cd to your Ventrilo install. By default, this should work for any users that have it installed to their default ~/.wine directory. In my example, I run Ventrilo.exe and save its pid to the VENT variable, and then I use the try script to run ventriloctrl+ and save its pid to the CTRL variable. Then I wait until VENT finishes, and kill CTRL. The effect? Ventrilo starts and ventriloctrl attempts to start until it does, then it runs until Ventrilo closes. Here is my script:

#!/bin/bash
cd ~/.wine/drive_c/Program\ Files/Ventrilo
wine Ventrilo.exe 2>/dev/null & VENT=$!
try ventriloctrl+ & CTRL=$!
wait $VENT
kill $CTRL

Also make sure your ventrilo script is executable.

# chmod +x /usr/bin/ventrilo

That should be it. You should now be able to run Ventrilo with the ventrilo command.

Allowing sudo for ventriloctrl

You might also want to run ventriloctrl with nopasswd for sudo. To do this, edit sudo's config file:

# visudo

Add a line like the following. %wheel can be replaced with specific usernames if desired, otherwise it will work for any users in the wheel group.

%wheel ALL=NOPASSWD:/usr/bin/ventriloctrl

Mangler and ALSA

Currently, mangler and mangler-svn from the AUR defaults to using pulseaudio at launch, regardless if it's not installed and will cause the application to hang at the terminal or not start at all. To build Mangler without pulseaudio, edit the PKGBUILD's ./configure line, add --without-pulseaudio, like so:

./configure --prefix=/usr --without-pulseaudio

Also, should your microphone fail to transmit any audio or should you get an error from a terminal that looks like this:

(snd_pcm_set_params) Rate doesn't match (requested 32000Hz, get 0Hz)

It is due to the recording device failing to re-sample to the Ventrillo server's rate. To fix this, go Edit -> Settings and then the Audio tab and select Custom for the input device and type in:

plughw:X,0

Where X is your microphone or recording device ID. To determine your recording device ID:

cat /proc/asound/cards

The number next to each device is the device ID. Also, don't forget to raise the volume on your recording device through alsamixer.

Should none of this work and problems still persist, switching to pulseaudio might be the way to go, at least until Mangler is fixed.

Additional Resources