Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A SID player for RP2040 microcontrollers

NotificationsYou must be signed in to change notification settings

henrikenblom/SIDPod

Repository files navigation

The SIDPod is a PSID player for RP2040 microcontroller based boards, such as theRaspberry Pi Pico or theSolder Party RP2040 Stamp. Playback is based on the SID emulator found inTeensy-reSID, which in turn is based onreSID


Building

Software

Building from source

SIDPod requires both theRaspberry Pi Pico SDK and thepico-extras. Make sure to grab these and either put them next to theSIDPod directory or, if you have them somewhere else, point thePICO_SDK_PATH andPICO_EXTRAS_PATH environmentvariables to their respective location. You'll also need CMake on your path. If/when these prerequisites have beensatisfied, you're almost ready to run thecmake command to create the build directory and configure the build. Onelast thing to do is to make sure the board type matches the one you have. By default, SIDPod builds for the Solder PartyRP2040 Stamp, which, for example, has a larger NAND flash than the more common Raspberry Pi Pico. Using a RP2040 StampUF2 on a Pi Pico would most likely cause issues on the first run, as the flash will get formatted,using boardspecific settings, if no readable FAT filesystem is found on it. Changing board type can either be done by modifyingthePICO_BOARD variable inCMakeLists.txt or by setting thePICO_BOARD environment variable beforerunning thecmake commands. The correct value for the Raspberry Pi Pico is 'pico'. Once this is done, the build isconfigured by running:

cmake -B cmake-build-debug

Alternatively, if you haveNinja installed, you can save a few seconds of your valuable timeby instead running:

cmake -G Ninja -B cmake-build-debug

Then, to build theSIDPod.uf2 binary, issue:

cmake --build cmake-build-debug --target all

Once the build finishes, just follow the official instructions for loading a UF2 binary onto the board. For Raspberry PiPico you hold down theBOOTSEL button when you plug it in and then copySIDPod.uf2 to it, once it appears as adrive namedRPI-RP2. For some other types of boards, such as the Solder Party RP2040 Stamp, this mode is activated bydouble-clicking the reset button.

Also note that if you're running macOS, copying using Finder might fail with thiserror:The operation can’t be completed because an unexpected error occurred (error code 100093).If this is the case, fire up the 'ol terminal and do:

cp cmake-build-debug/SIDPod.uf2 /Volumes/RPI-RP2

Prebuilt binaries

To get a jump start you can also grab theprebuilt binaries.There are two versions, one for the Solder Party RP2040 Stamp and one for the Raspberry Pi Pico.

Hardware

Construction

Since the main goal is to make a portable player, the actual build and design is up to you, the maker. My currentprototype is built inside a 3-AA battery box I had lying around, using a Solder Party RP2040 Stamp and a 3.7V 150mAhLiPo battery. However, the breadboard design I'm using for development, based on a Raspberry Pi Pico H, looks like this:


The breadboard schematics.

In reality, the development breadboard looks a bit different. I use a dual lane breadboard and connect to the SIDPodPico board via aPicoprobe, for debugging and a less painful developmentprocess.


The development breadboard setup.


The working prototype. Please excuse the soldering. I'm a lover, not a solderer. 😜

Power

The main advantage of the Solder Party RP2040 Stamp, besides its size, is the onboard LiPo charger. This removes somecomplexity and saves space when moving beyond the breadboard design. Many RP2040 projects can easily run off the powerprovided from the host computer over the built-in USB port. The SIDPod however, will enter a special USB device stateand start to mimic a USB mass storage device once connected to a computer.More on that here. Thisposes a problem, if you actually want to use it for what it's designed for - to play PSIDs. That problem can easily besolved by powering it from any power source connected to theVSYS pin. That power source can be anything from a 3.7VLiPo battery to a separate USB breakout bord, with the breakout boardsVBUS connected toVSYS on the Pico Board andthe breakout board GND connector connected to any GND on the Pico Board. In my development breadboard setup I power theSIDPod Pico Board from the Picoprobe Pico Board. In the next section I've listed the components needed for a fewdifferent options:

Bill of materials

Option 1 - Using a Solder Party RP2040 Stamp (the prototype setup):

Option 2 - Using a Raspberry Pi Pico (the breadboard setup):

Option 2a - Add a Raspberry Pi Pico with Picoprobe, for debugging, binary upload and power through VSYS:

Option 2b - Power the Raspberry Pi Pico through a USB breakout board:

Using

To keep the construction as simple as possible I tried to minimize the number of physical controls, and a rotary encoderwith a built-in push button provides enough versatility to cater to every possible use case of this rather minimaldesign. Therefore, controls are both contextual and pattern driven.

Finding music

TheSID or Sound Interface Device, which this player does arudimentary emulation of, was a component in the world's most popular home computer, theCommodore 64. Due to its legendary status and, to this day, very activecommunity, there's no shortage of SID files to fill your SIDPod with. The most complete collection is theHigh Voltage SID Collection. It has everything, from cult classics by the legendary JeroenTel to contemporary pieces by Kamil Wolnikowski, aka Jammer. Download the full archive and use one of the SID playersreferenced on that page to find the music you like. The collection contains both PSIDs and RSIDs. Most PSIDs areplayable and with the introduction of reSID, (version 2.0beta and later) some RSIDs are playable. However, fullcompatibility is not guaranteed yet.This is being worked on though.

Creating playlists

With the introduction of version 2.0beta,music must be put in playlists. And the definition of a playlist is afolder with at least one PSID in it. Furthermore, to avoid out of memory errors, the maximum number of PSIDs in aplaylist is restricted to 256. And the number of playlists is limited to 256 as well. This means that the maximum numberof PSIDs is 65536. Coincidentally, the memory size of our favorite 8-bit home computer. ❤️

