Jump to content



Photo
- - - - -

xpinmame the Journey with Hybrid Pinball machine (Ubuntu & Pi)


  • Please log in to reply
38 replies to this topic

#1 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 01:29 PM

I have been following/lurking the progress of others trialing pinmame with a real hardware machine.

 

I thought I would share my journey so far.

 

This has been an educational process for me to understand pinmame and how it can control a real pinball machine.

For those who also follow pinside.com you can see the work that I did creating a hybrid pinball machine using an arduino and raspberry pi.

 

What have I done so far...

 

1) Downloaded pinmame source code to Ubuntu 16.04 & 18.04 machines. (Raspberry Pi 3 targeted next)

2) Noted what changes required to makefile.unix for optimum Ubuntu or Raspberry pi needs and video output needs to a DMD

3) Applied a few changes to enable compiles to work (for more details you can see the unix_todo.txt file for thoese changes)

      Some change need to be added to capgames.c for fastflippers that were absent from that text file

      Some differences for _stricmp that cause linux link to fail may also be absent from that text file.

4) Launch xpinmame.x11 and test options and perform simple keyboard simulations to demo switches, lamps, solenoids, score displays

 

Whats next

Enable DmDdump, sound wave capture testing

Interface to my arduino/teensy for simple lamp/solenoid/Dmd control

 

I will make a few youtube video and my progress moves along further.

Also I will document some of the help tidbits I found along the way.


Edited by legtod2, 04 May 2019 - 02:30 PM.


#2 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 01:54 PM

Let me begin by sharing some compile and build stuff...

 

The build was done on my Ubuntu 18.04 Virtual machine.

Simple edits were done to makefile.unix to allow my binary to do what I wanted.

 

Since my linux distro is Ubuntu I verified these setting enabled..

TARGET = pinmame

LIBS     = -L/usr/lib/X11 -L/usr/lib
INCLUDES = -I/usr/include/X11 -I/usr/include

ARCH  = linux

DISPLAY_METHOD = x11

X11INC        = -I/usr/include/X11
X11LIB        = -L/usr/lib/X11

 

Also since I am using X11 for my output testing I made sure I have the X11 debian packages.

 

Here is the list of the package I made sure were present for a successful compile (There are some sound packages that I neglected to note what they were)

  zlib1g-dev
  libx11-dev
  libxext-dev
  libxv-dev
  x11proto-video-dev

  libsdl2-dev

 libsdl1.2-dev

 

The compile failed at a couple of places one was due to capgames.c for fast flippers and preprocessor pasting operation.

The fix involved changing references to INITGAMEFF to (all references)

INITGAME(pmv112, 1, cc_dispDMD128x32, 3, SNDBRD_CAPCOMS, 8)

 

Another spot was _stricmp is undefined in linux, during the link process switching references to strcasecmp() did the job.

 

To launch the compile ...

make -f makefile.unix

 

To clean up after failed compile

make clean -f makefile.unix

 

The completed object file was xpinmame.x11

 

I manually copied files into my final destination /usr/local/share/xpinmame

and chmod execute permissions.


Edited by legtod2, 10 May 2019 - 08:50 PM.


#3 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 02:12 PM

Lets talk about some command line switching... This is linux and I like command line ;)

 

I copied xpinmame.x11 to /usr/local/share/xpinmame and I copied my rom files to /usr/local/share/xpinmame/roms

 

First switch to the xpinmame.x11 directory (Where ever you installed the binary to.

 

Launch pinmame help (This provides our command line switches)

$ ./xpinmame.x11 -help

 

Lets launch elvis. This gives us the full dmd with the lamps and switches displayed in the window

$ ./xpinmame.x11 elvis

 

The elvis DMD window appears just like a mame environment.

Press the TAB key. A sub menu appears, choose input (this game) to see what the keyboard keys do

All of the short cut keys that are enabled are here for simulation purposes.

Press esc key to back out

Press the 5 key (see what happens)

Press the 1 key (see what happens)

Press the esc key

 

See xmame for other keyboard shortcut information

 

Other keyboard shortcut keys...

     KEY                        Action
     <1> (the number `one')     Start a 1-player game.
     <2> (the number `two')     Start a 2-player game.
     <3> (the number `three')   Start a 3-player game.
     <4> (the number `four')    Start a 4-player game.
     <5> (the number `five')    Insert coin (slot 1).
     <6> (the number `six')     Insert coin (slot 2).
     <7> (the number `seven')   Insert coin (slot 3).
     <8> (the number `eight')   Insert coin (slot 4).
     <Tab>                      Toggles the configuration menu.
     <~> (Tilde)                Toggles the `On Screen Display'.
                                Use the up and down arrow keys to select
                                the parameter (global volume, mixing level,
                                gamma correction etc.), left and right to
                                modify.
     <P>                        Pauses the game.
     <Shift+P>                  While paused, walk to the next frame.
     <F3>                       Resets the game (start with
                                `hardware self-test').
     <F4>                       Shows the game graphics. Use cursor keys
                                to change set/color, F4 or Esc to return to
                                the emulation.
     <F9>                       Changes frame skip on the fly.
     <F10>                      Toggles speed throttling.
     <F11>                      Toggles speed display.
     <Shift+F11>                Toggles profiler display.
     <F12>                      Saves a screen snapshot. The default
                                target directory is SNAP. You must create
                                this directory yourself; the program will
                                not create it if it doesn't exist.
     <ESC>                      Exits the emulator.
     <L-CTRL>                   is mostly used as a button.
     <L-ALT>)                   is also mostly used as a button.

Edited by legtod2, 04 May 2019 - 02:16 PM.


#4 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 02:27 PM

If you are not a fan of remembering multiple command line parameters you can save your own config settings like remove the nagging type OK to continue

 

$ ./xpinmame.x11 -sc

 

Review what the setting are then

 

$ ./xpinmame.x11 -sc > ~/.xpinmame/xpinmame-x11rc

 

Now lets edit the config file and turn off the nagging OK prompt Set the value below

$ vi ~/.xpinmame/xpinmame-x11rc

 

skip_disclaimer         1
skip_gameinfo          1

defaultgame             elvis

### Sound Related ###
sound                   1

 

Launch xpinmame.xll, This time no nagging OK prompt, Gamerom info, and imediatly launches elvis rom

$ ./xpinmame.xll # Notice I did not provide the cmd line for game rom.

 

The lesson here is make edits to ~/.xpinmame/xpinmame-x11rc to modify default parameters instead of having to launch using multiple parameters


Edited by legtod2, 09 May 2019 - 11:35 PM.


#5 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 03:07 PM

I made a couple of edits to my ~/.xpinmame/xpinmame-x11rc so that my snap shot directory was were I wanted it to be.

 

$ ./xpinmame.x11

 

Press the F12 key to capture png files of your dmd

Press esc key

 

$ ls ~/.xpinmame/snap # Now you see your snapshots in png format



#6 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 05:05 PM

Lets Simulate a game using the Close Encounters Rom and keyboard to simulate a game in action:

 

The display area shows

1) Score/DMD display

2) Lamps states on/off

3) Switch states on/off

4) Others

 

$./xpinmame.x11 closeenc # closeenc.zip is the Close Encounter rom file

Press the Left flipper key (Left Shift key). Notice the switch state display blink on an off showing the flipper pressed

Press the Right flipper key (Right Shift key). Notice the switch state display blink on an off showing the flipper pressed

 

If your table used a switch matrix you need to press two keys to simulate a switch matrix key event.

To see the switch matrix keys Press the TAB key and arrow down in menu to Input (this game).

You see Column 1 - Column8 (Keys = [Q,W,E,R,T,Y,U,I])and Row 1 - Row 8 (keys = [A,S,D,F,G,H,J,K]).

By pressing the two corresponding keys it triggers the corresponding switch matix event.

You will need to have the appropriate switch matrix of the pinball machine in question to map the switch matrix to switch event.

They and be found in several locations across the internet (for example ipdb.org).

 

