Pi in a Gameboy Advance Build - WIP
-
@obsidianspider was that a 240x320 screen or 320x480? And have you played with the speed and FPS parameters?
-
Thanks to this post I found over at Adafruit my wifi seems more stable, but it's still not perfect.
Create and edit a new file in /etc/modprobe.d/8192cu.conf
sudo nano /etc/modprobe.d/8192cu.conf
and paste the following in
# Disable power saving options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
Then reboot with
sudo reboot
That didn't seem to correct the issue. For whatever reason this Pi will disconnect, and then not reconnect. My other Pis don't have this issue, but per this blog post, I tweaked
/etc/network/interfaces
allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
That seemed to fix the problem, but I'm going to leave the Pi sit for a while to see if it disconnects.
-
@moosepr It's a 3.2" Sainsmart (Waveshare clone) at 320x240. I'm using the instructions I posted above. From what I understand, the screen is running at 60fps, but fbcp can only copy at 25fps due to CPU cycles, or the laws of gravity, or something. It's very playable. Minor tearing, but nothing terrible.
-
@obsidianspider you could probably push the speed up a little, but I don't think you would see any improvement.
You may actually be getting the full 60fps. What does it say if you turn on the frame rate in the emulationstation UI menu?
-
@moosepr it says 60, but that's what's going to fb0, fpcp is copying that to fb1, so that's the limitation.
-
I noticed that when I would go to play a game I was getting this error listed a bunch of times:
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
I'd not encountered this before, but I've also not done a whole lot with a Zero and RetroPie. I'm on 4.1.15 (2498322) so it's a current as it can get.
Some Googling found mentions of the error on other versions of Linux, but nothing that I could apply to Raspbian. Has anyone else encountered this? I'm probably going to start a separate thread for it.
Since things seemed to be working OK otherwise, I decided to plug in my USB soundcard and configure it using the instructions I found over at Sudomod from user chiz.
For those who's considering to go the USB audio route (vs. the PWM method), I've prepared this guide to help anyone who's at a loss on how to configure their Retropie installation for USB audio use. Note you'll need a USB keyboard attached or you can SSH into your system assuming you have configured it already for access within your home network.
Steps:
- Attach the USB audio dongle into one of the USB ports connected the RPi. Reboot the system.
- Once EmulationStation has loaded, exit from it by pressing F4. This will take you to the terminal.
- Check if your USB audio has been detected by Raspbian Jessie by typing the command below:
pi@retropie:~ $ lsusb
Output should be:
Bus 001 Device 007: ID 0d8c:0014 C-Media Electronics, Inc. Bus 001 Device 004: ID 0424:2517 Standard Microsystems Corp. Hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The C-Media Electronics, Inc line shows that the USB audio device is detected.
4. Once we're sure the USB audio device is detected, let's check the order of priority of the sound cards being used by the system. Do so by typing this command:pi@retropie:~ $ cat /proc/asound/modules
Output should be:
0 snd_bcm2835 1 snd_usb_audio
As you can see from the output above, the
snd_bcm2835
is the built-in sound card but we want the system to usesnd_usb_audio
- We can change and force the system to load the sound cards in a different order by creating a sound configuration file. Create the file by using the command below:
pi@retropie:~ $ sudo nano /etc/modprobe.d/alsa-base.conf
You will then enter the Nano editor environment and type the following lines:
options snd_usb_audio index=0 options snd_bcm2835 index=1 options snd slots=snd-usb-audio,snd-bcm2835
Afterwards, press
Ctrl+X
to exit and answerYes
when prompted to save.- Reboot the system, exit EmulationStation once again to go to the terminal.
- If you've successfully completed all the above steps, you should see the output below when you type the command:
CODE: SELECT ALL
pi@retropie:~ $ cat /proc/asound/modules
Output should be:
0 snd_usb_audio 1 snd_bcm2835
Notice that the order has changed and it's now the snd_usb_audio that's on top of the list with an index of 0
- Test the sound by going to EmulationStation and playing a game. You should immediately hear EmulationStation sounds when you go select from the list of games.
Load EmulationStation by typing the following command:
pi@retropie:~ $ emulationstation
-
@obsidianspider I had a zero running on a HDMI monitor earlier and it said 45! You can run some debug messages and get the true driver speed, but it doesn't really matter. Like you say, other than the tearing, the screens are really good
-
I think my intermittent wifi issues are stemming from the iBuffalo controller. As is widely known, it's prone to ghost inputs, which seem to point to power fluctuation issues. Since the Zero is so sensitive to power, I tried booting the Zero without the iBuffalo connected and sure enough, the wifi hasn't noticeably dropped.
Of course, I also can't do anything without the controller connected, so I guess it's time to get back to trying to use the Retrogame software from Adafruit to hook up my "controller" from before, and then move on to connecting up the boards from the GBA and DS Lite.
At least I think I figured out the Wifi issue...
-
I installed Retrogame and connected up the "buttons' and things with Wifi seem better, but i'm going to let the Zero sit with a game running for a while today to see if the wifi disconnects.
I also find it interesting that lr-nestopia has crackly audio with FDS games, but not FC or NES games. Weird.
-
@obsidianspider your not hanging round with this one now!!
-
@moosepr Haha, I woke up early, and got some things sorted before work. I'm basically re-learning what I had to do to get to where I was a few months ago when I was testing with my Pi 2.
I'm kinda bummed by the performance of the Zero for some things (transfer a file while playing a game and it chokes, and Super FX games, fuhgeddaboutit), but a Pi 2/3 won't fit in a GBA along with things like a "battery", so I'm moving forward with the Zero in this build. It works pretty well for most NES, SNES, Genesis, etc. games, and it's fun playing on that TFT.
Next up I'm going to either be working on the buttons, or the audio circuit.
The power circuit is going to require me to get some parts and do some figuring, so that is going to be last, at least that's how I'm seeing things unfold.
-
Friggin wifi dropped again. I did some more reading and added another line to the
/etc/network/interfaces
filewireless-power off
and rebooted
-
Now I'm at a loss. I was just letting the Pi sit there while SSHing in and going through the configuration menu and then the wifi dropped off. It's definitely not reliable at all on the Zero. Even though I'm telling it to reconnect, the only way I can get it to power back on is to unplug and replug it in. :-/ I'm not going to waste a ton of time on it since I won't be using wifi most of the time when the GBA is assembled, but this kind of stinks.
-
@obsidianspider Have you got any other dongles? I had some of the tiny tiny cheep ones running on some pi based cctv cameras. They used to drop out quite often (and i dont think the signal strength is too good with the tiny antenna) using a larger TP Link one improved things no end!! (although watch the chipset ;))
-
@moosepr I don't, and it's the Edimax one that I used on my Pi2 without fail for a LONNNNG time. I think I'm going to live with it "for now" and move on to the buttons after work.
-
@obsidianspider
I wonder if that WiFi dongle isn't getting enough power in your Pi Zero setup. Is this running off a battery or a phone charger cable? Maybe test it with the same charger you use for your Pi2 to see if it works correctly? -
@backstander I'm doing everything with the 2A wall wart that I've been running a Pi 2 and Pi 3 with. I haven't gotten into battery stuff yet.
-
@obsidianspider
Looks like you ruled out power :-)What about the microUSB to USB 2.0 adapter you're using. Is there another one you can test with?
-
@backstander It's actually the female end of the USB-A wire that I used in my Super Famicom project and it's soldered directly to the power test pads on the Zero and the data pads, so it's bypassing the USB power circuit entirely and is getting power directly from the input.
It seems to conk out when under heavy CPU load. For example, I had a SNES game running and then I SSH'd in and went into the configuration menu and wanted to lower the volume through the ALSA mixer (I haven't connected the volume wheel or separate headphone plug yet) and when I was exiting out the game slowed down and then the wifi dongle's light went out, and wouldn't come back on.
I've read some things about looking to see if the wifi is connected and then telling the Pi to power down and power on wlan0 via a cron job, but I'm not sure what that will do when the dongle isn't plugged in, or how much it'd slow things down if it is plugged in if it wants to ping something a few times to test for connectivity. When I SSH in when a game is playing, the Pi struggles, even just during that initial connection where you get all the stats and such.
-
It's actually the female end of the USB-A wire that I used in my Super Famicom project and it's soldered directly to the power test pads on the Zero and the data pads, so it's bypassing the USB power circuit entirely and is getting power directly from the input.
That seams like it would get enough power unless maybe the ground needs a higher gauge? idk...
It seems to conk out when under heavy CPU load.
I'm not sure how the Pi Zero works vs the Pi3. As long as it's not getting super hot, I can't think of anything else to try.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.