#tyndur · 2009-11-23
303 Nachrichten · Seite 2 von 2 · Original-CSV herunterladen
- XanClicCouldn't you include the metadata in the payload?
- kwolfBy copying the payload into the message
- kwolfMaybe it's unavoidable, don't know
- XanClicAnd what would be the content of this metadata?
- kwolfAt least a function number for "play this data" or "set the volume"
- XanClicWhy can't you include that in the payload?
- XanClicThat format would be user-defined, so the first 32 bits are the function number (for example)
- kwolfThe idea was that you don't copy the data that you get from the application but directly pass it on
- XanClicBut the sender knows about this format so it has to use it
- kwolfAnd in the most inefficient way possible, right?
- XanClicIs it more efficient to pass this one parameter out of the data? I don't know, you're the "IPC" expert ;-)
- kwolfNot copying is more efficient than copying
- kwolfI'm just not completely sure what it needs to completely avoid copying
- XanClicYou mean sometimes there are functions without parameters so there would be no payload to copy?
- FreakyPenguinNo but you can just remap the buffer into the next drivers' address space and so on
- XanClicWhy can't you do that if the function number is not on the stack but in that buffer?
- kwolfApplication (A) wants to play a sound. A sends 512k of data to the mixer (M). M needs to pass the data to the driver (D) but needs to add the M-D protocol header. It can allocate memory for header+data and copy the data into that memory. Or it's using a more intelligent mechanism where it doesn't need to copy.
- XanClicSo you would put the complete header in an extra memory space?
- XanClicSounds reasonable, so you have two buffers instead of one...
- pcmattmanI'll leave you to continue having this discussion, I'm off, sleep time - night all
- kwolfNight pc[away]
- FreakyPenguingn8 pc[away]
- XanClicGood night
- FreakyPenguinHm good idea... *g*
- kwolfXanClic: To do it right you need the possibility to receive data as SHM that you can directly pass on to the sound driver
- kwolfFreakyPenguin: It's how tyndur RPC works, by the way... ;-)
- XanClicI think that's very complicate for a driver interface which should be a simple one...
- FreakyPenguinI meant the thing about gn8... *g*
- XanClic*complicated
- kwolfOh. It would be more like "moin schippi" at this time ;-)
- kwolfXanClic: Right, so I'm waiting for your proposal that is easy, convenient and efficient
- FreakyPenguinXanClic: I dont think passing on two buffers is much more complicated than passing one...
- XanClicFreakyPenguin: That's not it, I mean SHM
- kwolfFreakyPenguin: It's the SHM part that makes it hard
- FreakyPenguinYou don't have to use it in your implementation, if you dont want to?
- XanClickwolf: My proposal would be a very monolithic one, just specific functions for every kind of stack ;-)
- XanClicFreakyPenguin: I do have to if I want to use some drivers, don't I?
- kwolfFreakyPenguin: The interface needs to allow it
- FreakyPenguinI don't see why I cannot just copy the buffer, if I dont want to implement shm?
- kwolfIn a monolithic kernel most of it will boil down to a nop
- XanClickwolf: I know but I look forward on paloxena2 ;-)
- kwolfFreakyPenguin: That's not the point. We're discussing interfaces, not implementations
- FreakyPenguinkwolf: Agreed. But that doesn't make the cdi implementation more complicated
- kwolfAnd if the interface doesn't allow for SHM, then you are forced to copy
- XanClicIsn't message passing enough?
- kwolfExcept for being slow...
- XanClicEvery OS developer may device on his own if he wants to share that memory or if he wants to copy
- XanClics/device/decide
- kwolfXanClic: [15:16] <kwolf> That's not the point. We're discussing interfaces, not implementations
- XanClicI know but you say the implementation would be always slow.
- kwolfIf the interface enforces copies, it will
- FreakyPenguinAnd the driver too, because it has to copy the data
- XanClicDoes it?
- XanClicThe driver says "here is my data, send it to that driver." The OS may decide to copy it or not. It isn't enforced to do so, is it?
- FreakyPenguinBut the driver has to put it in one big buffer together with the metadata and everything?
- XanClic"Together"? You told me that would be a sub-optimal idea, didn't you? ;-)
- XanClicI thought we had two buffers, one filled with metadata and one filled with payload
- FreakyPenguinWell then I don't understand the point of this discussion ;-)
- kwolfXanClic: No, it can't freely decide whether to copy or not
- kwolfShared Memory needs to be allocated as such
- kwolfYou only can share whole pages
- XanClicBut CDI was planned to be an easy interface, wasn't it?
- XanClicAnd I think SHM is not very easy...
- XanClicAnd it would be hard to copy the buffer all the time it changed
- XanClicYou would have to set all the pages to read-only and handle all the pagefaults then
- FreakyPenguinWell two additional functions that are in the case without shm just wrappers to malloc and free arent very hard to implement, are they?
- XanClicSo the driver developer had to handle both cases?
- FreakyPenguinWhat two cases?
- XanClicHaving SHM and don't having it
- FreakyPenguinI only see one ;-)
- XanClicIf you don't have SHM you cannot create a simple wrapper, do you?
- XanClicYou would have to copy the buffer all the time it is changed
- kwolfYou'd fall back to copying
- XanClic*All the time*
- XanClicOn byte set... Copy it.
- FreakyPenguinNo?
- XanClicBut that's SHM?
- FreakyPenguinYou just copy it once?
- kwolfOh. We're not intending to use the SHM to actually _update_ data
- FreakyPenguinWe don't want to emulate shm
- XanClicSo the driver would have to tell the OS when the buffer is done?
- kwolfIt's just for sending data one without copying
- kwolf*once
- XanClicSorry, but sounds too sophisticated in my opinion ;-)
- FreakyPenguinYou dont have to do it that way
- kwolfWait... How are you going to solve the problem without SHM anyway?
- kwolfI mean what you've just said that you actually _do_ need SHM
- XanClic<XanClic> kwolf: My proposal would be a very monolithic one, just specific functions for every kind of stack ;-)
- XanClicI do need SHM?
- kwolfThat doesn't answer the question
- XanClicNo, my USB driver has no problem on working without it
- kwolfI'm talking about audio
- XanClicDo what you want to ;-)
- kwolf+the fuck
- kwolfAs it's stated in the license
- XanClicAs stated in #niwohlos, too *g*
- kwolfafk
- kwolfback
- kwolfXanClic: So your solution is to ignore problems?
- XanClicMy solution is to ignore them as long as I'm able to ;-)
- kwolfThe problem is that a CDI interface is more or less set in stone once it's defined
- XanClicSo I can't define CDI.usb right now because I don't know all about USB 2.0
- FreakyPenguinWell, you know what you have to do *g*