You are not logged in.

#1 2014-08-22 22:23:16

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

[SOLVED]Wine Get both PulseAudio and double buffer patch.

Hi all! I am having trouble with pulseaudio and wine. The sound is crackling. I have searched a lot but the only working way I found to make the sound work correctly is replacing wine with wine-multimedia. Fine, isn't it? Well, not actually. wine-multimedia is not like a driver, it completely replaces wine with a version patched to work with pulseaudio. The problem comes when I want to play games like Crysis or CS:GO wich need a custom version of wine. On ubuntu, when the problem wasn't present, I just downloaded (this is for Crysis) the doublebuffer version. But on Arch, the doublebuffer version wouldn't have the audio patch.
So, how can I make wine ignore pulseaudio and just use alsa? Do I have to uninstall pulseaudio-alsa? thanks in advance.

Last edited by tacchinotacchi (2014-08-24 12:58:22)

Offline

#2 2014-08-22 22:37:05

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Use PlayOnLinux for this, it can download different versions, sometimes compiled specifically for a target application. Search the forums, there are already posts how to select a specific version using WINE* variables and the audio selection aspect. For more, read 'man wine'.

https://bbs.archlinux.org/viewtopic.php?id=184638
https://bbs.archlinux.org/viewtopic.php?id=177979
https://bbs.archlinux.org/viewtopic.php … 7#p1410187

Offline

#3 2014-08-22 23:32:08

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Yea I knew that, what was I asking for is: how can I get both the pulseaudio and the doublebuffer patch with play on linux?

Offline

#4 2014-08-22 23:40:42

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Patch the sources yourself, you can use one of the aur packages as a template.

Offline

#5 2014-08-22 23:45:21

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Alright. I guess this is why I choose Arch. Going to try to patch the sources myself.

Offline

#6 2014-08-22 23:51:32

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

I would try using the package that looks more complex first, ergo try to add the other/simpler patch to the more complex one, just make sure it builds on its own first.

Last edited by emeres (2014-08-22 23:52:42)

Offline

#7 2014-08-22 23:54:29

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

wine-multimedia builds. It takes almost an hour on an i7 Ivy Bridge clocked at 3200 Mhz, but it builds.

Offline

#8 2014-08-23 00:29:38

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

tacchinotacchi wrote:

wine-multimedia builds. It takes almost an hour on an i7 Ivy Bridge clocked at 3200 Mhz, but it builds.

Then it will be pure please to search for errors when compiling fails. I hope those two patch sets are compatible with each other. Should you succeed, then please post what you have done, PKGBUILD, the changed patches and anything else relevant, so that others can reproduce it.

Offline

#9 2014-08-23 01:03:05

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

emeres wrote:
tacchinotacchi wrote:

wine-multimedia builds. It takes almost an hour on an i7 Ivy Bridge clocked at 3200 Mhz, but it builds.

Then it will be pure please to search for errors when compiling fails. I hope those two patch sets are compatible with each other. Should you succeed, then please post what you have done, PKGBUILD, the changed patches and anything else relevant, so that others can reproduce it.

Alright, going to do tomorrow if I have time. At least I know some C++.

Offline

#10 2014-08-23 12:34:08

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

UPDATE: Alright, I've almost done.. I'm 99% sure the two patches are compatible. But there is a problem. If I take the "make" route:

1. I extract wine's sources
2. I apply the double buffer patch I got from here https://github.com/PlayOnLinux/wine-pat … atch.patch

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8bb1f63..8f388ab 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1499,6 +1499,8 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
         buffer->flags |= WINED3D_BUFFER_CREATEBO;
     }
 
