Topic Options
#54940 - 08/10/09 11:48 PM sldmame + Ubuntu 9.04 = CPU pegged at 100%
Klogd Offline
Member

Registered: 21/01/07
Posts: 7
Hi,

Just thought I'd describe an issue I ran into which might save others a few hours/days of hair pulling. This occurs on the default configuration of Ubuntu, I didn't find any references to this being reported before.

Symptoms
After starting sdlmame (doesn't matter which version, I tried a few different ones) the CPU is immediately pegged at 100%, even while sdlmame is idle displaying the initial menu.

Cause
The SDL ALSA driver (which is just a pass through to Pulseaudio).

Either sdlmame, SDL, or Pulseaudio is to blame. I'm more inclined to point the finger at everyone's favourite whipping boy, Pulseaudio, even though other SDL apps work just fine with the alsa driver.

Resolution
Code:
$ sudo apt-get install libsdl1.2debian-pulseaudio

This will remove the alsa driver (libsdl1.2debian-alsa) and the pulseaudio driver will be used by default.

Or the libsdl1.2debian-all package could be installed instead and SDL_AUDIODRIVER would have to be set for 'pulse' or 'esd', basically anything except 'alsa'.

The upcoming Ubuntu 9.10 is apparently also affected by this issue. Has anyone run into this? Is it exclusive to Ubuntu, or any distro using Pulseaudio is affected? This is such a showstopper I was surprised not to find numerous reports of this problem.

Top
#54949 - 09/10/09 05:37 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: Klogd]
R. Belmont Online   content

Senior Member

Registered: 17/03/01
Posts: 11789
Loc: USA
In fairness to Pulse, PA is the first time someone's tried to write a major application that extensively exercises ALSA, so a lot of the results were predictable.

I suspect a combination of things will resolve these issues:
- ALSA has been fixing the bugs reported by PulseAudio
- PA itself is getting better
- SDL 1.2.14 will have a much improved native PulseAudio driver

Also, MAME pegging your CPU is generally considered a feature by MAMEdev. We optimize for correctness, not speed smile (But see also (SDL)MAME's -sleep option).

Top
#55256 - 18/10/09 08:41 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: R. Belmont]
mochamame Offline
Member

Registered: 18/03/09
Posts: 25
Good to see others concur. I posted about this problem awhile back http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=51554#Post51554

There's talk about it on the Ubuntu forums as well. Hopefully in the next release they'll have an updated Pulseaudio with a lot of these bugs fixed.

It also baffles me why not many folks are complaining about it. It must be that Ubuntu people are not serious SDLMAME users, or they figure it has something to do with their hardware.


Edited by mochamame (18/10/09 08:44 AM)

Top
#55257 - 18/10/09 10:43 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: mochamame]
couriersud Offline
Senior Member

Registered: 19/02/07
Posts: 384
either use "-ad esd" or "-ad pulse". This overrides the default "alsa" driver.

Top
#55807 - 31/10/09 10:02 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: couriersud]
akumajo Offline
Member

Registered: 05/05/09
Posts: 8
hello

same problem here (tested with ubuntu 9.04 and 9.10)

another problem is that i have no sound with SDLMAME over hdmi (and only with SDLMAME, other softwares works fine with audio)

so if i want good speed, i must disable sound in SDLMAME
and if i enable sound, SDLMAME is very slow + no sound over HDMI

i will wait a bit but it seems that i will have to switch back to Windows XP or Ubuntu 8.xx .

HARDWARE SPEC :
- CPU ATOM N230 (1.6Ghz *2)
- Gforce 9400 ION
- 180.xx and 190.xx tested

this setup works perfect for cps1/2/3/neo geo with previous sdlmame versions/ubuntu


Edited by akumajo (31/10/09 10:10 AM)

Top
#55808 - 31/10/09 10:40 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: couriersud]
couriersud Offline
Senior Member

Registered: 19/02/07
Posts: 384
Originally Posted By: couriersud
either use "-ad esd" or "-ad pulse". This overrides the default "alsa" driver.

Did you try this?

Top
#55809 - 31/10/09 10:49 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: couriersud]
couriersud Offline
Senior Member

Registered: 19/02/07
Posts: 384
and you have to install libsdl1.2debian-all .... Ubuntu installs the alsa-only version by default.

Top
#55812 - 31/10/09 11:37 AM Re: sldmame + Ubuntu 9.04 = CPU pegged at 100% [Re: couriersud]
akumajo Offline
Member

Registered: 05/05/09
Posts: 8
hi

i installed libsdl1.2debian-all

when using -ad esd <- no more slowdown
when using -ad pulse <- slowdowns

and still no sound over hdmi (for both)

thx for tips btw

Top


Moderator:  R. Belmont 
Who's Online
7 registered (Duke, Micko, Haze, Kale, AWJ, Dr.Zer0), 10 Guests and 12 Spiders online.
Key: Admin, Global Mod, Mod
The Home Of EmuPolitics(TM)

Forum Stats
3711 Members
9 Forums
5863 Topics
58351 Posts

Max Online: 162 @ 01/05/07 03:28 AM