Page 1 of 1

PICO 8 audio speed

Posted: Sun Mar 04, 2018 9:10 pm
by WoWin
Anyone else noticed that audio is much too fast using the pico8 fantasy console on the CSO. It seems to be related to usb audio.

Is there a way to fix this? I guess it is more of a pico8 bug, but maybe there is a workaround?

Re: PICO 8 audio speed

Posted: Mon Mar 05, 2018 2:25 am
by kite
I haven't looked at this yet, I haven't bought/used PICO8 but it's on my list :) if anyone does work it out they can add the steps to the wiki: https://github.com/kiteretro/Circuit-Sw ... for-PICO-8

Re: PICO 8 audio speed

Posted: Mon Mar 05, 2018 9:25 pm
by WoWin
After hours of tinkering I got it to work. Aparently pico8 tries to play in a lower sampling rate (16k?) which is not supported by the USB sound card (only 44100 and 48k). Fortunately, alsa allows software conversion of sampling rate. I change my default audo device to one which does conversion in /etc/asound.conf:

Code: Select all

pcm.card {
  type hw card 1
}
pcm.!default {
          type plug;
          slave {
                pcm card;
                rate 48000;
          }
 }
ctl.!default {
  type hw card 1
  }
  
Warning: While it fixes audio for pico8 I didn't thoroughly test if this has other adverse effects. Since it is a software conversion it might also impact performance. If anyone knows how to achieve the same in a less hackish way I would more than happy to hear about it (e.g. changing the audio device on the fly only for pico 8 would be cool, using no software conversion for the other stuff).

For adding pico8 to emulationstation I followed this guide:https://www.lexaloffle.com/bbs/?tid=3935

I use the following script to start it (stretches to the full screen, but is a bit blurry): ~/pico-8/+StartPICO-8.sh

Code: Select all

#!/bin/bash
pushd "/home/pi/pico-8"
./pico8 -width 256 -height 256  -pixel_perfect 0 -splore
popd
I hope others find this information helpful. Kite, please feel free to add the information to the wiki.

Re: PICO 8 audio speed

Posted: Tue Mar 06, 2018 12:04 am
by kite
Awesome nice work! I'll have to buy it and try myself and see what effects there are on everything else (just in case)

Re: PICO 8 audio speed

Posted: Tue Mar 06, 2018 1:20 pm
by WoWin
BTW, I just wanted to put this excellent guide here for adding PICO 8 to emulationstation: https://www.lexaloffle.com/bbs/?tid=3935

It now also covers my audio fix.

Re: PICO 8 audio speed

Posted: Wed Mar 07, 2018 12:22 am
by kite
Fantastic, i've put links in for now :)

Re: PICO 8 audio speed

Posted: Sun Dec 16, 2018 1:39 pm
by WoWin
Did something change with the way sound is done with raspbian stretch (or the latest circuit-sword image)? For some reason the fix above doesn't work anymore and breaks sound everywhere.