+    buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
+
     if (data)
     {
         BYTE *ptr;

Here I can specify the file. (dlls/wined3d/buffer.c)
3. The problem comes when applying the wine-multimedia patch from AUR. The patch is for multiple files. PKG probably knows how to handle it, but the command 'patch' can't.
even if I use

patch -p0 -i patch.patch

It still prints this warnings

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/configure b/configure
|index 40cadd2..be7dfc2 100755
|--- a/configure
|+++ b/configure
--------------------------

And asks me for every file. And even if i write the correct file name, it doesn't get patched.

If instead I take the "makepkg" route and try to make a package:
1. I extract buffer.c, patch it, and put it back in.
2.

makepkg

But it stops at integrity check.

==> Making package: wine-multimedia 1.7.24-1 (Sat Aug 23 14:33:08 UTC 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found wine-1.7.24.tar.bz2
  -> Found wine-1.7.24.tar.bz2.sign
  -> Found 30-win32-aliases.conf
  -> Found winemultimedia_1.7.24_20140808.patch
==> Validating source files with sha1sums...
    wine-1.7.24.tar.bz2 ... FAILED
    wine-1.7.24.tar.bz2.sign ... Skipped
    30-win32-aliases.conf ... Passed
    winemultimedia_1.7.24_20140808.patch ... Passed
==> ERROR: One or more files did not pass the validity check!

It appears there is no direct command to skip the check. While I wait for an answer I'll try to solve this by myself, but thanks in advance.

Last edited by tacchinotacchi (2014-08-23 12:35:23)

Offline

#11 2014-08-23 13:00:03

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

man patch

You should use '-p1' switch to skip the first top path level and probably specify the wrong path from the current location.
You could skip extracting and use patched source or better yet change PKGBUILD to accept the new source. Use 'SKIP' as value or the updated checksum for the appropriate file, but sign is interpreted differently, so you should probably drop it altogether or update it, it should be obvious how after 'cat *.sign' and reading 'man PKGBUILD'. Is this the only patch that needs applying?

Edit: added clarification.
I repeat: is that the only patch that needs applying? Because that would be very easy implemented.

Last edited by emeres (2014-08-23 13:18:13)

Offline

#12 2014-08-23 13:06:21

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Thanks! Started compiling. Let's see what happens during the next 60 minutes.

Offline

#13 2014-08-23 13:29:04

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

For others, should that be the only patch for the doublebuffer saved as wine-doublebuffer.patch with the sha1sum of 1d768007b4316304eadf3107be71521c8e0da4a5:

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8bb1f63..8f388ab 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1499,6 +1499,8 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
         buffer->flags |= WINED3D_BUFFER_CREATEBO;
     }
 
+    buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
+
     if (data)
     {
         BYTE *ptr;

This PKGBUILD patches and starts compiling with ignored dependencies in my case.

# Maintainer [base]: Sven-Hendrik Haase <sh@lutzhaase.com>
# Maintainer [-multimedia]: John Schoenick <john@pointysoftware.net>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Eduardo Romero <eduardo@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>

pkgname=wine-multimedia
_basename=wine
pkgver=1.7.24
pkgrel=1

_pkgbasever=${pkgver/rc/-rc}
_multimediasnapshot=20140808

source=(http://prdownloads.sourceforge.net/$_basename/$_basename-$_pkgbasever.tar.bz2{,.sign}
        30-win32-aliases.conf
        winemultimedia_${pkgver}_${_multimediasnapshot}.patch
        wine-doublebuffer.patch)

sha1sums=('821fbf2d1d9acbc3e0cb023f4e673f87df7f86fb'
          'SKIP'
          '023a5c901c6a091c56e76b6a62d141d87cce9fdb'
          '8a1386ec67f40e7ff9282e8bdae5ca8c06b83c97'
          '1d768007b4316304eadf3107be71521c8e0da4a5')

pkgdesc="Wine with Maarten Lankhorst's multimedia patches, including PulseAudio support"
url="http://repo.or.cz/w/wine/multimedia.git"
arch=(i686 x86_64)
options=(staticlibs)
license=(LGPL)
install=wine.install

_depends=(
  fontconfig      lib32-fontconfig
  libxcursor      lib32-libxcursor
  libxrandr       lib32-libxrandr
  libxdamage      lib32-libxdamage
  libxi           lib32-libxi
  gettext         lib32-gettext
  freetype2       lib32-freetype2
  glu             lib32-glu
  libsm           lib32-libsm
  gcc-libs        lib32-gcc-libs
  desktop-file-utils
)

makedepends=(autoconf ncurses bison perl fontforge flex prelink
  'gcc>=4.5.0-2'  'gcc-multilib>=4.5.0-2'
  giflib          lib32-giflib
  libpng          lib32-libpng
  gnutls          lib32-gnutls
  libxinerama     lib32-libxinerama
  libxcomposite   lib32-libxcomposite
  libxmu          lib32-libxmu
  libxxf86vm      lib32-libxxf86vm
  libxml2         lib32-libxml2
  libldap         lib32-libldap
  lcms2           lib32-lcms2
  mpg123          lib32-mpg123
  openal          lib32-openal
  v4l-utils       lib32-v4l-utils
  alsa-lib        lib32-alsa-lib
  libpulse        lib32-libpulse
  libxcomposite   lib32-libxcomposite
  mesa            lib32-mesa
  # multilib-build has issues with provides packages like this. If you're trying
  # to build as such, exchange for:
  # mesa-libgl      lib32-mesa-libgl
  libgl           lib32-libgl
  libcl           lib32-libcl
  libxslt         lib32-libxslt
  samba
  opencl-headers
)
  
optdepends=(
  giflib          lib32-giflib
  libpng          lib32-libpng
  libldap         lib32-libldap
  gnutls          lib32-gnutls
  lcms2           lib32-lcms2
  libxml2         lib32-libxml2
  mpg123          lib32-mpg123
  openal          lib32-openal
  v4l-utils       lib32-v4l-utils
  libpulse        lib32-libpulse
  alsa-plugins    lib32-alsa-plugins
  alsa-lib        lib32-alsa-lib
  libpulse        lib32-libpulse
  libjpeg-turbo   lib32-libjpeg-turbo
  libxcomposite   lib32-libxcomposite
  libxinerama     lib32-libxinerama
  ncurses         lib32-ncurses
  libcl           lib32-libcl
  libxslt         lib32-libxslt
  cups
  samba           dosbox
)

if [[ $CARCH == i686 ]]; then
  # Strip lib32 etc. on i686
  _depends=(${_depends[@]/*32-*/})
  makedepends=(${makedepends[@]/*32-*/} ${_depends[@]})
  makedepends=(${makedepends[@]/*-multilib*/})
  optdepends=(${optdepends[@]/*32-*/})
else
  makedepends=(${makedepends[@]} ${_depends[@]})
  provides=("bin32-wine=$pkgver" "wine-wow64=$pkgver" "wine=$pkgver")
  conflicts=('bin32-wine' 'wine-wow64' 'wine')
  replaces=('bin32-wine' 'wine')
fi

prepare() {
  # Get rid of old dirs
  rm -rf $_basename{,-{32,64}-build}

  # Allow ccache to work
  mv $_basename-$_pkgbasever $_basename

  # ncurses fix
  sed -i 's|libncurses|libncursesw|g' "$srcdir/$_basename/configure"
  sed -i 's|lncurses|lncursesw|g' "$srcdir/$_basename/configure"

  # Apply doublebuffer patch
  msg2 "Applying doublebuffer patch"
  cd ${srcdir}/$_basename
  patch -Np1 -i "${srcdir}"/wine-doublebuffer.patch

  # Apply multimedia patch
  msg2 "Applying multimedia branch patch"
  cd ${srcdir}/$_basename
  patch -Np1 -i "${srcdir}"/winemultimedia_${pkgver}_${_multimediasnapshot}.patch
}

build() {
  # These additional CPPFLAGS solve FS#27662 and FS#34195
  export CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/} -D_FORTIFY_SOURCE=0"

  if [[ $CARCH == x86_64 ]]; then
    msg2 "Building Wine-64..."

    mkdir $_basename-64-build
    cd "$srcdir/$_basename-64-build"
    ../$_basename/configure \
      --prefix=/usr \
      --libdir=/usr/lib \
      --with-x \
      --without-gstreamer \
      --enable-win64
    # Gstreamer was disabled for FS#33655

    make

    _wine32opts=(
      --libdir=/usr/lib32
      --with-wine64="$srcdir/$_basename-64-build"
    )

    export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
  fi

  msg2 "Building Wine-32..."
  mkdir "$srcdir/$_basename-32-build"
  cd "$srcdir/$_basename-32-build"
  ../$_basename/configure \
    --prefix=/usr \
    --with-x \
    --without-gstreamer \
    "${_wine32opts[@]}"

  # These additional CFLAGS solve FS#27560 and FS#23277
  make CFLAGS+="-mstackrealign -mincoming-stack-boundary=2" CXXFLAGS+="-mstackrealign -mincoming-stack-boundary=2"
}

package() {
  depends=(${_depends[@]})

  msg2 "Packaging Wine-32..."
  cd "$srcdir/$_basename-32-build"

  if [[ $CARCH == i686 ]]; then
    make prefix="$pkgdir/usr" install
  else
    make prefix="$pkgdir/usr" \
      libdir="$pkgdir/usr/lib32" \
      dlldir="$pkgdir/usr/lib32/wine" install

    msg2 "Packaging Wine-64..."
    cd "$srcdir/$_basename-64-build"
    make prefix="$pkgdir/usr" \
      libdir="$pkgdir/usr/lib" \
      dlldir="$pkgdir/usr/lib/wine" install
  fi

  # Font aliasing settings for Win32 applications
  install -d "$pkgdir"/etc/fonts/conf.{avail,d}
  install -m644 "$srcdir/30-win32-aliases.conf" "$pkgdir/etc/fonts/conf.avail"
  ln -s ../conf.avail/30-win32-aliases.conf "$pkgdir/etc/fonts/conf.d/30-win32-aliases.conf"
}

# vim:set ts=8 sts=2 sw=2 et:

Edit: Adding a newline for the doublebuffer patch might be necessary, so the checksum would need updating.

Last edited by emeres (2014-08-23 13:31:30)

Offline

#14 2014-08-23 18:16:32

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Alright. Everythings ready. Wine compiled with both patches. Quake Live, wich only requires audio patch, runs fine. I am now installing Crysis, wich requires double buffer. Crossing fingers.

Offline

#15 2014-08-23 19:38:10

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Crysis runs! Going to take a little rest (by playing... crysis) and then write what I've done.

Offline

#16 2014-08-24 12:14:21

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

DISCLAIMER: the procedure may require other modifications. Double buffer makes primus crash and doesn't show any video on virtualgl, thus making impossible to play with the nvidia GPU on Optimus systems. That didn't happen in the double buffer version downloaded from PlayOnLinux. I'm looking into it.

Alright. I think there shouldn't be a PKGBUILD here, because you should use the double buffer version only when it's necessary. Personally I am just starting wine from the source directory. If you know a way to manually add a custom version of wine to PlayOnLinux, please post it here.

1. Download wine-multimedia's tarball from AUR.
2. Execute

makepkg -s

to install dependencies and download wine sources and the wine-multimedia patch. This step isn't needed if you already installed the standard wine-multimedia.
WARNING: once the files are downloaded. Interrupt the process either by doing the default key combination or by closing the terminal window. Compiling the wine-multimedia isn't necessary right now.
3.

tar -xf winesource.tar.bz2

. To extract the sources. You should replace "winesource.tar.bz2" with the actual archive name.
4. Move to the extracted folder.
5.

patch -p1 -i wine-multimedia.patch

. Replace wine-multimedia.patch with the actual name of the patch.
6. Create a file with a text editor named double_buffer.patch, And past this https://github.com/PlayOnLinux/wine-pat … atch.patch in there. If the git link is down, at the time of writing It was like this:

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8bb1f63..8f388ab 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1499,6 +1499,8 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
         buffer->flags |= WINED3D_BUFFER_CREATEBO;
     }
 
+    buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
+
     if (data)
     {
         BYTE *ptr;

7. To apply the double buffer patch,

patch -p1 -i double_buffer.patch

Now, as usual:
8.

./configure
make

Last edited by tacchinotacchi (2014-08-24 12:22:59)

Offline

#17 2014-08-24 12:37:24

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Looks like the problem has been solved. Please mark the thread as solved.

Offline

#18 2014-08-24 12:47:04

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

Yes. However, please do not lock this thread, as I may find a solution for bumblebee not working.

Offline

#19 2014-08-24 12:50:47

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

All right, then mark it as partly solved. The point is to not waste time of others. Should the bumblebee be[come] a more complex issue, you may want to start a new thread or at least update this ones name.

Offline

#20 2014-08-24 12:59:44

tacchinotacchi
Member
Registered: 2014-08-18
Posts: 32

Re: [SOLVED]Wine Get both PulseAudio and double buffer patch.

The thread's now got a temporary name, more relevant to its content. I'll change it again if necessary (eg. solve bumblebee)

Offline

Board footer

Powered by FluxBB