Build Your Own Arcade Controls Forum

Software Support => GroovyMAME => Topic started by: agalardi on October 10, 2019, 09:17:08 am

Title: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 10, 2019, 09:17:08 am
Hi, I would like to do my bit to this forum.

I faced several sound problems to work with groovyMAME (0.213) with portaudio and some frontends (HyperSpin+RocketLaunch in my last try).

The problem mainly is that both programs want the audio device at the same time (I am sure that it is more complicated, but basically...).

I solved the problem installing a "virtual sound card" that really pipe the output to the real one. I set groovyMAME to virtual device and VOILA!

The program (free) I used is "Virtual Audio Cable" and It is really easy to install and configure. I do not say the URL because I don't know the forum rules.

If someone want more details, please let me know and I will do my best.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: Foxhole on October 12, 2019, 09:40:05 am
Personally i use 2 sound cards. Not specifically because of portaudio or hyperspin.
But your solution sounds great.
It will probably be useful for retroarch with wasapi, too.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: alex2005 on October 13, 2019, 10:51:57 am
Could you please elaborate a bit how did you set up?
I downloaded the program and my mame ini loos like this:

sound                     portaudio
audio_latency             1.0


pa_api                    "Windows WASAPI"
pa_device                 "CABLE Output (VB-Audio Virtual Cable)"
pa_latency                0.003334

But im getting no sound in Cadillacs and Dinosaurs" for instance.
I use Windows 7 x64 with Hyperspin and Groovymame (not rocketlauncher)

As I have a Realtek integrated souncard (which I heard is not supported), what I used until now was:

#pa_api                    "Windows Directsound"
#pa_device                 none
#pa_latency                0.017


Thank you!
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 14, 2019, 04:32:50 am
First of all, you need to configure the "vitual cable" so you need to go win Windows to:
- Sound->Recording->CABLE Output->Properties->Listen Tab-> Click "Listen this device" and SELECT YOUR REAL SOUND CARD->Apply and exit.

Second is to select the right device in MAME.INI. Those are my settings, but the most important for you is pa_device:

Code: [Select]
sound                     portaudio
audio_latency          0

pa_api                   "Windows WDM-KS"
pa_device               "Speakers (VB-Audio Point)"
pa_latency              0.001

Try again with those settings and good luck!
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: alex2005 on October 14, 2019, 02:20:42 pm
Thank you!
Seems to work like a charm now.
I have

pa_api                    "Windows WDM-KS"
pa_device                 "Speakers (VB-Audio Point)"
pa_latency                0.001

and using windows 7 x64

I dont "hear" a lot of difference with portaudio and without, even on Cadillacs and Dinosaurs. Are there other games where this difference is noticeable?
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: Paradroid on October 14, 2019, 03:06:09 pm


I dont "hear" a lot of difference with portaudio and without, even on Cadillacs and Dinosaurs.

There is no tonal difference: it's all about latency. You will hear the sound sooner with Port Audio.

Sent from my SM-G955F using Tapatalk

Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 14, 2019, 06:52:41 pm
It doesn't work for me :(
I have configurated mame.ini properly, I have sound in MAME running with this thing. But once in MAME after hyperspin I don't have any sound

I'm also using:

pa_api                    "Windows WDM-KS"

in pa_device I've tried several options: "Altavoces (VB-Audio Point)" (my w7 is in spanish) or "Speakers (VB-Audio Point)"...... Whatever I write in "pa_device" I always have sound in MAME, but never in mame after hyperspin.
BTW, why do you call de device (VB-Audio Point) ??  I haven't seen that name ending in "point" anywhere in Windows. In Windows 7 this virtual audio device is called VB-Audio Virtual Cable

The driver name for me in Windows 7 x64 is not VB-Audio Point, it is VB-Audio Virtual Cable
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 14, 2019, 07:44:47 pm
the nvidia q3583 is my main sound card

I guess this should be my configuration: 


sound                     portaudio
audio_latency          0

