Sound engine-related hang on Ubuntu (Studio) 9.04 with ALSA back end

Bug #383431 reported by Sean M. Pappalardo
66
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
High
Unassigned
1.7
Fix Released
High
Unassigned
alsa-driver (Ubuntu)
Invalid
Undecided
Unassigned
portaudio (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

System: Compaq Presario R3000 series notebook: AMD Athlon XP-M 3000+ 1.6GHz single-core, 512MB RAM.
Mixxx 1.7 branch.

Using the sound card directly, setting the latency to/from anything lower than about 16 causes the GUI to hang, either right away (with the console showing Debug: [Main]: request msec ## or after clicking OK in the Prefs. Other times, the GUI will respond fine until you go to play a track and it will hang there. Or it won't hang but it won't play either, and when you try to close Mixxx, it hangs Debug: [Main]: close soundmanager and has to be killed.

Same things happen with or without the use of pasuspender and with the real-time kernel and a non-RT one.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :
summary: - Sound engine-related hang on Ubuntu Studio 9.04
+ Sound engine-related hang on Ubuntu Studio 9.04 rt kernel
Revision history for this message
Albert Santoni (gamegod) wrote : Re: Sound engine-related hang on Ubuntu Studio 9.04 rt kernel

How many soundcards were you using?

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Uno, señor. The integrated nVidia nforce3 audio. (Which shows up as Realtek or something in Windows. Hmm.) It's using the Intel ICH driver (snd-intel8x0.)

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

This is interesting...if I pick the "default" sound card, it works fine down to 2ms. No hangs...

description: updated
summary: - Sound engine-related hang on Ubuntu Studio 9.04 rt kernel
+ Sound engine-related hang on Ubuntu Studio 9.04
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: Sound engine-related hang on Ubuntu Studio 9.04

Scratch that. "default" has like a half-second buffer, so it's horrible. Using the sound card directly, I found that setting the sample rate to 48000 works much better with my (cheap) integrated card. After settling on a good latency value (11ms in my case,) the soundengine(s) will still spontaneously freeze, and that's not latency related since it happened even at 64ms!!

Revision history for this message
djomegarush (djomegarush) wrote :

Hangs when changing latency.
Sager Notebook.
Sound Blaster Audigy2 Zs PCMCIA
ALSA
Intel (onBoard).
Ubuntu 9.04

Have not tried to change the latency using the internal card, just the Audigy.

Revision history for this message
djomegarush (djomegarush) wrote :

Changed API to OSS. Able to hit 96K w/ 0 Latency. Tried with 400ms and stepped down from there with oss (400ms, one less notch, click o.k. preference, one less notch, click o.k., ect). Went from 400ms to 0ms and still not 'gui lockups'.
Changed to ALSA @ 44.1K, 64ms. Stepped down (like with oss, but started with 64ms rather than 400ms) to 10ms. At 10ms, gui locks. On app lockup, app is stuck at 'request latency 10'. On startup, Latency still set at 10. Have to change to OSS to be able to modify settings.
During a 'good' session with oss, after the 'request latency', there seems to be a soundManager() function. I think this is what's hanging up.

Revision history for this message
djomegarush (djomegarush) wrote :

Also, though since we were dealing with latency and the ALSA driver, there might be a permission issue. Ran Mixxx as my normal user account and with sudo. Same result. Don't think it's a permission issue.

Beta 1.7?

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

I also experienced good performance using OSS (got about 4ms) with the internal card as well as an external Behringer UCA-202. So is this an Ubuntu problem?

summary: - Sound engine-related hang on Ubuntu Studio 9.04
+ Sound engine-related hang on Ubuntu Studio 9.04 with ALSA back end
Revision history for this message
Daniel James (daniel-64studio) wrote : Re: Sound engine-related hang on Ubuntu Studio 9.04 with ALSA back end

Confirmed - I just tested Mixxx 1.6.1 on stock Ubuntu Jaunty, HP ze2000 laptop, on-board ATI IXP sound card. Choosing buffers below 16ms with ALSA does cause hangs. Using OSS I can get down to 2ms without problems.

However on Mixxx 1.6.1 on 64 Studio 3.0 beta 3, which is Ubuntu Hardy LTS based with our own kernel, I can get down to 2ms using ALSA with no problems (albeit on different hardware, with intel8x0 onboard sound). I will run further tests to narrow this down.

summary: - Sound engine-related hang on Ubuntu Studio 9.04 with ALSA back end
+ Sound engine-related hang on Ubuntu (Studio) 9.04 with ALSA back end
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

For the Ubuntu guys, also see our mailing list thread: http://thread.gmane.org/gmane.comp.multimedia.mixxx.devel/2334/focus=2337

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

This is still an issue with bug #382228 fixed. Using hw:0,0. Tests fine with PortAudio SVN r1411 and fails with r1413. See http://music.columbia.edu/pipermail/portaudio/2009-July/009315.html

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

(That last comment was for the hang when changing latency.)
With more testing, the random hang seems to be fixed in r1411 of PA as well. With latency at 5ms, I let Mixxx run for 5 hours (looping both decks) and the audio thread didn't hang. Testing with the version of PA that ships with Ubuntu and leaving Mixxx to run overnight (with latency at 36ms) resulted in the audio thread hanging such that when you close Mixxx, it hangs on "closing Soundmanager." Testing with PA r1413 with the same settings resulted in audio thread hangs within a minute after starting Mixxx (though with gdb running it took considerably longer, about 3 hours.)

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Issue is with PortAudio

Changed in alsa-driver (Ubuntu):
status: New → Invalid
Changed in portaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

untargeting

Revision history for this message
seamus1089 (s-holden1) wrote :

I appear to be experiencing the bug described above. I believe I may have found a workaround - I dont know if im missing something obvious. Previously I was running jack using qjackctrl, which does not appear to offer this option, but it seems that running jackd directly allows one to use the "nozombies" option which prevents jack kicking off clients which are too slow. this allows me to run at 11ms pretty happily (i have not tried lower yet).

I haven't seen this mentioned yet - this either means I am stating something useful and unnoticed, or something obvious and irrelevant! hope it helps if the former, apologies if its the latter.

Running jackd as:
pasuspender -- jackd --nozombies --timeout 500 --realtime -P 89 -d alsa -p 256 --rate 44100 --softmode

details:
ubuntu studio 9.04, 2.6.28-3-rt, mixxx 1.7, portaudio library: libportaudio2_19+svn20071207-0ubuntu3_i386.deb

Revision history for this message
gidskid (gidskid) wrote :

Ok so this won't be very helpful but at least some one might be able to help me. Basically i put two songs on and press play. The program freezes and then has to force quit. This is a massive problem for me can you help?

Changed in mixxx:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Jose Cuello (jcuello) wrote :

Running Mixxx 1.8~beta1 on the following:
Ubuntu 9.10 (Karmic Koala) 2.8Ghz AMD Phenom II X3 (Triple Core) 4GB RAM
Sound: Creative SB Audigy 2 ZS

When I first launched Mixxx it was working correctly with the default settings at 92ms latency. I then went to the preferences to change my sound card and latency to 11ms, but then the following happened after I clicked on the OK button:

Step 1
Loaded a song to Deck 1 and waited for it to be fully analyzed.

Step 2
Tried to play song by clicking on the play button but it did not play (it simply toggled the pause button), and there were no messages on the console.

Step 3
Brang up the preferences dialog with Ctrl+P and changed my latency, and sound card. (For the second time)

Step 4
Clicked on the OK button. Mixxx freezes up and I'm forced to quit the application.

Mixxx works correctly if I don't put a latency lower than 46ms, the moment I do anything lower it will freeze up when I hit the OK button. I had to delete the .mixxx folder so it can forget the previous settings since every time I tried to change any settings it would freeze on me.

P.S.: I tried if the OSS API would work better than the ALSA but instead I got a Seg Fault when I hit the OK button. I'll go check if this bug is already posted.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hi Jose,

Are you using the version of PortAudio that we post on our website? The version in the Ubuntu repositories has this ALSA lockup bug that you are experiencing.

Thanks,
RJ

Revision history for this message
Jose Cuello (jcuello) wrote : Re: [Bug 383431] Re: Sound engine-related hang on Ubuntu (Studio) 9.04 with ALSA back end

Hello RJ,

I was not using the PortAudio version that was posted on the website,
I did download it and was able to build it and it runs okay so far. I
also noticed that the OSS API gives me better performance by letting
me set a lower latency. Unfortunately it won't let me use other
channels, everything gets sent to all the channels even if I don't
specify anything for my headphones.

On an unrelated subject, am I the only one experiencing this annoying
bug that when I set a cue by pressing Shift+D it sets the cue twice,
once when I press the key and again when I release it? Should I post
this as a bug?

Thanks,
Jose Cuello

On Fri, Feb 12, 2010 at 6:22 PM, RJ Ryan <email address hidden> wrote:
> Hi Jose,
>
> Are you using the version of PortAudio that we post on our website? The
> version in the Ubuntu repositories has this ALSA lockup bug that you are
> experiencing.
>
> Thanks,
> RJ
>
> --
> Sound engine-related hang on Ubuntu (Studio) 9.04 with ALSA back end
> https://bugs.launchpad.net/bugs/383431
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
David Henningsson (diwic) wrote :

Could this be a duplicate of bug #485488 ? Could you test alsa-plugins from my PPA and see if that fixes the problem?

@RJ Ryan: Where is your website, and do you have a link to the patch? I'm interested to see if the portaudio fix is into audacity's version of portaudio as well.

Revision history for this message
David Henningsson (diwic) wrote :

An additional note, #485488 only applies if you use pulseaudio. If you bypass pulseaudio (as I guess many people looking for low latency do) #485488 is irrelevant.

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

@David: our website download page (http://mixxx.org/download.php) advises Ubuntu users to downgrade portaudio to the version from Intrepid 8.10.

Revision history for this message
Albert Santoni (gamegod) wrote :

This is finally fixed in PortAudio SVN...

Revision history for this message
Daniel James (daniel-64studio) wrote :

Hi Ironstorm, Intrepid packages are no longer available from http://packages.ubuntu.com/ but have not yet been made available on http://old-releases.ubuntu.com/releases/

The PPA archive https://launchpad.net/~falk-t-j/+archive/lucid/+index?start=300&batch=75 contains a package for portaudio19 but it looks to be too old for this fix.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Marking Fix Released because the portaudio package in Ubuntu 10.10 has the fix for this.

Changed in mixxx:
status: Triaged → Fix Released
Changed in portaudio (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5182

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.