For Close Encounters machine it uses a 5 x 8 matrix

#https://www.pinitech...h_database.php? # Use me to find your switch matrix

https://www.pinitech...lose_Encounters

 

Press the 5 Key (Notice credits counter increases)

Press the 1 Key (This reduces credits sets score to zero and starts game)

Press E key and S key (Notice 5000 points appears- You just triggers the A Roll over switch)

Press R key and S key (Notice another 5000 points added - You triggered the B Roll over switch)

Press Q key and A key (Spinner target)

Press W key and A key (Credits increased)


Edited by legtod2, 04 May 2019 - 05:46 PM.


#7 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 05:32 PM

Ok now you have a background on how the virtual pinball takes input events to emulate switch input events.

Basically in the above example we emulated the events from key stroke and xpinmame.x11 interpretted them to pinball events and it provided an output by showing a display output.

 

I added a credit and the credit display increased, I pressed the start buttton and the machine state initialized, etc.

 

Next we want to have real switched accept input and translate it into our emulator, and of course we want output events such as fire solenoids.

 

Today, virtual pinball utilizes DOF to act as a layer to trigger many external events like firing compacters, trigger extra led lamps.

 

That's not what I will be doing.

 

This is were an integration of Raspberry Pi, Arduino/Teensy enters into the picture.

A hardware abstraction layer will allow us to detect Switch Matrix event that can then be used to trigger our output events like score, lights, play mp3/wav, and fire solenoids.

This abstract layer allows for cool customizations to the original game play.

 

For example, we may want to used multiple output display panels (DMD, 4x20 LED, etc)

 

Imagine adding DMD or LED display to your existing 6 digit 1980 machine.


Edited by legtod2, 04 May 2019 - 05:34 PM.


#8 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 08:05 PM

One piece that I see absent is the DMD frame capture.

According to the documentation Pressing F6 captures frames to the Dmddump directory that exists in the VPinmame directory.

 

I am not seeing this at the moment from my xpinmame compile. According to the documentation, I need to enable external dmd & show window.

When I run xpinmame.x11 -help and xpinmame.x11 -sc I see no reference to it.

 

Has this functionality been removed ?



#9 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 04 May 2019 - 10:23 PM

Checking core.c I can see the functionality is still there... digging deeper now.



#10 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 05 May 2019 - 10:21 AM

Alas, now I understand the F6 DMD to text frame capture.

This functionality was built using vpinmame.dll.

 

core.c on a windows machine will enable the menu functionality on a windows box but not linux.

So on my Ubuntu or raspberry pi box, if I press the tab key and F6 to start DMD text capture it will not work (Pity).

 

Now if I want to capture text frames for later conversion to gif frames I need some form of DMDexternal binary or write my own.

The other option is to do this from my windows Virtual Pinball Cabinet machine.

 

Just for references sake here is what you need to do (From windows pinmame) to capture DMD text frames...

  • From windows explorer navigate to you Vpinmame folder.
  • Create a subfolder Dmddump
  • Click on Setup.exe
  • Click Test Button
  • Choose your game rom to capture (Example Elvis (5.00))
  • Click Game Options Button
  • Make sure Show DMD/Display window & Use External DMD boxes checked
  • Click OK
  • Click Start Button (Your Elvis DMD appears)
  • Place your mouse inside the new frame and click inside to insure focus of widget
  • Press F6 Function key to trigger to copy of dmd frames to text file
  • Press 5 button to simulate Coin added (You here rom music clip to for each coin added).
  • Press 1 button to simulate Start button
  • Press Escape key
  • Click Game Options Button
  • Uncheck Use External DMD box (You want to be able to play this game again later)
  • Click OK
  • Click OK again and exit from Setup
  • From Windows explore Goto VPinmame/Dmddump folder
  • File elvis.txt exists - Contains text frames captured from DMD.

Edited by legtod2, 05 May 2019 - 10:23 AM.


#11 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 05 May 2019 - 11:28 AM

My next puzzle is figuring out playback of sounds from the rom. According to the documentation Pressing F4 enables the sound menu and F5 toggles the recording to the Vpinmame/wave folder.

