Getting "too slow" messages in LINUX VICE

You need an actual VIC.

Moderator: Moderators

User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Getting "too slow" messages in LINUX VICE

Post by ral-clan »

Hi guys,

I've just set up VICE in Lubuntu linux.

I'm running a Pentium 4 single core machine at 2.8Ghz with 3GB RAM.

In Windows XP with WinVICE this machine can emulate commodore 8-bits perfectly. However, in Linux VICE I get ocassional lag and see the following message in the terminal windows:

Warning! Your machine is too slow for current settings!


Can this really be the case? It seems a little absurd. I was running a VIC-20 emulator on a 486 years ago and that machine seemed to handle things. WinVICE on the same machine handles things.

PET emulation is even worse - it crawls to the point it's unuseable. C64 emulation, ironically, is the best, with little stutter.

Things get worse as I increase the size of my emulation window or go full screen.

NOTE: I've noticed when I shut off "enable hardware scaling" under settings - the CPU usage drops by about 40%. But then I can't get true fullscreen modes anymore, only small windowed modes.

Any tips/advice to speed the emulation up?
I'm wondering if it is due to some problem in my ALSA sound card driver? Previously I wasn't getting any sound at all and had to switch VICE's sound output from PULSE to ALSA. I then got sound. I did that very early on when setting up VICE, and hadn't noticed yet if I was getting lag under PULSE.

Thanks.
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
User avatar
orion70
VICtalian
Posts: 4340
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Getting "too slow" messages in LINUX VICE

Post by orion70 »

It's Linux. Switch to Windows, or DOS. Microsoft is better. :P
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Getting "too slow" messages in LINUX VICE

Post by ral-clan »

Well, it's a dual-boot system so I can switch to Windows no problem, but is it merely because VICE in Linux isn't as well written?
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

What version of VICE are you running? BTW, the latest is 2.4.6. I reported this "too slow" message back over a decade ago (I can retrieve the original email), when I had a dual PIII workstation for Windows 2000 Pro and Red Hat Linux. I thought it was a bit obnoxious then. And I still get it occasionally on my new workstation running xvic. In other words, don't judge it solely by that. :lol:

Most performance issues are not processor-related, but the video emulation, for Linux and Windows alike. So this will depend on your graphics card, VICE build (GTK? SDL?), and VICE settings. Work with me here:

Open a terminal window, and type: glxinfo | grep direct
You should see this output: direct rendering: Yes
If you do not, everything is running slow, and your Lubuntu needs a little help. PM me if this is the case, because you have a core GUI issue.

Next, type: xvic
It should spit out a "GUI compiled for" identifier upfront (may have to scroll backward to see that), followed by GTK+ or SDL. Which one please?

FYI, GTK has your typical mouse-driven menu interface; SDL uses a hotkey, like F12, to enter a curses-based interfaced. That should tell you which, too.

