Sound issue

Questions about Wine on Linux
Locked
themainliner
Level 2
Level 2
Posts: 18
Joined: Fri May 28, 2010 11:33 am

Sound issue

Post by themainliner »

I'm not sure where this problem lies precisely. It may be a Wine issue, a 64 bit issue, an Ubuntu issue (I see posts about that state of 12:04) or even a pulseaudio issue.

Wine runs fine and produces audio output. No problem. As long as I launch Wine first (in terms of audio apps). After launching Wine with audio working perfectly other Linux app I launch will not output sound: Mumble, Audacious, Banshee...

On the other hand if I launch, say, Audacious first it works fine but subsequently launching Wine it will have no sound...

I'm using Linux Mint 13 "Maya" x64 (i've used both DEs MATE and Cinnamon with same result). Wine is the repo version 1.4. Pulseaudio is 1.1.
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Post by L. Rahyen »

I do not use PulseAudio, so I have no idea what problems it may cause. But it looks like you have misconfigured ALSA. Run:

sudo rm /etc/asound.conf; sudo rm /home/*/.asoundrc

This will delete all ALSA configuration files. Does it work after this? If not, create /etc/asound.conf with the following content:

Code: Select all

pcm.!default {
  type plug
  slave.pcm mixer }
ctl.!default {
  type hw
  card 0 }

pcm.mixer  {
  type dmix  
  ipc_key 666
  slave {
    pcm "hw:0,0"
    period_size 2048
    periods 2
    rate 48000 } }
I assume here that your card supports 48kHz, if not replace "48000" with "44100" and try again.

If you have more than one sound card in your system, this asound.conf may choose wrong card. If you are unsure, run

aplay -l | grep card | cut -d: -f1

If all you see is "card 0", then you have only one sound card and above asound.conf should work perfectly. Otherwise please post full output from "cat /proc/asound/cards".

Please note that after each attempt you need to close and reopen applications which use your sound card. Before reopening your applications make sure to run "killall pulseaudio".
themainliner
Level 2
Level 2
Posts: 18
Joined: Fri May 28, 2010 11:33 am

Post by themainliner »

Whoah...that did not help.

sudo rm /etc/asound.conf; sudo rm /home/*/.asoundrc output:

Code: Select all

rm: cannot remove `/etc/asound.conf': No such file or directory
rm: cannot remove `/home/*/.asoundrc': No such file or directory
I created /etc/asound.conf and inserted those lines of code. I killed pulseaudio and tried Wine...the sound was very choppy dropping out constantly. So I ran the above command to delete the file I created.

I ran aplay -l | grep card | cut -d: -f1 and got:

Code: Select all

card 0
card 0
card 1
card 1
card 1
card 1
He is my output from cat /proc/asound/cards

Code: Select all

 0 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfe600000 irq 16
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfe080000 irq 25
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Post by L. Rahyen »

the sound was very choppy dropping out constantly
Your original issue was that two or more programs can't playback sound simultaneously. Please ignore choppy sound for now and test if the original issue is fixed by the asound.conf I gave you without pulseaudio.

It looks like better command to stop pulseaudio is:

pulseaudio --kill

or otherwise it may restart automatically. To make sure that pulseaudio is really killed, just wait for a minute and run "killall pulseaudio", if it say "no process found", then pulseaudio is really stopped.

You also may want to try running two applications without asound.conf and without pulseaudio to see if they can emit sound simultaneously.

If "HDA ATI SB" is the card you want to use, then you can leave "hw:0,0" in the config. If it's HDA NVidia, change "hw:0,0" to "hw:1,0".

To fix choppy sound first try to use 44100 instead of 48000. If nothing changes (make sure to restart your applications), change it back to "48000" and try to increase period_size. 4096 or 8192 good values to try. Of course, pulseaudio needs to be disabled, otherwise result is unpredictable.

If all of above does not help or if pulseaudio keeps restarting automatically no matter what you do, then this is Ubuntu-specific issue, and you need to ask for help on Ubuntu-specific forum.
themainliner
Level 2
Level 2
Posts: 18
Joined: Fri May 28, 2010 11:33 am

Post by themainliner »

Pulseaudio does reload constantly.

You don't use Pulseaudio, so the only troubleshooting you have offered is for ALSA. In order to make use of this I have kill the pulseaudio daemon...this seems an odd way to proceed. I also use the 3.23 vernal, maybe you only use 2 kernels - should I roll back?

I have a bag full of distros installed on my PC. At this point they all happen to be Ubuntu eggs (except the Fedora xfce I have). So I'm using Mint x64 MATE & Cinnamon, Mint i386 Gnome 2, Kubuntu and Xubuntu i386. Pulseaudio works perfectly on all of these platforms.

The one problem I do have is restricted to one application: Wine and one architecture: 64-bit.

You seem to be concluding that problem must be pulseaudio or Ubuntu specific. There is a much more likely conclusion. If I install Linux Mint 13 Maya i386 and it works properly, even with Wine, out of the box (like 11 Katya i386 does) I think we'll have established that Wine just FAILS in x64 distros.

Won't we?
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: Sound issue

Post by L. Rahyen »

In order to make use of this I have kill the pulseaudio daemon...this seems an odd way to proceed.
This is the only way to proceed if you want to find the source of the problem. Many people dislike PulseAudio for a reason. Personally, when plain ALSA was not enough for my purposes, I actually tried PulseAudio - and not only it was incapable of what I wanted to achieve, it broke so many things in so many ways that I purged this thing immediately and use JACK since then. But you probably do not need sound server at all, and even if you do, you have to make sure that ALSA works perfectly first.

Try "sudo apt-get remove pulseaudio". If it will not remove any packages you really need, then it's the best way to disable pulseaudio. If it tries to uninstall something that you consider important, cancel it and run "sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.backup; killall pulseaudio". Then wait for a while and make sure that pulseaudio is really gone. Now you can try again all my suggestions.
I also use the 3.23 vernal, maybe you only use 2 kernels - should I roll back?
I use 3.4.3 with BFS scheduler. But if you do not need very low latencies, standard 3.2.3 kernel should be fine too, not so long ago I have used vanilla Debian 3.2.x kernel and everything worked for me properly. So your kernel should work properly too (unless Ubuntu broke it with some patches).
I think we'll have established that Wine just FAILS in x64 distros.
I'm using 64-bit distro for many years and upgrade Wine often. And I never had any problems with ALSA. And, like you, I have sound card without hardware mixing.

Your original problem have nothing to do with Wine. You say that first application you run captures sound device exclusively. This means your sound configuration is broken.

Since I'm using Debian Testing with lots of unstable packages, and Ubuntu based on Debian Unstable, your problem is Ubuntu-specific, because it's not present in 64-bit Debian.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re:

Post by dimesio »

themainliner wrote: You seem to be concluding that problem must be pulseaudio or Ubuntu specific. There is a much more likely conclusion. If I install Linux Mint 13 Maya i386 and it works properly, even with Wine, out of the box (like 11 Katya i386 does) I think we'll have established that Wine just FAILS in x64 distros.

Won't we?
Wine works just fine here on 64 bit openSUSE, including sound.

I suggest you read the sticky at the top of the forum directed at Ubuntu 12.04 users. The fact is that that version of Ubuntu is badly broken when it comes to Wine. It is particularly bad for 64 bit, because one of the major problems is their poor implementation of multiarch. That is an Ubuntu bug, not a Wine bug.

As for PulseAudio, at present it is only supported in Wine via alsa-plugins, version 1.0.25 or later. The Ubuntu wine1.5 package does include an unofficial winepulse driver. You may want to try that if you haven't already, but be aware that it is not supported here.
themainliner
Level 2
Level 2
Posts: 18
Joined: Fri May 28, 2010 11:33 am

Re: Sound issue

Post by themainliner »

First of all let me apologise for the tone of my last response (note to self: do not post on forums before first coffee of day). I do appreciate your help and the time you take to post.
L. Rahyen wrote:Your original problem have nothing to do with Wine. You say that first application you run captures sound device exclusively. This means your sound configuration is broken.

Since I'm using Debian Testing with lots of unstable packages, and Ubuntu based on Debian Unstable, your problem is Ubuntu-specific, because it's not present in 64-bit Debian.
I haven't described my problem 100% accurately.
  • All audio applications work perfect, separately or simultaneously. The only exception is Wine.
    If Wine is launched first it captures the sound device exclusively.
    If Wine is the second audio app launched it will output no sound.
Tomorrow I will try installing winepulse. If that doesn't resolve this issue I'll rip pulseaudio out of Linux Mint 13 Maya MATE and see where we go.

Today I spent all day installing and wrestling with Fedora 17 x64 KDE. This was essentially unrewarding as Wine won't even launch World of Warcraft report that it cannot find DirectX. I'm not even troubleshooting that through yet. Tomorrow I'm gonna install openSUSE 12.1 x64, I've always liked openSUSE and dimesio says he has Wine working (did it work out of the box?) and Linux Mint 13 Maya MATE i386 - just to see, like I said Mint 11 Gnome 2 i386 worked out of the box (and still does) a treat.

Thanks again guys and I'll be back. :mrgreen:
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: Sound issue

Post by L. Rahyen »

I haven't described my problem 100% accurately.
All audio applications work perfect, separately or simultaneously. The only exception is Wine.
If Wine is launched first it captures the sound device exclusively.
If Wine is the second audio app launched it will output no sound.
This does not change anything. Wine usually tries to use default ALSA device. If your system properly configured, any number of applications should be able to access it simultaneously even if you have sound card incapable of hardware mixing. So, as I have said, your problem is not Wine but something else.

But dimesio gave you good advice, try wine1.5 with winepulse and see if it works for you. If not, you have to fix sound configuration in Ubuntu 64-bit as I have described or use some other distro that works out-of-the-box. Good luck!
themainliner
Level 2
Level 2
Posts: 18
Joined: Fri May 28, 2010 11:33 am

Re: Sound issue

Post by themainliner »

Still can't believe that the fix is really this easy...the only question is why I thought Wine was at version 1.5 when it was actually 1.4. I Googled Winepulse and ended up at their PPA where I read:
The Ubuntu-Wine PPA (https://launchpad.net/~ubuntu-wine/+archive/ppa) now includes the latest PulseAudio compatibility patches. Rejoice! You should switch to that one to get the latest Wine updates.
At this point I double checked my version...I plead mass distro switching confusion...and discovered I was at version 1.4 (/facepalm). There's nothing like upgrading to the latest version and seeing if your "problem" miraculously evaporates.

I added the Wine Team PPA. For the uninitiated open Update Manager, select Edit | Software Sources | Other Software then click Add and paste this in:

Code: Select all

deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu YOUR_UBUNTU_VERSION_HERE main 
Then I installed wine1.5-amd64 in the usual way (sudo apt-get install wine1.5-amd64) and there we go...problem? What problem.

The news from the Ubuntu (egg) front line is it works well with Wine 1.5, even x64 and Pulseaudio now works out of the box (pretty much). A lot of fuss about nothing really. Sorry.

Thanks both, file under - needs to focus and check own work.
Locked