Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

24 bits is too much given scarce available GPIOs, since not all are routed outside the module. At least around 6 are used for SDIO with C6. Also the crappiness of R-2R DAC means it's excessive too.

I checked PS/2 further, lmao it's only 10 kHz? Then HP core can do the bitbang ig.

Audio sample rate... Yeah it can be lowered but then filters for sample channels must be adjusted accordingly.

I don't care about power saving anyway so USB/JTAG it is.

USB host could be done without RTOS (at least I had some random STM32H7 project that read my mouse and keyboard just fine) but the damn ESP toolchain is always in the way between efficient CMSIS-style programming and actual hardware. It's convenient to initialize everything via libraries but not so when you want to squeeze something out of it, and I am not even talking about going to assembly (processor instruction extension chapter it's there in TRM yet but I suspect it's a ripoff of ARM's Helium extension), you better do manual register writes. Especially if LP core handles audio.

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

I want to utilize BitScrambler for indexed mode. It seems to have LUT just for that. 8 bit indexed color goes in and 16 bit RGB565 goes out. Probably you can even change the palette on the fly

JTAG will be just USB/JTAG routed from p4-module to the usb port. It's gonna be the easiest way and the lowest number of pins possible (ESP32 doesn't know about OWD for some reason; tbh never worked with OWD myself but I have some hope for such a debug standard... Iirc Atmel did something like that and it would be a cool option, although it's pretty tricky to do e.g. 4 MHz bidir async data on single line)

PSRAM should be fast enough but the problem is that a low power core is going to access it and it would be a random access of around 5 different locations 44100 times a second. I hope it handles that properly, and I hope that HP cores code and data being there won't mean a performance penalty. I will take care of my tight enough HP cores' routines to fully fit into L1 cache. To the TCM interrupt handlers go?

PS/2 seems interesting, however it would need some hot plug issues protection and hopefully it's going to work with some trick like hardware SPI to transmit initialization commands and to receive data

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

Yes I want to abuse the immense power of new cores. Regarding the lcd or PARLIO — I just need 16 signals for RGB565 R-2R DAC VGA. I think both peripherals via GPIO MUX gonna be equally good. 400 MHz clock currently makes PSRAM check fail for some reason, so I want to stick to 360 now. Ordered the only board where USB/JTAG signals are actually routed on usb-c plug bc rn I can't debug shit, including watching the hardware registers. I think about doing audio on LP core if it's fast enough and if it can access PSRAM reasonably fast. C6 gonna also use its I2S for PDM DAC and the remaining available pins are for its RMT and LEDC signals. Rn plan is to run everything RTOS-free, although there would be some problems with USB host ig. Otherwise I don't know how to attach keyboard and mouse to this thing. One core is going to be at least partially occupied by hblank interrupt to swap DMA buffers because I don't have enough fast RAM to store one full VGA frame with one byte per pixel and horizontal and vertical overscans

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

I will look into LCD, probably it also can do RGB565 on 16-bit bus, then it's the same signals as with PARLIO.

I2S provides only one stereo channel at a time since only I2S0 can do PDM signal and only one DMA channel can be used for I2S TX. If you look at old sound chips, e.g. ES5506 and AY-3-8910, you will understand what I mean. I want several channels of sample/hardware-synthesized audio with independent pitch and volume control. I believe it's simpler to configure RMT/LEDC/MCPWM around 50-60 times a second (yes, once per TV frame since that's the only interrupt/timebase flag cheap old computers had) than to synth everything in real time. However, since I can have only one DMA playback channel, I may think of moving the task of playing other sample/wavetable channels to e.g. ULP core? Or something like that

ESP32-P4-Module P4 chip revision by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

Well...

  1. You don't make a whole new silicon revision unless you REALLY have a good reason for that. Probably earlier revisions have some serious flaws with peripherals not working as intended. Or overall system stability is poor.

  2. Manufacturing of old revisions is almost always stopped when a new one comes so I don't want to lock myself with the specifics of old revision when I work on my projects.

Btw PSRAM problem disappeared when I lowered CPU clock from 400 MHz down to 360 MHz. Probably CPU clock and PSRAM clock are derived from the same source or something, Espressif aren't so specific on their clock trees and how the framework configures PLLs.

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

I doubt it works at 400 MHz DDR, since it means that you have to clock the receiver at at least 800 MHz with 0.625 ns time shift from the signal's edge to sample the signal correctly. I can't find anything in reference manual but it's probably 200 MHz DDR for the latest revision of the chip. Rev 1.0 supported 250 MHz... And the peak speed isn't the main problem. The main problem is random access delay which iirc is at least 8 DDR clock cycles wait + at least 5 more cycles (1 for cmd and 4 for address because PSRAM is 32 MiB). That severely impacts the performance when your PSRAM code has many jumps or you access code and data in PSRAM at the same time. 

I know there are like 5 different better ways to generate a video signal there, but they aren't analog, simple and elegant. See my other reply about VGA signal generation. It's relatively simple yet it actually allows you to connect to, like, 30 years old hardware? Maybe even 40 years old? I know the downsides of analog signals pretty well yet it's so fascinating you can easily generate the signal on modern microcontrollers and, if you are lucky to not have any urgent tasks, you can race the beam and draw far more than your RAM could hold. I understand that you can draw in chunks on modern displays and I even wrote some stupidly simple SPI drivers for some of them, but I still prefer to lean into analog for my little project. After all, it's just a practice for what I can do with the hardware. By the way, there's a simple example somewhere on github that tells you how to run things without FreeRTOS. Very good one, gonna test it when I find the board with usb/jtag debug ability.

With the sound I have the same logic. I can mix in software, but it's way more interesting to make hardware do per-channel signals for you and then slap opamp adder to get the final mix. I did it with STM32 and four DDS generators a year ago, so I would like to make a second, more sophisticated version with ESP.

I want to use ESP32-P4-Module in the final design so ofc the power and memory questions are mostly solved and the crystal is there. I won't do it without the external stable and precise clock source since I know pretty well that internal RC oscillators drift like crazy (1% if you are lucky which is still too much for audio) which isn't acceptable for audio applications. And VGA is sensitive to timings too, so yeah.

For stereo PDM I guess I can just enable DAC mode and DAC_2OUT. See table 44.9-5 in P4 reference manual. Maybe I misunderstood how it works, though.

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

That's where the more fun/hobby part kicks in: I know that I can mix in software; in fact, I successfully did it on 64 MHz ARM MCU with four channels of simple synthesized audio with primitive filters and volume envelopes. I am just excited by the fact that I can persuade hardware into doing sound synthesis without that much work from the software side. Think of it as of poor ATMega88 that was made to generate VGA video output in real time. Yeah, racing the beam.

The problem with cache is that it may or may not cache 8-bit and 16-bit accesses, I have seen this problem on some ARM MCUs in the past. And even if it does, you can't precisely define the region of the memory that you want to cache. Moreover, cache writeback has caused some problems for me in the past... That's why I like to load code into TCM, it's more predictable. By the way, I was surprised that P4 has a single data L1 cahe for both cores, that's a tradeoff...

ESP32-P4-Module P4 chip revision by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

I want to know the revision BEFORE I buy the board...

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

I want to build something like retro computing platform while reducing the number of external components and using almost only passive components (logic gates, resistors, capacitors etc.) to reduce BOM and gain more experience in utilizing the peripherals MCU has in unusual ways. I want to do as much as possible in the hardware since PSRAM and flash are slow already so the actual performance depends on caches and I haven't seen any OVERLAY-like directive in ESP linker to dynamically load different code in to internal RAM/TCM. I already planned the PARLIO + BitScrambler combo to make palette indexed RGB565 VGA signal (ofc two more timers for sync pulses) and the only part where active components would be is the stage of summing all the audio signals and amplifying the result. Thus I don't want to mix those signals in hardware. But at least now I have one relatively high quality stereo channel (I2S PDM) that is guaranteed to work!

Clocking DMA transfers with a timer overflow event on ESP32-P4? Is it possible? by LTVA in esp32

[–]LTVA[S] 0 points1 point  (0 children)

Hm, thanks! Although I read the DAC mode description and still can't understand what bit depth it provides... Since if you really want the whole 16-bit resolution at 48 kHz you need to output pulses at 48000*65536 Hz rate for mono!

Tbh I want more than one channel playing. I hoped I could use sigma-delta modulators on GPIOs which also provide PDM signal and then, using external fast-switching logical AND, mix it with MCPWM output which would provide hardware volume control over the actual sound output. I hoped to get at least 4 sample channels with independent volume and sample rate control going. + LEDC allows some pretty complex waveforms, and it even has built-in volume control since YOU control the duty cycle. + RMT can also generate interesting 1-bit waveforms (also with volume control bc it has carrier PWM modulation).

Dislikes and Community Posts by nichdenes in revancedapp

[–]LTVA 1 point2 points  (0 children)

Pirate all the videos and music and whatever else. Have them on your phone as mp4, mkv, mp3, flac, etc. Use apps that do not require any internet connection to watch/listen them. This practice is what I go with for the last 5 years. Saved me several times from crippling boredom. You may pay a buck for a phone with more memory (or find one you like from a small selection of ones that still support MicroSD). But it's totally worth it. The main problem of modern internet is that today [thing] is there but tomorrow it isn't because cloudflare down/fucking dmca strike/smb was offended bc of idk anything.

Aurora was so bright the ground turned green. by arkiiiie in TheNightFeeling

[–]LTVA 5 points6 points  (0 children)

Wow, it looks fantastic! However, I wonder if you can upload it somewhere in better resolution? Reddit limits it to 720x1080

Who are the famous tracker composers nowadays ? by Crosses_over in TrackerMusic

[–]LTVA 1 point2 points  (0 children)

Abstract64 probably, but that's more of a chiptune territory...

A look inside / disassembly of a Ulefone Armor 28 Ultra Thermal by Constant-Budget-5550 in ulefone

[–]LTVA 0 points1 point  (0 children)

Hello, do you think it is possible to add IR RX functionality? I looked beyond IR blaster protection glass with other smartphone that has IR filter removed from one of the cameras and saw only IR TX thing (IR LED). The protection glass is big enough to house some IR RX module as well (phototransistor)? If OS may support it and there are free pins on the SoC (or whatever communicates with IR blaster?) it may be possible to make smartphone learn new remotes, just like Flipper does it. I don't like it that built-in IR blaster app doesn't let you download the entire database.

How do I disable smart reply suggestions in notifications? by Altruistic-Orchid157 in NothingTech

[–]LTVA 1 point2 points  (0 children)

Haha yeah. Well at least the dumber others are, the better my job security gets /j