Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support new OPL proxy with dynamic address #119

Merged
merged 11 commits into from
Dec 31, 2018

Conversation

jpcima
Copy link
Collaborator

@jpcima jpcima commented Dec 29, 2018

#118 I implemented the new OPL proxy requested by @datajake1999 with port change UI.
I have no ability to test however, can you check that I did right?

@Wohlstand
Copy link
Owner

It must don't break the Win9x workflow, be sure the built DLL is still be runnable on Windows 98, otherwise, please keep my old OpenWatcom built DLL for compatibility reasons (for the case of modern deployment, the new DLL will be included).

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 29, 2018

Why not rebuild the DLL with OpenWatcom based on new source?
Indeed the DLL I committed is the one which came from the pack, I have not rebuilt.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 29, 2018

Never mind, I understood what you mean as I read into proxy code.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 29, 2018

I rearranged opl_proxy in a directory hierarchy which has both of win9x which is the old, and modern the new one as it has been posted.

@datajake1999
Copy link

InpOut32Helper.zip
The directory with the modern source doesn't have the InpOut32Helper code.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 29, 2018

I fixed things and I made a build.

  • Under the modern directory, DLL files were in confusion.
    liboplproxy.dll was an old one, and oplproxy.dll was a new build made with MS C++ compiler.
    I renamed oplproxy.dll to liboplproxy.dll, being the name that OPL3-BE searches for.
  • MS symbol mangling being different, it needs to search without the '_' char at beginning.
  • There was one more change to make such that loading would be permitted in Windows != 9x.

@datajake1999 do you have ability to confirm this build as working? the port setting is accessible in "Settings>Hardware OPL"
opl3_bank_editor.zip

@datajake1999
Copy link

The build you uploaded isn't screen reader accessible, and I think this is because it was built with an older QT version. The latest WIN32 release is screen reader accessible and I think this is because it uses a newer QT version which has accessibility features.
Can you please upload a build with the version of QT that is used for modern WIN32 builds?
Thanks.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

I would but I unfortunately this computer of mine doesn't have the toolchain set up for Qt5, so this is Qt4.
When the code is merged, Qt5 is going to be available by automatic builds.
I will let @Wohlstand validate the code for merging, because I don't have hardware for testing right now.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

Wait you may be in luck, I think Appveyor has artifacts avialable. https://ci.appveyor.com/api/buildjobs/l5sucg6by98gxb2t/artifacts/opl3-bank-editor%2Fopl3-bank-editor-dev-win32.zip

@datajake1999
Copy link

The address of my card is EF50, but when I enter the address it only enters EF5.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

@datajake1999
Copy link

I just tested it with the correct port address and I don't get anything from the hardware. I don't know what I am doing wrong in my code, as the InpOut32Helper I am using is the same code I use in my OPL3 MIDI driver fork, which works perfectly.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

I completed the work and I fixed the bugs, this time tried on my side with a fake DLL. Does this look fine?
EDIT +sending reset commands on change
https://ci.appveyor.com/api/buildjobs/vhowa69ysxmn3rym/artifacts/opl3-bank-editor%2Fopl3-bank-editor-dev-win32.zip

@datajake1999
Copy link

It still doesn't work. I compiled liboplproxy.dll with the _DEBUG define, and the debug log only shows the driver opening and closing, no reads or writes.

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

@Wohlstand please debug on real card when you are able, if you don't mind.

@Wohlstand
Copy link
Owner

Wohlstand commented Dec 30, 2018

I know that some C-Media chips are lacks OPL3 chip on backend, but, I have some set of C-Media where it's is presented, so, will test on it... I was able to even run it on Windows 98 with AdLib Gold driver that played FM sound on C-Media card!

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 30, 2018

Ok instead of playing in WINE, I tested on real Windows following these steps.

  1. open Windows XP in Virtualbox
  2. took the latest of binary builds, replaced liboplproxy.dll with a _DEBUG build by mingw
  3. created the folder C:\OPLSynth, destination of logging messages
  4. I tick "Settings>Choose chip emulator>Proxy to real OPL3 chip"
  5. I set the port in Hardware OPL
  6. I select an instrument slot, play on keys a bit

The verdict: the hwlog.txt shows read and write commands to address range 0xef80-ef83.
My experience contradicts yours @datajake1999, I am able to see occurence of input/output.

@datajake1999
Copy link

I forgot to set the chip emulator to "Proxy to the real OPL3 chip". That was the problem. It works!

@Wohlstand
Copy link
Owner

I think, the usage of real OPL3 chip would be possible on Linux too: vgmrips/vgmplay-legacy#39
After I'll test this, I'll try to run a test on my Linux host with same sound card...

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 31, 2018

@Wohlstand for Linux, it can be made, have a look this code here.
https://github.com/aybe/dosbox-svn-daum/blob/bd7891dde34a20f00fd953921441f9cce8eb28ed/src/libs/porttalk/porttalk.cpp#L231-L248

It needs to require IO permissions from kernel, such that it can make privileged assembly calls from user space. The code needs the root and is probably 32 bit only.
Maybe, a separate service with setuid would do in this case.

@Wohlstand
Copy link
Owner

Wohlstand commented Dec 31, 2018

It needs to require IO permissions from kernel, such that it can make privileged assembly calls from user space. The code needs the root and is probably 32 bit only.
Maybe, a separate service with setuid would do in this case.

I think, yeah, a proxy daemon that will be installed into the system, or the kernel module that will become as a bridge, that would be a solution. 🦊

@Wohlstand
Copy link
Owner

Wohlstand commented Dec 31, 2018

Just now I installed my CMI8738 equiped sound card to my Brother's PC and tried a test, but:

@datajake1999 , a minor question: how to figure out for a sound card address on Windows? I have tried the thing, but it won't work. Also, let's then make a little manual at Wiki how to figure out for the port and begin use it? Also, @jpcima, please save the port value into settings to restore it on program restart.

I have tried this build: https://ci.appveyor.com/project/Wohlstand/opl3bankeditor/builds/21296132/job/vhowa69ysxmn3rym

@jpcima
Copy link
Collaborator Author

jpcima commented Dec 31, 2018

@Wohlstand : the answer is given by nukeykt in this issue thread you linked yourself.

Legacy 0x388 port does not work through PCI express, so you have to use FM port on card's PCI range. As far i remember FM port address was PCI port + 0x50 (e.g 0xd050 for your setup).

@Wohlstand
Copy link
Owner

Okay, thanks! Now it works! (I think, yeah, I missed up that note, but it helped me)
default

So, to avoid future confusions, we must to make a short note / manual for users to let them easier figure out for a chip on their C-Media or other cards.

@Wohlstand Wohlstand merged commit 7462cf4 into Wohlstand:master Dec 31, 2018
@Wohlstand
Copy link
Owner

Done! :3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants