DecoderSID? #72
Replies: 5 comments 9 replies
-
Cool, I like the idea. I would propose to use the AudioTools and not the AudioKit as starting point. This has the advantage that it will play not only on an AudioKit but on any other supported device as well and that you can store the data on different media. As far as the file size is concearned, I would not be too worried because each file just has a couple of K, so it should be fine to allocate this in RAM (and on the AudioKit we can even use the 4MB PSRAM). I suggest to use a Vector where we can just call a resize() with the actual file size to load. Unfortunately this does not really fit into the current Codec Architecture. So it will be something separate. So I propose to create a SIDPlayer class that relies on the existing functionality of the AudioTools AudioPlayer (using the parameters AudioSource and AudioPrint) and just implements the methods which are different:
ps. here are some hits on how to store the songs in Progmem: https://github.com/pschatzmann/arduino-audio-tools/wiki/MemoryStream:-Converting-a-File-to-Flash-Memory ps. I just noticed that your arrays are missing a const: this is causing that they are stored in RAM instead of PROGMEM |
Beta Was this translation helpful? Give feedback.
-
Actually I started to work on it. Maybe we can do this together ? |
Beta Was this translation helpful? Give feedback.
-
Have a look at https://github.com/pschatzmann/SIDPlayer
|
Beta Was this translation helpful? Give feedback.
-
Sure thing. Fairly busy during the day, but will have some time tonight.Sent from my iPhoneOn 1 Mar 2023, at 10:07, Phil Schatzmann ***@***.***> wrote:
I have a concept now to determine the size: Can you help with the open points above.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello again, I think I managed to fix the compile issues. New file attached for the libcsidlight.cpp file. The ESP32 does however enter a reset loop with the following messages: rst:0xc (SW_CPU_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT) Core 0 register dump: Backtrace: 0x400d3414:0x3ffe3bb0 0x400d8441:0x3ffe3be0 0x400e6603:0x3ffe3c10 0x40082e4e:0x3ffe3c40 0x400792ba:0x3ffe3c90 |<-CORRUPTED #0 0x400d3414:0x3ffe3bb0 in audio_tools::SIDPlayer::setAudioInfo(audio_tools::AudioBaseInfo) at src/SIDPlayer.h:46 ` I also took the liberty to remove files that do not work well due to limitations in the player code. It does not support emulation of a CIA IC and volume sample tricks used by some songs, which require either a real Commodore 64 or more advanced emulator logic. Ref. https://gist.github.com/cbmeeks/2b107f0a8d36fc461ebb056e94b2f4d6 |
Beta Was this translation helpful? Give feedback.
-
Hello @pschatzmann,
Your libraries came to my attention through Andreas Spiess' videos and I must say I have some fun playing with your libraries!
I also came across this project recently:
https://github.com/possan/csid-esp32
Which made me wanted to see if I was able to make my AI Audio Kit V2.2 use your libraries and be able to play old C64 sid files.
I was somewhat successful. I took some inspiration by looking at your Sinewave example and was able to make libcsid library kind of work. Sounds great! However, the code uses a sid tune that is stored in memory. I tried to see how I would go about loading up an SD card with a bunch of SID tunes and play these, similarly to the MP3 examples you have provided. This proved difficult with my limited knowledge of all the libraries about the best way to go about doing this. I also noted that there seems to be an assumption in the libcsid library that the whole tune must be in memory first before it can play it, as it uses extensive memory copying mechanisms to set up the simulation environment.
Just wanted to reach out to you to see if you have any pointers on how to go about solving this and/or if you want to include a SID decoder in your library. :)
esp32-memory-sid-audiokit.zip
Kind regards from Norway,
Gunnar Larsen
Beta Was this translation helpful? Give feedback.
All reactions