I don't see this in the linux version. What I am trying to do is replay each individual sound that is contained in the game rom.

Example when I look at the elvis 5.00 rom I see a few sound file references.

Guess I got to do some more digging ...

 

From documentation :

PinMAME has the ability to let you trigger sound commands manually. This will let you play any sound the pinball game can make. Hit the 'F4' key to turn Sound Command Mode on or off. Follow the instructions on screen to generate sounds.   The sound commander work in two modes: Manual mode: you enter the commands directly using the arrows. NOTE: Not all Sound Command #'s generate a sound. e.g. Many games don't have a sound for command #01! Most games require two bytes for each command.   Command mode: Sound commands are read from the "sounds.dat" file and you can scroll thru all available commands with the arrow keys. Look in the sounds.dat for details on hw to use it.   For some games the sound command history is displayed. It can be useful to find out how certain sounds are generated by the hardware.   Recording Sounds to a Wave File ------------------------------- PinMAME can record the sound output to a wave file for you to play back anytime you want. Hit the 'F5' key to begin recording, and hit 'F5' again, to stop recording. The files are created in the 'wave' directory. They begin with the name of the game, plus a #, just like screenshots work.   If you're having trouble, make sure your .cfg file points to a valid directory, and that you have enough free disk space to create the wave.   Note that WAV files can become big quickly. These are not compressed like MP3 files, so you can easily end up with 50MB of WAV files for just a few minutes of recording! Sound Command Mode

#12 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 05 May 2019 - 07:29 PM

I admit that I am lost on replaying sound from xpinmame using keyboard

 

Dependancies:

file sounds.dat exists in the VPinmame source folder

Configuration has sound enabled

Choose a rom that has sound files

 

What testing did I do?

Tested from Linux xpinmame version and Windows cabinet version

 

Steps to recreate on Linux Pinball

  • cd Pinmame folder
  • ls sounds.dat # File found
  • xpinmame.x11 -sc | grep sound # Expect to see sound 1 (if you see sound 0 then sound not enabled)
  • xpinmame.x11 -snd elvis # Force sound enabled and use elvis.zip rom file
  • DMD screen appears
  • Press 5 key # No sound is heard
  • Press 1 key # No sound is heard
  • Press F4 no Sound Command menu

 

Steps to recreate on Windows Pinball Cabinet

  • cd Vpinmame folder
  • check for presence of sounds.dat (Found it)
  • launch setup
  • select Elvis 5.00 from selection list
  • Click Game Options button and verify check box beside Sound
  • Test Button
  • Choose Elvis 5.00
  • Place mouse button in frame so focus is there
  • Press 5 key - (Hear sound from pinmame)
  • Press 1 key - (Hear sound from pinmame)
  • Press F4 key (Expecting Sound Command Mode menu but nothing happens)
  • Where did this go or why is it not working

 

The key issue is the Sound Command Mode is not working



#13 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 09 May 2019 - 11:29 PM

Finally after digging I have discovered why I could not get Sound Command Menu to appear after pressing F4 key.

 

src/wpc/core.c was initializing the value of coreGlobals.soundEn to null.

 

I had set sound enabled on in the config file and confirmed it was set by ./xpinmame.x11 -sc |grep soundinfo: trying to parse: /usr/local/share/xpinmame/xpinmamerc
info: trying to parse: /home/legtod2/.xpinmame/xpinmamerc
info: trying to parse: /usr/local/share/xpinmame/xpinmame-x11rc
info: trying to parse: /home/legtod2/.xpinmame/xpinmame-x11rc
### Digital sound related ###
# sound-mixer-plugin    <NULL> (not set)
sound                   1

 

I add the following line and recompiled then ran the code and voila, F4 key is working.

    /*-- Sound enabled ? */
    coreGlobals.soundEn = TRUE; /* Delete this line after testing */
    if (((Machine->gamedrv->flags & GAME_NO_SOUND) == 0) && Machine->sample_rate)
      coreGlobals.soundEn = TRUE;
 


Next step is to get my universal sound working be it on the raspberry pi or my desktop ubuntu 16.04 or 18.04.

 

Going to research some of the xmame archives to determine what sound drivers I need to use for ubuntu native sound and raspberry pi sound.

 

./xpinmame.x11 -lmp or ./xpinmame.x11 -ldp

 

legtod2@legtod2-Veriton-X4620G:/media/legtod2/5tb/pinmame_linux/pinmame-master$ ./xpinmame.x11 -ldp
Digital sound plugins:

oss                            Open Sound System DSP plugin                    
legtod2@legtod2-Veriton-X4620G:/media/legtod2/5tb/pinmame_linux/pinmame-master$ ./xpinmame.x11 -lmp
Sound mixer plugins:

oss                            Open Sound System mixer plugin



#14 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 10 May 2019 - 07:45 PM

Great report, thanks for sharing your progress!!

 

Do you have the PinMAME source changes that you did somewhere in the form of a patch or on sourceforge/github?



#15 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 10 May 2019 - 08:54 PM

toxie,

 

No patch files, simply just documented all my edits here.

 

Todays adventure has been to review the sound driver for use with Ubuntu.

Seeing that ubuntu like ALSA, I am testing what needs to be done to enable or config ubuntu to use it when replaying rom sounds.



#16 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 10 May 2019 - 09:31 PM

I have been testing from two different ubuntu boxes, the first is ubuntu 16.04 desktop PC and a Virtualbox ubuntu 18.04.

 

Both will be using ALSA as it's sound driver.

 

So now lets review the concept of playing back a simple wave file using ALSA tools as a means to validate the it is working.

 

$alsamixer # Up comes our Volume control interface/mute/microphone/speakers etc

 

Here we should see whats available, whats muted of if there are basic issues with reproducing sounds from alsa.

If the interface doesn't work then some fundamental ubuntu packages are not installed.

Press the escape key to exit from the utility.

 

Lets assume that the alsamixer was find and working, so lets play a wave file

$ aplay 1000pts.wav # Expect to hear sound from pc speakers

 

Did you hear the sound, if so Great we know our alsa sound driver is working.

 

Now that the sound driver is work lets see what we told pinmame to do?

$xpinmame.x11 -sc

What we are interested are the Sound related elements

### Sound Related ###
sound                   1
samples                 1
samplefreq              22050
bufsize                 3.000000
volume                  -3
# audiodevice           <NULL> (not set)
# mixerdevice           <NULL> (not set)

 

We want sound enabled, samples enabled, volume loud is 0 and off is -32.

I want to use the default or master sound device (This is a bit uncertain at the moment for audiodevice and mixerdevice for alsa to work).


Edited by legtod2, 10 May 2019 - 09:32 PM.


#17 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 10 May 2019 - 10:06 PM

Now let review a couple of compile pieces, by checking to see what sound related parameters we set in makefile.unix

Notice I enabled both ALSA and SDL

###########################################################################
# Sound Devices
###########################################################################

# Choose any additonal sound drivers you want to include, besides the
# native sound driver for your system.
# SOUND_ESOUND = 1
SOUND_ALSA = 1
# SOUND_ARTS_TEIRA = 1
# SOUND_ARTS_SMOTEK = 1
SOUND_SDL = 1
# SOUND_WAVEOUT = 1

 

Now lets confirm what sound devices we have

$./xpinmame.x11 -ldp

Digital sound plugins:

oss                            Open Sound System DSP plugin                    
alsa                           Alsa Sound System DSP plugin                    
sdl                            Simple Direct Library DSP plugin

 

./xpinmame.x11 -lmp
Sound mixer plugins:

oss                            Open Sound System mixer plugin

Hmmm, I don't see any ALSA sound mixer stuff

 

OK let try to see if we can get some sound using Creature from the black lagoon rom (lets force it to use alsa)

./xpinmame.x11 -audiodevice alsa cftbl_l4

 

The DMD displays so let press the 5 key to add credits and 1 key for start.

Let press the insert key to simulate tilt.

Alright we now hear sounds albeit really very choppy and quality sucks.

 

Now we know we need to set audiodevice in the config file to alsa


Edited by legtod2, 10 May 2019 - 10:08 PM.


#18 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 11 May 2019 - 01:24 AM

My present status is that I now have sound but it is very choppy.

 

Play sounds sounds great using aplay with no choppness. I am assuming I have a config issue with pinmame to figure out, perhaps samplefreq.

 

I am going to research ubuntu references with xmame for sound choppy for possible solutions.



#19 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 11 May 2019 - 01:21 PM

This morning testing I did the following

 

$cd ~ # Change to my home directory

$/usr/local/share/xpinmame.x11 cftbl_l4 # Launch pinmame using cftbl_l4 rom

Press F4 key Sound Command Menu appears

Press DEL key to toggle Manual sound commands

Press 0 & 1 key to begin playing sound.dat reference to that sound for this rom

Press F5 key to begin recording audio

Press SPACE key to begin playing sound 01

Press 0 & 2 key to queue playing next sound

Press SPACE key to begin playing sound 02

Press F5 key to toggle recording

Press ESC key to exit

Observations during this process is the DMD display and the sound is very choppy.

 

$ls -ltr *.wav # we see our newly recorded cftbl_l4.wav file

This makes me wonder, I was under the impression that recording went to the folder (Pinmame home directory)/wave.

Obviously that is not true or I did not set that in my config. Guess I will go back to that latter.

 

Ok let play back this newly recorded wav file

$ aplay cftbl_l4.wav # Holy crap the sound is perfect and not choppy (Sounds great so what gives?)

 

This makes me wonder what xpinmame.x11 is doing to play the sound vs what aplay is doing to play the sound.

 

Just for reference here is the cftbl_l4 references from sound.dat

cftbl_l4:
:00:Reset Sound System
:01:Music: Main Game Theme 1 (?)
:02:Music: Main Game Theme 2
:03:Music: Main Game Theme 3
:04:Music: Mega Menu
:05:Music: Main Game Theme 4
:06:Music: Multiball
:07:Music: ?? Loop
:08:Music: Snack Attack
:09:Music: Normal Prelaunch
:0a:Music: Video Mode
:0b:Music: Main Game Theme 5
:0c:Music: Main Game Theme 6
:0d:Music: Move Your Car!
:0e:Music: Multiball Hurry-Up
:10:Music: ?? (same as 01)
:11:Music: (01 = messed up)
:12:Music: (02 = messed up)
:13:Music: (03 = messed up)
:14:Music: (04 = messed up)
:15:Music: (05 = messed up)
:16:Music: (06 = messed up)
:17:Music: (08 = messed up)
:18:Music: (1c = messed up)
:19:Music: (1b = messed up)
:1a:Music: Bonus Ending 1
:1e:Decrease Music Tempo
:1f:Increase Music Tempo
:30:SFX: Car driving by
:31:SFX: Kiss - Mwah!
:32:SFX: Projector Startup
:33:(Blues mumbling 1)


Edited by legtod2, 11 May 2019 - 01:26 PM.


#20 legtod2

legtod2

    Enthusiast

  • Silver Supporter
  • 409 posts

  • Flag: Canada

  • Favorite Pinball: Mystic

Posted 12 May 2019 - 01:17 AM

I have experimented for a better part of the day trying to improve on the terrible sound quality.

 

I know the following facts, my sound card is good for 44,000 sample freq and also know that src/unx/sound.c sets the sample freq to 22,050

I also know that my screen is running at 60 fps.

If I need to calculate my sound_per_framerate it would be 22,050/60 = 367

 

By passing the parameter -samplefreq I have attempted to vary the frequency [40000, 22050, 44000]  all have the same effect (sound is still terrible).

The interesting part is when I record the sound and play it back it sound perfect.

 

The one variable that has me scratching my head is the sound_per_framerate.

The second variable is pulseaudio, is this sound service causing me issues (I don't know).

 

I wonder if Destruk can help me with this issue ?


Edited by legtod2, 12 May 2019 - 01:29 AM.