# PORTAUDIO OPTIONS
#
pa_api                    "Windows WDM-KS"
pa_device                 "CABLE Output (VB-Audio Virtual Cable)"
pa_latency                0.001


it doesn't work anyway. It seems mame doesn't recognize the pa_device and just uses the default sound card, with the obvious issue with hyperspin.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: Foxhole on October 14, 2019, 08:26:32 pm
Please post a log.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 14, 2019, 09:15:43 pm
MAME behaviour has changed now. Now mame64 crashes unless I run it on cmd. In that case it gives this error:

Portaudio error: Invalid device

(no error.log file is created)

If I run it double-clicking on mame64 icon mame will crash, even if I have "none" in pa_device

The only solution after this is disabling and enabling again my sound card. Then MAME behaves normally again.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 14, 2019, 09:25:43 pm
FIXED !!!

I've connected an USB sound card I had and it perfectly works now !!

The problem was that integrated sound card inside my NVIDIA graphic card.

The parameters in mame.ini are the same as the ones previously indicated.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 15, 2019, 03:31:47 am
Anchounio,

Of course, a second sound card solve the problem. That is because a virtual one solve it too.

Let me explain the process in detail:

- Download VBCABLE_Driver_Pack43.zip and install it (VBCABLE_Setup.exe)


- Configure VBCABLE:

   - Go to Windows sound properties: Start->Run: control mmsys.cpl sounds
      (also Control Panel->Sounds, or right click speaker icon...)
   - Recording TAB->Cable Output->Properties->Listen TAB:
      - Tick "Listen this device"
      - Select your Real sound card

<<<<I am sorry, I don't know how to insert a screenshot>>>


- Configure GroovyMAME:

   - We need to identify the name of the virtual sound card from GroovyMame:
      - From CMD we launch "groovymame64ex.exe -sound portaudio -v"
      - We exit groovymame (usually ESC)
      - We analize the console output taking into account lines starting with "PortAudio:"
         - We will see the same devices in each API (MME, DirectSound, WASAPI, WDM-KS, etc.)
Code: [Select]
...
PortAudio: Windows WASAPI: "CABLE Input (VB-Audio Virtual Cable)"
PortAudio: Windows WASAPI: "CABLE Output (VB-Audio Virtual Cable)"
PortAudio: API Windows WDM-KS has 6 devices
PortAudio: Windows WDM-KS: "Speakers (Realtek HD Audio output)" (default)
PortAudio: Windows WDM-KS: "Línea de entrada (Realtek HD Audio Line input)"
PortAudio: Windows WDM-KS: "Micr├│fono (Realtek HD Audio Mic input)"
PortAudio: Windows WDM-KS: "Mezcla est├®reo (Realtek HD Audio Stereo input)"
PortAudio: Windows WDM-KS: "CABLE Output (VB-Audio Point)"
[b]PortAudio: Windows WDM-KS: "Speakers (VB-Audio Point)"[/b]
PortAudio: Using device "Speakers (VB-Audio Point)" on API "Windows WDM-KS"
PortAudio: Sample rate is 48000 Hz, device output latency is 10.00 ms
...

      The name of the device should be "Speakers (VB-Audio Point)".

   - We Configure MAME.INI
      - I choosed WDM-KS API so my config is:
Code: [Select]
sound                     portaudio
audio_latency          0

pa_api                   "Windows WDM-KS"
pa_device               "Speakers (VB-Audio Point)"
pa_latency              0.001

I hope I have explained it better now  ;)
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 15, 2019, 10:19:39 am
Thank you for the better explanation agalardi

In my case, my problem was that the integrated nvidia sound card just didn't work for this. I disabled it, installed an USB sound card, configured the virtual one and it worked with no problems !
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 16, 2019, 05:32:15 pm
It randomly fails, and doesn't work again untill windows restart. It is not related with MAME: it doesn't even work inside the "sound" menu in Windows 7. 
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 17, 2019, 03:10:56 am
Hi anchounio,

All I can say that it is working for me without failures. It would be great if we could get the experience of other people.

Have you tried disabling your NVIDIA integrated sound device from BIOS?

Could your try to disable and re-enable audio devices USB and VB-Cable (only one per try) from device manager?
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 17, 2019, 05:29:13 am
Yeah, I've tried disabling the vb-cable from device manager, enabling again but it still doesn't work
When it fails, the only solution is restarting my pc... which is not my desired solution.

I haven't tried to disable the remaining sound cards. I'll try it and keep you informed :)
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: alex2005 on October 17, 2019, 02:19:01 pm
working like a charm for me :)
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: mrchrister on October 21, 2019, 02:57:27 pm
i wonder if using a virtual audio driver could introduce lag?
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 22, 2019, 06:25:33 am
working like a charm for me :)

Great! I would be even better if we could have the experience of more people.

i wonder if using a virtual audio driver could introduce lag?

I haven't notice any lag, but I am sot sure.

Thinking about it, if we detect any lag, maybe it would be better to set virtual audio as default to work in HyperSpin and point GM portaudio device to real one.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 23, 2019, 08:16:31 am
Thinking about it, if we detect any lag, maybe it would be better to set virtual audio as default to work in HyperSpin and point GM portaudio device to real one.

I'm afraid that's not possible. Hyperspin will work by default with the main sound device with no option to change it.  Hyperspin loves not allowing to configure stuff. It also loves not solving their own issues, as its portaudio+MAME problem
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 23, 2019, 08:18:48 am
By the way, I've long tested this solution now and I haven't experienced any more problems... It seems its failure the other day was an isolated problem, not caused by the virtual audio device.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: agalardi on October 23, 2019, 08:53:26 am
Thinking about it, if we detect any lag, maybe it would be better to set virtual audio as default to work in HyperSpin and point GM portaudio device to real one.

I'm afraid that's not possible. Hyperspin will work by default with the main sound device with no option to change it.  Hyperspin loves not allowing to configure stuff. It also loves not solving their own issues, as its portaudio+MAME problem

anchounio, when I said to set the virtual audio as default, I referred to set it as main sound device. In this way HyperSpin should work.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: anchounio on October 23, 2019, 04:31:46 pm
Thinking about it, if we detect any lag, maybe it would be better to set virtual audio as default to work in HyperSpin and point GM portaudio device to real one.

I'm afraid that's not possible. Hyperspin will work by default with the main sound device with no option to change it.  Hyperspin loves not allowing to configure stuff. It also loves not solving their own issues, as its portaudio+MAME problem

anchounio, when I said to set the virtual audio as default, I referred to set it as main sound device. In this way HyperSpin should work.

Haha, I didn't realize!
That's a good idea!
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: yakk11 on November 01, 2019, 07:53:00 pm
This solution worked for me!  Thank you! :applaud:
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: Foxhole on December 21, 2019, 10:42:44 pm
Had a chance to try it. It works but i immediately noticed much more latency. I've checked my settings to be sure and also verified mame is using portaudio with the correct device. There is definitely more latency.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: Calamity on December 23, 2019, 03:47:45 am
Had a chance to try it. It works but i immediately noticed much more latency. I've checked my settings to be sure and also verified mame is using portaudio with the correct device. There is definitely more latency.

I thought that immediately when OP's posted about this solution. I could be wrong but appearently creating an indirect path for audio completely defeats the purpose of Portaudio in terms of low latency.

Problems caused by frontends should be addressed in the frontend's code itself. We should be merciless with frontends that break our emulators in any way.
Title: Re: Solution to sound with GroovyMAME + HyperSpin + Portaudio
Post by: mrchrister on April 06, 2020, 12:16:21 pm
I have it set up the the other way around - as mentioned earlier.
Default Windows Device - Virtual Audio Cable (not routed or configured in any way)
Mame - Portaudio
I don't have any attract sounds in Hyperspin so this worked great for me.