For GTK:
Now do in order, and only make changes until you see 100%, 60 fps (50 fps if it's PAL); so go to Settings menu option:

1. Refresh rate and set to 1:1
2. VIC settings, check Video cache to ON
3. VIC settings, uncheck Alpha blending to OFF
4. VIC settings, choose Render filter to unfiltered
5. VIC settings, uncheck Hardware scaling to OFF

For SDL:
Doable, try F12 and attempt the same above, else just type all of this at the CLI instead:
xvic +VICfull +VIChwscale -VICvcache -VICfilter 0 -refresh 1
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

I also see you had switched from pulse to ALSA. That's not the typical thing to do nowadays, pulse is the standard. But given the age of the machine, you might have something there.

Usually for such things, I simply go to an SDL build for VICE to avoid heavier multimedia APIs; just select SDL for audio, and that should work better than ALSA for emulation. Another way to just test if Audio is causing your latency, is just disable it, and see what occurs. Then trouble-shoot from there.

BTW, the PET emulation was a bit horrifying with earlier 2.4 releases, especially 2.4.0, so check that version number!
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

orion70 wrote:... or DOS. Microsoft is better. :P
Oh, those Italians and their luscious wine! :P
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Getting "too slow" messages in LINUX VICE

Post by ral-clan »

rhurst wrote:What version of VICE are you running?
2.4.6 I believe.
Open a terminal window, and type: glxinfo | grep direct
You should see this output: direct rendering: Yes
Yup, I see it.
Next, type: xvic
It should spit out a "GUI compiled for" identifier upfront (may have to scroll backward to see that), followed by GTK+ or SDL. Which one please?
GTK+
For GTK:
Now do in order, and only make changes until you see 100%, 60 fps (50 fps if it's PAL); so go to Settings menu option:

1. Refresh rate and set to 1:1
done.
2. VIC settings, check Video cache to ON
done.
3. VIC settings, uncheck Alpha blending to OFF
Can't find this setting anywhere.
4. VIC settings, choose Render filter to unfiltered
done. Too bad. I really like CRT emulation.
5. VIC settings, uncheck Hardware scaling to OFF
Done. This usually results in a 30% CPU usage drop, but then I can't get a proper full screen display. I have to use a compromise which doesn't fill the full screen. Too bad. It looks so nice when hardware scaled.
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Getting "too slow" messages in LINUX VICE

Post by ral-clan »

rhurst wrote:I also see you had switched from pulse to ALSA. That's not the typical thing to do nowadays, pulse is the standard. But given the age of the machine, you might have something there.

Usually for such things, I simply go to an SDL build for VICE to avoid heavier multimedia APIs; just select SDL for audio, and that should work better than ALSA for emulation. Another way to just test if Audio is causing your latency, is just disable it, and see what occurs. Then trouble-shoot from there.

BTW, the PET emulation was a bit horrifying with earlier 2.4 releases, especially 2.4.0, so check that version number!
I use ALSA because when I choose PULSE it says there is an initialization error. I don't think ALSA is causing my problem because when I disable sound I still get high CPU usage (when hardware scaling is enabled - that is the cause of my problem).
rhurst wrote:Ifor such things, I simply go to an SDL build for VICE to avoid heavier multimedia APIs; just select SDL for audio, and that should work better than ALSA for emulation. Another way to just test if Audio is causing your latency, is just disable it, and see what occurs. Then trouble-shoot from there.

I don't see an SDL option in VICEs audio device drop down list (I see, ALSA, PULSE, WAV....many others).

Yes, PET emulation seems terrible. Even when the PET emulation is idling (i.e. running no program) it is using 46% of the CPU (wheras the VIC and C64 emulators use around 10-16% at idle).

I wonder if somethign went wrong when I upgraded to Lubuntu 14.04 today. Before that VICE woudn't even start. After upgrading VICE finally started (then I discovered this high CPU usage).

The upgrade to 14.04 also automatically upgraded my MAME installation - and what had run swiftly and sharply at 1920x1080 before (MAME 0.149) became a crumpled, slow, stuttering mess (MAME 0.152) unless I crank the screen resolution all the way down to an unscaled (i.e. game native) resolution.

It also seems to be a hardware scaling issue with MAME.

I think something broke in the latest 14.04 MAME that caused hardware scaling to consume high CPU cycles. Seems to be a problem shared by both VICE and MAME.

Erg.

EDIT: YUP. It is something that wrong with full screen scaling in 14.04. I just started my FS-UAE emulator, which always scaled beautifully to full screen, very quickly. It is also choppy now. Something's wrong with hardware full-screen scaling and my graphics card with release 14.04 of Lubuntu/Ubuntu. I went through heck to configure the driver for it, and finally got it to run great under 13.10. Now 14.04 has it broken again (it plays YouTube, etc. just fine, but for some reason hardware scaling of emulators has it choking). Discouraging - afraid to try and touch it now for fear of breaking the whole system.
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

I will PM you on this.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
orion70
VICtalian
Posts: 4340
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Getting "too slow" messages in LINUX VICE

Post by orion70 »

rhurst wrote:
orion70 wrote:... or DOS. Microsoft is better. :P
Oh, those Italians and their luscious wine! :P
(I was answering to this, then I got the pun, LOL)
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

Well, you're seeing the dropoff of old hardware support there, huh? Doesn't mean you cannot run a yesteryear Linux OS stack (just like Windows XP) supporting drivers for such hardware... and still run "fresh" apps. Just don't expect the "good" stuff coming to do you any good. :cry:

With advancements in graphics hardware handling in the Linux 3.1x kernels, Mesa 10, SDL 2, a whole new supporting framework and drivers from the major CPU manufacturers in Intel and AMD has already arrived. And their price/performance is just too good to ignore. nVidia better step it up, or they will go the way of irrelevance, like Voodoo, which they bought ironically. :|
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
groepaz
Vic 20 Scientist
Posts: 1185
Joined: Wed Aug 25, 2010 5:30 pm

Re: Getting "too slow" messages in LINUX VICE

Post by groepaz »

rhurst wrote:5. VIC settings, uncheck Hardware scaling to OFF
wat?

seriously. first you recommend checking for hw acceleration in the OS.... then recommend to disable it in the app? no sense it makes young padawan. its like putting a can of racing fuel on the back seat of your car and then expecting it to fix your stuttering transmission.

disabling hw acceleration hardly makes any sense (because even the oldest card can draw a single texture mapped polygon faster than the software blitting routines) - if that actually helps then you have a major problem outside VICE. try if something like mplayer works with hw scaling - if yes then you can safely expect VICE to work just fine with hw acceleration too.

if you are really suspecting a performance issue, then disable two things:
a) SID emulation (set it to "fastsid", which uses almost no CPU)
b) CRT emulation (set render filter to "none")

these two use like 90% or so of the cpu time when VICE is running, if you switch those off and still have those issues then performance is NOT the problem. (with those settings it will run on 500mhz box easily)

if those DO fix it, then you have a slow pc, and nothing can be done about it. certainly none of it should be required on any pc from this century (personally i am using a 10 year old single core box with 1.7ghz and have no major problems like that)

if not, my recommendation would be to experiment with sound issues first. many sound drivers and/or even chipsets lie about their exact sample frequency and/or number of played samples, which is a big problem when syncing to the sound. (which is what results in the ambiguous "your pc is too slow" message, what it really means is "there was a problem with filling the sound buffer" =P)

- start with "x64 -default" to make sure you are not using any old settings file. set to fastsid and no crt emulation. dont set it up further before you got things working, especially don't use any fancy tweaking options like 1:1 frame sync, it should work with the defaults before you touch these. don't try using fullscreen before it works windowed :)
- check the startup messages of x64 - it should say what CPU it is compiled for... it should match your box as close as possible (also shown in "help->about)
- set the output sample rate to 48kHz. this sometimes fixes things because a bunch of cheap chips actually always run on 48kHz and then the driver converts whatever you throw at it. and the driver would actually not upsample in perfect speed, but slightly change the speed so it can "cheat" and use integer steps in the original data, which again disturbs the sync stuff in VICE.
- slightly increase or decrease the sound buffers in VICE. drivers may (and unfortunately sometimes do) lie about the actual buffer sizes, which again disturbs the syncing
- for the above mentioned reasons, play around with the different sound drivers in VICE. using ALSA over pulse may or may not work better. there have been times where SDL worked better than the other drivers for me.
(just for curiosity: what distro is it that ships packages of 2.4.6 ? or did you compile it yourself?)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Getting "too slow" messages in LINUX VICE

Post by ral-clan »

This is Lubuntu 14.04. I'm using VICE 2.4.6 downloaded through Lubuntu's Software Centre.
I don't think this is a sound issue because I've disabled sound, and used all sorts of different settings, including OFF, ALSA and PULSE - no change.

Turning off hardware scaling immediately results in dramatic CPU "unloading" (goes down from using 130% CPU to about 40%) in VICE, MAME and FS-UAE.

Turning on and off CRT emulation does not help.

It's not that my processor is too slow to handle these emulators (2.8GHZ P4) because FS-UAE and MAME ran well under 13.10 (Saucy) and now, like VICE, also stutter and use high CPU in full screen mode under 14.04. Once hardware scaling us enabled in all three emulators the emulation in all three screeches down to a snail's-pace. When disabled, they run well again (but the full screen experience doesn't look as good anymore - aspect problems, no filtering, etc. etc.)

I feel fairly certain it's a problem with the openGL function on the proprietary Nvidia legacy drivers and Lubuntu/Ubuntu 14.04.

I tried to run MPLAYER (and Gnome player) - but it won't run at all! I can't remember the error message (I'm not at home at the moment) but can get it for you if you'd like. It's some sort of initialization error - problem with the Nvidia drivers again I suspect.

However, VLC Player plays fulls screen videos just wonderfully, with low CPU usage.

I've filed a bug report:

https://bugs.launchpad.net/ubuntu/+sour ... ug/1310392
Image Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Getting "too slow" messages in LINUX VICE

Post by rhurst »

groepaz wrote:first you recommend checking for hw acceleration in the OS.... then recommend to disable it in the app?
:lol: YES! Because "checking" for hw acceleration does not translate equally to understanding if you have it, or not. That's what try-catch is all about, and notice it was the last item to catch. :wink:

Obviously, the problem was X resorting to software rendering from a failed nvidia driver, because I got hold of the system's vitals and X log, privately.

BTW, that's why I compile for SDL and GTK everytime, for all the reasons stated, as it serves me well to have something comparative from the same source tree, my master. 8)
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
groepaz
Vic 20 Scientist
Posts: 1185
Joined: Wed Aug 25, 2010 5:30 pm

Re: Getting "too slow" messages in LINUX VICE

Post by groepaz »

ral-clan wrote:This is Lubuntu 14.04. I'm using VICE 2.4.6 downloaded through Lubuntu's Software Centre.
interesting, is that an official repo? must be the first distro that has packages of intermediate versions... :)
that's why I compile for SDL and GTK everytime, for all the reasons stated, as it serves me well to have something comparative from the same source tree
how does that even make a difference? if you enable the respective backends, both can use pretty much the same sound- and video rendering paths.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply