以不同的分辨率和声音开始第二个X会话

我有两个屏幕与twinview连在一起。 一些应用程序将其视为一个大型的3840 * 1200面板,但这对于第一人称射击游戏来说是非常不受欢迎的,因为您的目标最终会出现在两个屏幕之间。

所以我通常在1920 * 1200px的窗口中运行Wine游戏。 窗口管理器在一个屏幕上全屏显示,这对某些游戏非常有用。 然而,一些游戏滞后并且允许鼠标飞出Wine窗口的一侧,导致我的玩家像毒品一样在狐狸身上旋转。

然后有一大堆原生游戏(X3,OpenArena,Quake4,QuakeWars等)没有良好的窗口模式。 在X3上使用窗口模式会导致鼠标变得非常敏感。

如果我能在刚刚使用一个屏幕的新X会话中启动一些游戏,那会不会很好?!

它会。 我已经为Steam做到了这一点:

#!/bin/sh X :3 -ac & nvidia-settings --load-config-only sleep 10 # wait for X to catch up cd ~/.wine/drive_c/Program\ Files/Steam/ DISPLAY=:3 WINEDEBUG=-all wine "Steam.exe" 

现在这在技术上使用了两个屏幕但是当游戏以全屏模式启动时,一旦它们已经设置为1920 * 1200,它们似乎适应并使用我的一个xorg.conf元模式。 如果我可以在此可执行文件中明确说明模式,那会更好。 有没有办法做到这一点?

也没有声音。 我有WinePulse补丁,所以我只需要让PulseAudio迷上这个会话(反之亦然),我觉得我现在很乐意。

编辑:拉尔夫接受了一些事情,但错过了(或误解了)其他一些事情。 这可能是我过于冗长的问题。 尽管post很长,但我只有两个问题。

以下是我在简洁环境中的问题:

  • 如何以指定的分辨率启动新的X会话? 我最好在调用X时指定现有的元模式或精确的分辨率。

  • 如何让新X会话上的应用程序与正确的PulseAudio服务器通信? 目前,他们似乎没有排队。 我用totem测试了这个,而不仅仅是Wine应用程序。

更具体地回答你的问题。 您可以使用nvidia-settings更改元模式。 来自nvidia-settings –help的片段:

 -a, --assign=[ASSIGN] The ASSIGN argument to the '--assign' commandline option is of the form: {DISPLAY}/{attribute name}[{display devices}]={value} This assigns the attribute {attribute name} to the value {value} on the X Display {DISPLAY}. {DISPLAY} follows the usual {host}:{display}.{screen} syntax of the DISPLAY environment variable and is optional; when it is not specified, then it is implied following the same rule as the --ctrl-display option. If the X screen is not specified, then the assignment is made to all X screens. Note that the '/' is only required when {DISPLAY} is present. {DISPLAY} can additionally include a target specification to direct an assignment to something other than an X screen. A target specification is contained within brackets and consists of a target type name, a colon, and the target id. The target type name can be one of "screen", "gpu", "framelock", "vcs", "gvi", or "fan"; the target id is the index into the list of targets (for that target type). The target specification can be used in {DISPLAY} wherever an X screen can be used, following the syntax {host}:{display}[{target_type}:{target_id}]. See the output of `nvidia-settings -q all` for information on which target types can be used with which attributes. See the output of `nvidia-settings -q screens -q gpus -q framelocks -q vcs -q gvis -q fans` for lists of targets for each target type. The [{display devices}] portion is also optional; if it is not specified, then the attribute is assigned to all display devices. Some examples: -a FSAA=5 -a localhost:0.0/DigitalVibrance[CRT-0]=0 --assign="SyncToVBlank=1" -a [gpu:0]/DigitalVibrance[DFP-1]=63 

对于声音,您只需在脚本中运行ck-launch-session

 #!/bin/sh X :3 -ac & nvidia-settings --load-config-only sleep 10 # wait for X to catch up cd ~/.wine/drive_c/Program\ Files/Steam/ DISPLAY=:3 ck-launch-session DISPLAY=:3 WINEDEBUG=-all wine "Steam.exe" 

来自两个X显示器的声音合并。

运行多个X会话

我想这正是你想要的。 并且运行超过X会话是可能的,这并不意味着所有video驱动程序都允许您使用相同的video卡。 因此,运行超过Xsession意味着您将需要多个video卡。

Metamodes

游戏可以使用元模式更改桌面分辨率和屏幕设置。 假设你左边有一个1680×1050的大显示器,右边有一个较旧的小显示器,最高分辨率为1025×768。

 Section "Screen" Identifier "Default Screen" DefaultDepth 24 Option "TwinView" "1" Option "TwinViewXineramaInfoOrder" "CRT-0" Option "metamodes" "CRT-0: 1680x1050 +0+0, CRT-1: 1024x768 +1680 +0; CRT-0: 1680x1050 +0+0, CRT-1: NULL; CRT-0: 1400x900 +0+0, CRT-1: NULL;" EndSection 

当您可以在游戏中选择分辨率时,您将拥有以下选项:

 2704x1050 this refers to the total viewport size of using two monitors 1680x1050 this means the second monitor is off, and you will use a high resolution 1400x900 this also only used the first monitor, but it will run a bit quicker 

你可以添加很多元模式。 只需确保“结果”视口具有唯一的分辨率。 否则游戏将无法理解。

有趣的是,当你从游戏中选择alt-tab时,你的系统将切换回原来的元模式,当alt-tab重新进入游戏时,它将返回到游戏的配置元模式。

葡萄酒/蒸汽

元模式技巧也适用于葡萄酒。 但是,有些游戏不支持更改分辨率。

一个很好的解决方法:

 - turn on emulate virtual desktop, in wine-config, and set it to your desktop size - compiz will automatically turn it into 'fullscreen' mode and hide panels - the mouse will be captured properly. Your other monitor is still on, and displays whatever is there. You will need to alt=tab to reach it though. Perhaps its a good idea to associate a shortcut to minimize window. 

如果您仍然遇到某些游戏的鼠标捕获问题,可以使用mousewarp模式:

 WINEFORCEMOUSEWARP=yes wine yourapp.exe 

Pulseaudio和葡萄酒

您可以使用此PPA来获得启用了脉冲音频驱动程序的葡萄酒。 确保也使用wine-config选择它。

  https://launchpad.net/~neil-aldur/+archive/ppa