QSpice under Wine in Linux

Hello

I have installed Windows emulator “Wine” version 8.13 (staging) and enabled in the
Configuration “Hide Wine version from applications” enabled. With this I was able to install QSpice on Ubuntu Linux 22.04 and it runs.

Unfortunately, a black background prevents the program from handling, like a shroud. This is a pity, because it has interesting new features.

I think it’s just a problem with the graphics output.

Tom

1 Like

Hi Tom,

Yes, that’s about as far as we’ve made it, too. QSPICE is not not intentionally preventing the display from rendering, but there’s something about how Wine handles the GPU calls that is creating an incompatibility.

Wine support is on our list of “things we’d like to do.”

Thanks again for trying it!

I’m looking forward to trying out qspice.

Thanks

I’ve found a workaround to the graphics glitches: Add a single symbol to a schematic, click Edit → Color Preferences. In the dialog you can select colors for the CAD symbols, when hovering slightly to the bottom right of a symbol, a white box should appear around a lot of black. Click that to select the text field and pick another color. Now all text should be visible again.

I haven’t tried it out much more than that, but at least it makes text visible again. It seems that the wine bug is only related to how the background is being drawn in Direct2D, so maybe there’s an easy fix on either the wine or QSPICE drawing code for it.

edit: i also opened an upstream bug here: WineHQ Bugzilla – Bug 55353 – D2D Rendering glitches in QSpice

That’s some progress. Thanks. I’ll be interested to see if anyone can sort it out from the Wine side too.

In prior art, I went to great lengths to get my Windows app to run on WINE. The worst was that WINE didn’t do Windows messaging correctly so I had to go to polled inter-thread communication from the native interrupt as the app used on Windows. There were about a dozen graphic rendering errors, too. In the end, it ran mostly right on WINE, but not perfectly. To WINE’s credit, they finally fixed windows messaging years later.

I gave up on WINE for QSPICE when I saw it converted DirectX12 calls to GDI. The problem is that that will be too slow and have pixelated graphics like the 1970s Pong game. I don’t see a path to getting QSPICE to a viable point on WINE. I’ll revisit it when WINE implements with DirectX12 API.

Maybe running QSPICE on a virtual machine on LInux would work. I think you’d need a Windows license(I know, the horror) and I don’t know if the GPU’s performance would come through the virtual machine.

There’s dxvk (and vkd3d and proton et al) these days with which some games for windows even run faster on linux than on windows. But as always, ymmv. At least they’re very responsive and quick to fix bugs when reported.

As for running it in a VM, I tried that (especially because i have one for PSpice for TI anyways) and it’s just such a pain. I don’t know if it’s just Windows 11, if VirtualBox took a nose-dive in software quality, or if I’m just unlucky with my specific combination of hardware and software. I’ll rather use something i can run with wine even if it has graphical glitches, if it just works.

Hello Mr. Engelhardt.

Maybe the team at Wine will be able to solve the problems. I thank them for their work on LTSpice and now on QSpice, enjoy working with the program.

Hello Mr. Strang.

I have tested many different options for wine with “winecfg” and “winetricks”. Unfortunately without success.

Tom

Thanks Tom. The Wine team’s progress will be interesting to watch!

Sounds like the issue is only with the visualization.
If just to enable command line operation on Linux (run an existing netlist), is it possible to compile the simulator to run on Linux natively?

ProtonDB and similar are used with WINE for 3D rendering

Hello jerryhu.

Yes, it concerns only the graphic. The GUI and the simulator work fine.
For schematics and output window, a black background covers the image and makes input impossible.

Tom

Dang, was hoping the “next generation” simulator would have native Linux and Mac builds. Can understand the reasoning not to, when deeply entrenched in the Windows paradigm. Guess I’m curious if something like Porting | Vulkan | Cross platform 3D Graphics was considered - they’re always touting their performance gains.

Also see Run Microsoft Windows software on Mac, Linux and ChromeOS | CodeWeavers but I have no idea if this would work. Does have a free trial so guess we should test this. $74 would be better than a $120 Windows license + virtual machine.

I would be very interested to hear if this works if you get a chance to test it. My MacBook Air M2 is away from me for the next week, so it will be some time before I can try it myself.

As Eddie has pointed out, Parallels runs QSPICE just fine on a Mac, but yeah, that’s $99/year for Parallels plus a Windows license. I’ll note that Windows 11 licenses are available from legitimate online resellers at deep discounts.

Many of the MCU vendors (Microchip, ST, Arduino, etc) now support Linux and MacOS as well. The Cheese may be moving …

I am running QSPICE in VirtualBox with a Win 10 64 guest under Linux Mint Cinnamon on a quad core laptop. Took a bit of fiddling to get Windows to not be too painfully slow, but it’s not too bad now. QSPICE looks great. The SMPS sim is incredibly fast. BTW, Windows can be activated with any Windows product key; it’s no longer tied to a specific disc and they no longer ask all kinds of questions. Feed in a product key, click ‘Activate’, done.

The only issue I have with the VM is that its idea of ‘full screen’ needs some work. I don’t want to wait for Wine to add GPU support, so my dilemma is whether to do a dual-boot of Windows on this machine or live with the smaller display window for now. I’m leaning toward the latter.

That’s fantastic news! Do you have any configuration tips for VirtualBox itself?

I accepted most of the defaults in VirtualBox settings, but upped memory to half the physical (4GB for 8 in this case), and upped the virtual processors from 1 to 2.

The most important thing seems to be to install VM guest additions and update it if that option is given. I did not change anything in additions, nor did I change the default graphics handler. I did enable accelerators, though.

I was able to get Windows and QSPICE to true full screen by toggling ‘scale’: home+C. The ‘home’ key defaults to right-ctrl, but can be changed. Press once and the VM reverts to a small window. Press again to get full size.

The only glitch I have seen so far is in the rendering of the audio amp schematic; I see labels but no wires or components. The SMPS schematic displayed correctly before I began making changes to the VM, so I have to check that again. VirtualBox provides other graphics handlers, so it may be that one of the others will produce more consistent results.

I just got it going yesterday, and am still testing. I hope to replace the prior simulator and make QSPICE my daily driver, but that depends on how much stuff I can import.

For now, I’m very happy not to have to dual boot Win10 to get this to work; I very much prefer to stay in Linux. Hoping Wine adds full GPU support sooner rather than later, which would be a more seamless / less resource-intensive solution.