Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Portaudio settings ?  (Read 11840 times)

0 Members and 1 Guest are viewing this topic.

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Portaudio settings ?
« on: January 02, 2019, 06:40:49 am »
Could someone please advise how to set Portaudio for my setup ?

Not aiming at the best possible performance at any cost but rather I want to privilege high compatibility/universality and safer/light settings if possible (gonna set this on another fairly different system or maybe two later, and I'd rather not bother people with my asking every time)

I've read what we have about Portaudio and googled it too but couldn't find a clear answer to that, rather confused.

Found somewhere that I could run mame64 -sound portaudio -v and got this out of it (attached capture of all the portaudio related entries)



In short with that, what easy/safe/light/highly-compatible-universal Portaudio settings would you suggest ?
Code: [Select]
#
# OSD SOUND OPTIONS
#
sound                     portaudio
audio_latency             1

#
# PORTAUDIO OPTIONS
#
pa_api                    none  ???
pa_device                 none  ???
pa_latency                0  ???

EDIT: atached a random log with my current incomplete portaudio settings
« Last Edit: January 02, 2019, 06:50:53 am by schmerzkaufen »

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Last login:April 09, 2024, 03:45:52 am
  • retro maniac
Re: Portaudio settings ?
« Reply #1 on: January 02, 2019, 01:26:37 pm »
groovymame game -sound portaudio -pa_api "Windows WDM-KS" -pa_latency 0.003334 -audio_latency 1

Some tutorial -

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #2 on: January 02, 2019, 01:56:15 pm »
You mean like this ? bigblue's video didn't clear the whole thing for me sorry.

Damn that Portaudio thing would need a clear and clean complete tutorial somewhere, how to pick the right settings, why and what they do.

Code: [Select]
#
# OSD SOUND OPTIONS
#
sound                     portaudio
audio_latency             1

#
# PORTAUDIO OPTIONS
#
pa_api                    "Windows WDM-KS"
pa_device                 "Speakers (Realtek HD Audio output)"
pa_latency                0.003334

philexile

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 86
  • Last login:October 30, 2022, 03:45:01 pm
  • I want to build my a GroovyMame PC!
Re: Portaudio settings ?
« Reply #3 on: January 02, 2019, 02:50:37 pm »
The example you posted should work. Although, you need to specify which audio output option that you’ll be using.

Also, try pushing the audio to the lowest latency possible. I can’t remember off the top of my head, but I think I got it down to 0.00125. I’m using Windows 10.

You’ll know you’ve gone too far if the sound in games like Pac-Man take forever to trigger and when thy do they are distorted.

I noticed that if I have ANY application using audio Groovymame won’t launch. Just an FYI.

Random question: if frame_delay is set to 9 what is the approximate input latency for GroovyMame when using a CRT?


philexile

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 86
  • Last login:October 30, 2022, 03:45:01 pm
  • I want to build my a GroovyMame PC!
Re: Portaudio settings ?
« Reply #4 on: January 02, 2019, 02:52:55 pm »
Also, BigBlueFrontend’s channel is really informative and pointed me in the right direction many times. Does he post on this forum?

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Last login:April 09, 2024, 03:45:52 am
  • retro maniac
Re: Portaudio settings ?
« Reply #5 on: January 02, 2019, 03:11:53 pm »
I don't know how frame_delay works with portaudio. I didn't hear any suspicious sounds with frame_delay 2 and portaudio enabled.
If pa_device is not defined that first one (default/active?) is used.
« Last Edit: January 02, 2019, 03:14:48 pm by haynor666 »

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #6 on: January 02, 2019, 03:14:55 pm »
The example you posted should work. Although, you need to specify which audio output option that you’ll be using.

Isn't it that "Windows WDM-KS" I have already put ?

I really don't fully get that mumbo jumbo, I guess I am expected to pick either WASAPI, WDM-KS, or...(or what other choice there is?) and then a corresponding output if I can identify it in the list. Is that right ?

Also, try pushing the audio to the lowest latency possible. I can’t remember off the top of my head, but I think I got it down to 0.00125.
You’ll know you’ve gone too far if the sound in games like Pac-Man take forever to trigger and when thy do they are distorted
Well I am especially not looking at doing that, I'd just like a setting that provides an improvement over the default in MAME and that should work for most games.
If the value Haynor pointed at is that, then I'll be happy.

Also what is it that value represents anyway ? 0.003334, 0.00125 -> how am I supposed to know what to put here ? how do yoiu guys find out because those are not random figures.

Random question: if frame_delay is set to 9 what is the approximate input latency for GroovyMame when using a CRT?
Should be the same as the original game running on its orignal hardware.

(Assuming you don't have other things getting in the way of course, like OS settings that might produce delay (dunno much about W10), low input polling, laggy controller or usb adapter, etc)

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Last login:April 09, 2024, 03:45:52 am
  • retro maniac
Re: Portaudio settings ?
« Reply #7 on: January 02, 2019, 03:18:02 pm »
If You do not specify device than default will be chosen and You have in log already marked default one. With latency You have to experiment. Personally I lowered to 0.01.

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #8 on: January 02, 2019, 03:31:19 pm »
If You do not specify device than default will be chosen and You have in log already marked default one.
But how do I specify it ? haven't I done it already ? sorry but that's precisely what I'm asking.  :lol

With latency You have to experiment. Personally I lowered to 0.01
0.01 what? seconds? peanuts? why  0.003334, 0.00122, or 0.01 ? how do you get there ? that's also part of my question.  ;D

Sorry dude but I'm trying to understand what the settings mean, how to determine and pick them, and I still don't get what's going on...  :dunno

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9399
  • Last login:Today at 08:58:46 am
  • Designated spam hunter
Re: Portaudio settings ?
« Reply #9 on: January 02, 2019, 03:31:30 pm »
Also, BigBlueFrontend’s channel is really informative and pointed me in the right direction many times. Does he post on this forum?
He has posted here (and tried to post) many times under many usernames such as bigbluefrontend, bulbousbeard, sudopinion, Gamuhar, and his original username Driverman.   :badmood:


Scott

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7414
  • Last login:April 10, 2024, 02:02:31 pm
  • Quote me with care
Re: Portaudio settings ?
« Reply #10 on: January 02, 2019, 03:40:39 pm »
Also, BigBlueFrontend’s channel is really informative and pointed me in the right direction many times. Does he post on this forum?
He has posted here (and tried to post) many times under many usernames such as bigbluefrontend, bulbousbeard, sudopinion, Gamuhar, and his original username Driverman.   :badmood:


Scott

I'd swear he's not the legendary Driverman/Torino.

He is bulbousbeard.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #11 on: January 02, 2019, 04:10:54 pm »
Ok using the settings haynor posted and completed with the device which apparently I got right, I obtain the following;

which I guess works (placebo or not I've immediately sensed difference)

Code: [Select]
PortAudio: API MME has 3 devices
PortAudio: MME: "Mappeur de sons Microsoft - Output"
PortAudio: MME: "Haut-parleurs (Realtek High Def" (default)
PortAudio: MME: "Audio numérique (HDMI) (2- Péri"
PortAudio: API Windows DirectSound has 3 devices
PortAudio: Windows DirectSound: "Périphérique audio principal" (default)
PortAudio: Windows DirectSound: "Haut-parleurs (Realtek High Definition Audio)"
PortAudio: Windows DirectSound: "Audio numérique (HDMI) (2- Périphérique High Definition Audio)"
PortAudio: API Windows WASAPI has 2 devices
PortAudio: Windows WASAPI: "Haut-parleurs (Realtek High Definition Audio)" (default)
PortAudio: Windows WASAPI: "Audio numérique (HDMI) (2- Périphérique High Definition Audio)"
PortAudio: API Windows WDM-KS has 8 devices
PortAudio: Windows WDM-KS: "Output (Sortie HD Audio HDMI)"
PortAudio: Windows WDM-KS: "Line in at front panel (Green) (Line in at front panel (Green))"
PortAudio: Windows WDM-KS: "Line in at front panel (Pink) (Line in at front panel (Pink))"
PortAudio: Windows WDM-KS: "Line in at rear panel (Blue) (Line in at rear panel (Blue))"
PortAudio: Windows WDM-KS: "Line in at rear panel (Green) (Line in at rear panel (Green))"
PortAudio: Windows WDM-KS: "Speakers (Realtek HD Audio output)" (default)
PortAudio: Windows WDM-KS: "Mic in at rear panel (Pink) (Mic in at rear panel (Pink))"
PortAudio: Windows WDM-KS: "Mixage stéréo (Realtek HD Audio Stereo input)"
PortAudio: Using device "Speakers (Realtek HD Audio output)" on API "Windows WDM-KS"
PortAudio: Sample rate is 48000 Hz, device output latency is 4.33 ms
PortAudio: Allowed additional buffering latency is 10.00 ms/480 frames

So I think I get how to determine and set the API and device, the delay value though is still a mystery.

Which APIs to privilege in general ? and avoid ?

PS: also what does it mean by "allowed additional buffering latency" ?

philexile

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 86
  • Last login:October 30, 2022, 03:45:01 pm
  • I want to build my a GroovyMame PC!
Re: Portaudio settings ?
« Reply #12 on: January 02, 2019, 06:09:22 pm »
According to BigBlueFrontend's video, Windows WDM-KS is the best to go with. That's what I used. I'm not sure of the differences. I Googled MME last night and it appears to be a depreciated API. I'm no expert though – maybe Calamity can elaborate.

Quote
He has posted here (and tried to post) many times under many usernames such as bigbluefrontend, bulbousbeard, sudopinion, Gamuhar, and his original username Driverman.   :badmood:

He is bulbousbeard.

Well that sounds ominous.

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Last login:April 09, 2024, 03:45:52 am
  • retro maniac
Re: Portaudio settings ?
« Reply #13 on: January 03, 2019, 04:34:54 am »
I've simply found this tutorial on internet because eiusdemmodi is still down. Since it is probably from author of frontend I assumed he knows what he is saying.

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Portaudio settings ?
« Reply #14 on: January 03, 2019, 12:06:55 pm »
Sorry dude but I'm trying to understand what the settings mean, how to determine and pick them, and I still don't get what's going on...  :dunno

It's a bit trial and error - the best settings depend on what OS, what sound card driver you have and what system spec. Much like frame_delay but for sound.

IIRC the allowed additional is the normal mame audio_latency, and that weird 0.0033 number is the lowest possible allowed value for the WASAPI driver.

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #15 on: January 04, 2019, 05:38:16 am »
It's a bit trial and error - the best settings depend on what OS, what sound card driver you have and what system spec. Much like frame_delay but for sound.

IIRC the allowed additional is the normal mame audio_latency, and that weird 0.0033 number is the lowest possible allowed value for the WASAPI driver.

Thanks cools, though I think I'll get all the possible answers one could think of except the one I'm looking for.  :lol
What I'm trying to understand is what is that value, its nature, how do you get it, where, how does it corrrespond to a certain miliseconds time as reposted in the log.
What is the formula for converting that turns this 0.003334 into this;
Code: [Select]
PortAudio: Sample rate is 48000 Hz, device output latency is 4.33 ms
PortAudio: Allowed additional buffering latency is 10.00 ms/480 frames
(also the "normal mame audio_latency" do you mean this works as a ceiling or something ? what's the relationship between these two settings ?)

Could it be that evryone just copied stuff at random from the first guys who did something knowingly, and then entered different random figures by themselves for testing without understanding ?
I doubt so because if one can trial and error that feature he has to understand how to control this essential point.

What I don't doubt is since Portaudio has been around, extremely few people use it, prefered build notwithstanding, or as I've seen multiple times they just set useless incomplete settings like I was doing.
The reason ? the usual: there's nothing sufficiently explanatory and comprehensive written on it that would make the average Joe user adopt the feature, there's only a number of posts here and there on the internet, BYOAC has the most afaik and it's only people exchanging like they already got the mechanics and it's natural to set x or y values, though without explaining the bottom of it.

I'm going to leave it as this for now, maybe intealls is the only person who can actually explain it all.


EDIT: someone is writing tutorials that include GroovyMAME features it seems, and here he also wrote something about Portaudio.
https://www.arcade-tutorials.de/tutorials/update-groovymame-mit-portaudio-implementierung
But it's in German...
« Last Edit: January 04, 2019, 06:01:45 am by schmerzkaufen »

pubjoe

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 59
  • Last login:April 03, 2024, 03:53:04 pm
Re: Portaudio settings ?
« Reply #16 on: January 04, 2019, 11:15:10 am »
Is it not just 1 = one second and 0.001 = one millisecond?
« Last Edit: January 04, 2019, 11:18:23 am by pubjoe »

alex2005

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 20, 2023, 09:21:14 am
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #17 on: January 04, 2019, 03:03:27 pm »
if you have an integrated Realtek soundcard card you may use "windows directsound" instead. This is the only setting that worked for me.
Try Cadillacs and Dinousaurs and see if you get sound.

philexile

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 86
  • Last login:October 30, 2022, 03:45:01 pm
  • I want to build my a GroovyMame PC!
Re: Portaudio settings ?
« Reply #18 on: January 04, 2019, 11:39:13 pm »
But it's in German...

Google translate for the win:

"In my GroovyMAME system with Realtek Soundchip I get at API Windows WDM-KS with pa_latency 0.001 2ms output latency. With Windows WASAPI and pa_latency 0.003334 3.3ms output latency. For me Windows WDM-KS runs much better on this system."

I think that answers the question, right? Portaudio is a good thing. :)

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Portaudio settings ?
« Reply #19 on: January 05, 2019, 04:48:27 am »
WDM = Windows 98 audio system
WASAPI = Windows 7+ audio system

From memory those numbers are the lowest you can use, anything lower stops audio working.

Best bet to understand might be to study portaudio documentation rather than MAME. Good luck!
https://app.assembla.com/wiki/show/portaudio/BufferingLatencyAndTimingImplementationGuidelines

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #20 on: January 05, 2019, 06:15:25 am »
I think that answers the question, right?

Actually no it leaves my question unanswered.  :P  (log doesn't return 3.3ms latency when I set 0.003334, that confused me like 'wtf does it do actually')

I wasn't certain what the pa_latency values meant because the results in a log/-v don't match (also how come people find and use values as precise as 0.003334)
Portaudio arrived in MAME without even a basic introduction of how it works/what's its principle, how to use the options in details using log's material, nor written guidelines to adjust the latency.

Looking at the old thread if you compile intealls sentences scattered throught, it becomes a sort of miniguide (that's why I hate forums as a primary documentation resource in place of proper writeups/wikis etc), still yet rather laconic.

Best bet to understand might be to study portaudio documentation rather than MAME. Good luck!
https://app.assembla.com/wiki/show/portaudio/BufferingLatencyAndTimingImplementationGuidelines

Now THIS is interesting, I had absolutely no idea Portaudio was that kind of program, which is why I couldn't make any sense of the discrepancy in settings and results.
For me it was something like using d3d9ex to get rid of unnecessary extra buffer frames, rather it looks something like frame_delay or run-ahead but for sound.

(thanks cools, I've searched for a page like that, guess I've missed it from the portaudio website)

Portaudio is a good thing. :)

Sure it is, not questioning that. The improvement is audible (and quite at that, you only realize how audio lag sucks after trying Portaudio with working settings)
« Last Edit: January 05, 2019, 06:21:29 am by schmerzkaufen »

querschnitt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:October 03, 2019, 05:55:38 am
Re: Portaudio settings ?
« Reply #21 on: October 03, 2019, 05:55:51 am »
hey guys,.. I am having problems with port audio

these are my settings:

Code: [Select]
#
# OSD SOUND OPTIONS
#
sound                     portaudio
audio_latency             1.0

#
# PORTAUDIO OPTIONS
#
pa_api                    "Windows WDM-KS"
pa_device                 default
pa_latency                0.003334

i also tried wasapi and I tried specifying my audio device.

my problem is: I don't have audio during attract mode/during the intros of games. I only have audio when I insert coins and press start.

what can I do to fix this?

donluca

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 262
  • Last login:Today at 12:03:36 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #22 on: October 03, 2019, 11:43:41 am »
That's normal. With standard config arcade games don't have sound during attract mode.

You can change that in each game configuration by entering its service mode (F2 key IIRC).
On a scale of fakeness, from more genuine to more fake, we'd have:

1.- Plastic plants (cf. Fake Plastic Trees)
2.- Inflatable dolls
3.- Arcade cabinets with LCD monitors

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Portaudio settings ?
« Reply #23 on: April 23, 2020, 11:00:22 am »
Quick followup. On my old Optiplex 755 using Windows 7 x64 the lowest I can go. Any lower breaks portaudio. Not seeing any sound related weirdness.

Code: [Select]
audio_latency             0.001
pa_api                    "Windows WASAPI"
pa_latency                0.0001

Quote
PortAudio: Sample rate is 48000 Hz, device output latency is 3.33 ms
PortAudio: Allowed additional buffering latency is 0.10 ms/5 frames

Code: [Select]
audio_latency             0.001
pa_api                    "Windows WDM-KS"
pa_latency                0.0001

Quote
PortAudio: Sample rate is 48000 Hz, device output latency is 1.08 ms
PortAudio: Allowed additional buffering latency is 0.10 ms/5 frames

donluca

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 262
  • Last login:Today at 12:03:36 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #24 on: April 23, 2020, 03:13:32 pm »
Awesome results!
On a scale of fakeness, from more genuine to more fake, we'd have:

1.- Plastic plants (cf. Fake Plastic Trees)
2.- Inflatable dolls
3.- Arcade cabinets with LCD monitors

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:March 11, 2024, 02:59:06 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Portaudio settings ?
« Reply #25 on: April 24, 2020, 07:36:38 am »
Games with discrete audio seem to be crackly using WDM-KS so I've stuck with WASAPI

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Today at 01:11:09 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #26 on: April 25, 2020, 12:02:42 pm »
Wow, 16 months late to respond, that's what work does to you.

Anyway, no, there is no easy-to-follow guide, since it's system dependant. PC based audio systems (and probably many other audio systems) seem to work in a double buffered manner. That is you have two buffers, one that is being played (samples are read from this and output), and one that samples is fed into by the application. When the play buffer is exhausted it will start to read from the other one that has hopefully have been fed appropriately. The size of this buffer dictates the minimum achievable latency (like 3.33 ms). The -pa_latency parameter tries to set up the buffer according to the value provided.

If you want to delve more into details study the nice document cools provided.

When you consider the setup described above, you also realize that there is a driver/chip dependency, for ASIO the variation was extreme, but with WASAPI/WDM-KS there seems to be decent support for 3.33ms, which is also why this figure was recommended since it seems to work with most setups. There might be some Microsoft requirement (or recommendation) somewhere that enables this nice behavior.

Some driver and chip combinations play better with WASAPI, some with WDM-KS, some drivers support very low latencies, some don't. That's why it will always be a bit of trial and error, and making a fool-proof guide to follow is not really possible. And this only considering Windows, not Linux...

The reason you might get higher latencies than what you specify in the configuration are for the reasons above.

Also, regarding the lack of proper documentation, if anyone wants to do it, please do. It's an open source, community driven project, after all.

schmerzkaufen

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 791
  • Last login:October 03, 2023, 02:27:31 pm
  • Multiple Electronic Machine Emulator
Re: Portaudio settings ?
« Reply #27 on: April 26, 2020, 07:49:53 am »
BTW Recap wrote a chapter in his updated Groovy quick guide: http://geedorah.com/eiusdemmodi/forum/viewtopic.php?pid=1547#p1547

Includes the 0 extreme low latency setting introduced not-too-long ago, I think.

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Today at 01:11:09 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #28 on: April 26, 2020, 09:12:19 am »
BTW Recap wrote a chapter in his updated Groovy quick guide: http://geedorah.com/eiusdemmodi/forum/viewtopic.php?pid=1547#p1547

That looks like a very sensible approach, to first try WDM-KS with the minimum latency supported. If that doesn't work nicely WASAPI with a slightly higher latency could be tested. Also good information about the exclusive access and device selection. In general this is probably the best way to go about getting a good Windows configuration.

Includes the 0 extreme low latency setting introduced not-too-long ago, I think.

Pretty cool addition, it should eliminate those last 10-12 milliseconds of buffering latency, provided the system can handle it.

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 10:39:26 am
Re: Portaudio settings ?
« Reply #29 on: April 27, 2020, 03:42:56 pm »
just did some tests and cant get wdm-ks or wasapi to outut without crackling sounds with the settings listed above (checked in dk). updated my realtek drivers to 2.82(latest). Before that I wouldn't even get sound output through wasapi.

I experimented with some settings and this works for me (thought this might be helpful if everyone posts what works for them):

Code: [Select]
# OSD SOUND OPTIONS
#
sound                     portaudio
audio_latency             0

#
# PORTAUDIO OPTIONS
#
pa_device "Speakers / Headphones (Realtek High Definition Audio)"
pa_api                 "Windows WASAPI"
pa_latency               0.01
« Last Edit: April 27, 2020, 05:04:02 pm by mrchrister »

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Today at 01:11:09 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #30 on: April 28, 2020, 06:03:56 pm »
just did some tests and cant get wdm-ks or wasapi to outut without crackling sounds with the settings listed above (checked in dk). updated my realtek drivers to 2.82(latest). Before that I wouldn't even get sound output through wasapi.

Thanks for proving my point. :)

But even with -pa_latency 0.01 (10 ms) and audio_latency 0 you should get pretty nice results and a clear improvement over DirectSound.

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: Portaudio settings ?
« Reply #31 on: April 29, 2020, 12:08:10 pm »
How does one configure portaudio on linux please. The latest version I've compiled is .200 (mame and groovymame).
I can't find any info on it.

EDIT: never mind - figured it out
« Last Edit: May 01, 2020, 03:36:56 am by ZoOl007 »

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 10:39:26 am
Re: Portaudio settings ?
« Reply #32 on: April 29, 2020, 01:56:08 pm »
just did some tests and cant get wdm-ks or wasapi to outut without crackling sounds with the settings listed above (checked in dk). updated my realtek drivers to 2.82(latest). Before that I wouldn't even get sound output through wasapi.

Thanks for proving my point. :)

But even with -pa_latency 0.01 (10 ms) and audio_latency 0 you should get pretty nice results and a clear improvement over DirectSound.

Thanks, I was able to lower it to 0.005 and it still sounds pretty good, no obvious crackling noises. WDM-KS on the other hand doesn't produce proper sound even at 0.01. So for my system WASAPI is a clear winner :)

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 10:39:26 am
Re: Portaudio settings ?
« Reply #33 on: July 26, 2020, 12:34:43 am »
Sorry to resurrect this. I have been pretty OCD about sound crackles and currently, playing dkonghrd rom I have crackles all the way up to 0.016 in both wdm-ks and wasapi.
0.016 should give me 1 frame delay, correct?

Easy test is launch the dkonghrd rom, coin up, start the game, usually music plays fine even at 0.05, leave Jumpman where he is so he dies from the falling barrel. Second time music starts I hear crackle sound. Now on wdm-ks at 0.016 it sounds fine.
Could anyone compare that to their results? Just curious if my realtek soundcard just really sucks...
« Last Edit: July 26, 2020, 12:37:21 am by mrchrister »

intealls

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:Today at 01:11:09 pm
  • I want to build my own arcade controls!
Re: Portaudio settings ?
« Reply #34 on: July 26, 2020, 07:54:55 am »
Depending on what you set -audio_latency to, latency will increase. So if you set it to 1, you allow (up to) 10 ms of additional buffering latency to avoid crackles. If you set it to 0, I don't see any way crackles can be avoided. So with -audio_latency 1 and -pa_latency 0.016 you will get about 16 ms + 10 ms latency. You could also try setting -priority 1 and -nosleep, also try to exit other applications so that only MAME is running. Note that this will increase power consumption.

You could also try updating the Realtek driver and see if that improves things. I've never had the need to use a latency as high as 16 ms with integrated chips.

Edit: Saw you already updated your driver. Maybe you could try a motherboard vendor provided one if one is available.

Edit again: Try setting -pa_latency to 0.005 and -audio_latency to 1 and see if things improve. That should equal about one frame.
« Last Edit: July 26, 2020, 08:10:22 am by intealls »

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 10:39:26 am
Re: Portaudio settings ?
« Reply #35 on: July 26, 2020, 03:20:49 pm »
Thanks for the detailed answer. I wasn't sure what audio latency actually does, so that's helpful to know.
I currently have it set to 0 but will try what you suggested. I think ultimately I'll be ok with one frame of delay, shouldn't effect my gameplay too much (trying to get good at punch out though)

Just wondering if people who report these really low latency numbers are actually not getting any crackles or just don't notice them as much. 0.05 wasapi with audio latency at 0 sounds pretty good on my setup but once you fire up a game using analogue circuitry like all Nintendo arcade games, I definitely get slight chops every now and then. They're not super noticable but I have the luxury to compare it side by side to the real Donkey Kong pcb and it's enough to annoy me during gameplay
« Last Edit: July 26, 2020, 03:24:12 pm by mrchrister »

Jimbo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1014
  • Last login:March 06, 2024, 08:12:05 am
  • I have no idea what I'm doing.
    • Wood Finishes Direct
Re: Portaudio settings ?
« Reply #36 on: July 26, 2020, 03:39:53 pm »
How does one configure portaudio on linux please. The latest version I've compiled is .200 (mame and groovymame).
I can't find any info on it.

EDIT: never mind - figured it out

Is this pre-configured in GroovyArcade (Substring's release)?

If not - any clues on how to configure for that?

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:Yesterday at 12:52:09 pm
  • Forking GroovyArcade
    • forum.arcadecontrols.com/index.php/topic,160023.0.html
    • GroovyArcade active fork
Re: Portaudio settings ?
« Reply #37 on: July 27, 2020, 03:15:31 am »
Audio is set to SDL in GA. I was asked to set it to port audio, which I will do. But as settings depend on the rig, I may leave default values