As you may have figured out, this many PSIDs would never fit on the internal flash. They will however fit on astandard size SD card, which is something that will be supported when SIDPod 2.0 is out of beta.

Adding music

The SIDPod doubles as a USB mass storage device, which means that if you plug it in to your computer it will show up asa regular, FAT-formatted drive. This means that adding and removing PSIDs is as easy as copying or deleting files. Thereare a few caveats though:

  • Since version 2.0beta PSIDs must be put in folders. As mentioned above.
  • Use it with moderation.FatFs doesn't have anywear levelling algorithm, and NAND flash storage wears out faster thanregular flash drives. Note though that this only goes for write operations. Reading is totally harmless.
  • It's slower than you're probably used to. This is due to several factors. One being that flash memory blocks needs tobe erased before new data can be written to them.

While the SIDPod is connected, the screen shows flickering bars. Don't be alarmed. This is a feature, not a bug. Infact, it's a reference to the C64 - those who know, know.

Playback

Chip support

Since the introduction of version 2.0beta, the SIDPod supports both the MOS 6581 and MOS 8580 chip models, and up tothree SID chips. There's no need to worry about which chip is used in the PSID file, or how many, as the SIDPod willautomatically detect this and set up the emulation accordingly.

Disclaimer: Some 3-SID songs are a bit too much for the poor SIDPod, resulting in partial stutter when the filters areactive. Unless you overclock it! Currently, the clock speed is set to 200MHz, which is the highest officially supportedsetting. For songs like Melbourne Shuffle by Jammer, you need to stretch this all the way up to 260. Which might damageyour microcontroller!

Playlist selection

playlists.png

Once you've added some funky tunes andsafely disconnected the SIDPod it presents the playlists. In alphabeticalorder. The controls in this mode are:

  • Scroll through the list by turning the encoder.
  • Single-clicking enters the selected playlist.

If you've started a song, as described in the next section, the relevant playlist is decorated with an animated spectrumanalyser symbol. When a song is paused, the animation is paused as well.

Song selection

playlist.png

Once you've entered a playlist, the screen shows the songs in that playlist. Also in alphabetical order. There's also a<< Return entry at the top. Use it to navigate back to the playlist selection view. The controls in this mode are:

  • Scroll through the list by turning the encoder.
  • Single-clicking plays the selected song and enters a very retro-fancy visualization mode.
  • Double-clicking plays or pauses the selected song but keeps the playlist mode.
  • Double-clicking in visualization mode pauses playback and displays a pause notification on screen.

The currently selected song is decorated with a traditional play symbol and the currently playing song is decorated withan animated spectrum analyser symbol. When a song is paused, the animation is paused as well.

If a song gets crossed out when you're trying to play it, it means that it's either corrupt or uses a combination ofopcodes that have caused the song loading routine to enter an infinite loop and seemingly hang. This is very rare forPSIDs, but unfortunately a little more common for RSIDs.As mentioned above, a fix for this is being worked on.

Visualization mode

visualization_preview.gif

This is the mode that shows the animated spectrum analyser.Plus a few other effects. The controls in this mode are:

  • Single-clicking returns to the song selection view.
  • Double-clicking plays or pauses the selected song but keeps the visualization mode.
  • Turning the encoder adjusts the volume. See below.

Volume control

volume.png

This control is only available from the visualization mode and is activated by rotating the encoder. Turn the encoderclockwise to increase the volume and counter-clockwise to decrease it. The current volume is displayed on screen as longas the encoder is being turned. Plus 400ms after the last turn.

Warning! With the current implementation the overall sound volume has increased since the first version. Be mindful ofthis, if you're using headphones.

Pocket mode

In this mode the screen is turned off, as well as the regular controls. Playback is still active though, which makes itperfect for when you're out and about. To enter this mode, simply hold the button pressed until the screen goes black.This takes exactly one second. Be careful not to hold it for too long, as this will put the SIDPod to sleep. More onthat in the next section. To get out of pocket mode, simply double-click, and it will return to whatever mode you werein before entering pocket mode.

Deep sleep

This mode is as close as you can get to turning the SIDPod off. As with pocket mode, all regular controls are disabled.Additionally, playback is stopped, as well as USB device clocks. In fact, in this mode, even both processor cores arestopped, meaning that the power consumption is next to nothing. To enter deep sleep, press the button for more than twoand a half second. To get out, hold the button until the SIDPod splash appears.

Beta disclaimer

This is a beta version of the SIDPod. While it has been tested thoroughly, there are still some bugs and issues thatneed to be worked out. And the entire code base would benefit from some cleanup and pattern alignment.

General disclaimer

Even though I am a professional software engineer, I am a novice and a hobbyist when it comes to both hardware and C/C++development. So there's a good chance that I have made more than a few mistakes. If you find any, please let me know, byopening an issue on GitHub. I'll be happy to fix them and learn from them. Hopefully in a timely manner.

What's on the horizon?

  • Support for SD cards. This will allow you to store a lot more music than the internal flash can handle.
  • Pi Pico 2 support. This will improve performance and playback quality. Potentially, this could allow for builtinBluetooth A2DP support. For Pi Pico 2W boards.
  • "SIDPod Buddy" support. The SIDPod Buddy is an ESP32 based device that allows you to control the SIDPod using aCirque TM023023 Trackpad. Additionally, it provides Bluetooth A2DP support, which means that you can stream music to anyBluetooth enabled speaker.
  • A custom PCB, incorporating all the components needed to make a fully functional SIDPod. With SIDPod Buddy support.

About

A SID player for RP2040 microcontrollers

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp