PICO 8 audio speed

Post Reply
WoWin
Posts: 27
Joined: Mon Jun 26, 2017 12:11 pm
Has thanked: 18 times
Been thanked: 2 times

PICO 8 audio speed

Post by WoWin » Sun Mar 04, 2018 9:10 pm

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?

User avatar
kite
Posts: 972
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 246 times
Been thanked: 361 times
Contact:

Re: PICO 8 audio speed

Post by kite » Mon Mar 05, 2018 2:25 am

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
Stock clearance - CLOSED: viewtopic.php?f=38&t=12064
Kite's Mailing List: https://goo.gl/forms/e97uUvPOfUxPWdz82
Kite's FAQ: https://kiteretro.com/faq/


ImageImageImageImageImage

WoWin
Posts: 27
Joined: Mon Jun 26, 2017 12:11 pm
Has thanked: 18 times
Been thanked: 2 times

Re: PICO 8 audio speed

Post by WoWin » Mon Mar 05, 2018 9:25 pm

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.

User avatar
kite
Posts: 972
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 246 times
Been thanked: 361 times
Contact:

Re: PICO 8 audio speed

Post by kite » Tue Mar 06, 2018 12:04 am

Awesome nice work! I'll have to buy it and try myself and see what effects there are on everything else (just in case)
Stock clearance - CLOSED: viewtopic.php?f=38&t=12064
Kite's Mailing List: https://goo.gl/forms/e97uUvPOfUxPWdz82
Kite's FAQ: https://kiteretro.com/faq/


ImageImageImageImageImage

WoWin
Posts: 27
Joined: Mon Jun 26, 2017 12:11 pm
Has thanked: 18 times
Been thanked: 2 times

Re: PICO 8 audio speed

Post by WoWin » Tue Mar 06, 2018 1:20 pm

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.

User avatar
kite
Posts: 972
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 246 times
Been thanked: 361 times
Contact:

Re: PICO 8 audio speed

Post by kite » Wed Mar 07, 2018 12:22 am

Fantastic, i've put links in for now :)
Stock clearance - CLOSED: viewtopic.php?f=38&t=12064
Kite's Mailing List: https://goo.gl/forms/e97uUvPOfUxPWdz82
Kite's FAQ: https://kiteretro.com/faq/


ImageImageImageImageImage

WoWin
Posts: 27
Joined: Mon Jun 26, 2017 12:11 pm
Has thanked: 18 times
Been thanked: 2 times

Re: PICO 8 audio speed

Post by WoWin » Sun Dec 16, 2018 1:39 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest