Why Nostr? What is Njump?
2024-03-12 20:57:50
in reply to

m0xEE on Nostr: Curator of Mastodon.art fediblock :newt: That's an insane amount of bullshit here, ...


That's an insane amount of bullshit here, sir!
Had it been the case DMA would have never existed in the first place. It might take certain effort to manage the buffer — and it does anyway, independently on the way you transmit the data, some buffer is always present, at least to keep a certain number of full samples.
But it's not rocket surgery, I think some sort of ring buffer is used. Or maybe two buffers are used — when the device is finished reading one of them, it issues an interrupt and CPU can start filling it again while the device is working with the other one, they keep being switched until the playback is finished. It sure doesn't have to be infinite.
Details of implementation aren't really important, what is — that writing to local memory and just notifying the device that new data is present so the device can read it independently of CPU is a way cheaper operation than pushing ALL THE DATA through the bus using that same CPU.
Some feedback from the device is present in both cases: there could be a buffer underrun or the opposite — the device might be overwhelmed with data and you have to stop transmitting it, it's not like you can shoot all data down the USB bus as fast as you can. It's just that the way to put new data into it is a matter of writing to local memory with DMA — a very cheap operation, compared to… anything really.
Author Public Key
npub1y749ew2wfqfydazhmy9xj0qegvfkn8qlrm3grc8x2u3lplcxufds6zgta6