#tyndur · 2009-11-23

303 Nachrichten · Seite 2 von 2 · Original-CSV herunterladen

  1. XanClicCouldn't you include the metadata in the payload?
  2. kwolfBy copying the payload into the message
  3. kwolfMaybe it's unavoidable, don't know
  4. XanClicAnd what would be the content of this metadata?
  5. kwolfAt least a function number for "play this data" or "set the volume"
  6. XanClicWhy can't you include that in the payload?
  7. XanClicThat format would be user-defined, so the first 32 bits are the function number (for example)
  8. kwolfThe idea was that you don't copy the data that you get from the application but directly pass it on
  9. XanClicBut the sender knows about this format so it has to use it
  10. kwolfAnd in the most inefficient way possible, right?
  11. XanClicIs it more efficient to pass this one parameter out of the data? I don't know, you're the "IPC" expert ;-)
  12. kwolfNot copying is more efficient than copying
  13. kwolfI'm just not completely sure what it needs to completely avoid copying
  14. XanClicYou mean sometimes there are functions without parameters so there would be no payload to copy?
  15. FreakyPenguinNo but you can just remap the buffer into the next drivers' address space and so on
  16. XanClicWhy can't you do that if the function number is not on the stack but in that buffer?
  17. 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.
  18. XanClicSo you would put the complete header in an extra memory space?
  19. XanClicSounds reasonable, so you have two buffers instead of one...
  20. pcmattmanI'll leave you to continue having this discussion, I'm off, sleep time - night all
  21. kwolfNight pc[away]
  22. FreakyPenguingn8 pc[away]
  23. XanClicGood night
  24. FreakyPenguinHm good idea... *g*
  25. kwolfXanClic: To do it right you need the possibility to receive data as SHM that you can directly pass on to the sound driver
  26. kwolfFreakyPenguin: It's how tyndur RPC works, by the way... ;-)
  27. XanClicI think that's very complicate for a driver interface which should be a simple one...
  28. FreakyPenguinI meant the thing about gn8... *g*
  29. XanClic*complicated
  30. kwolfOh. It would be more like "moin schippi" at this time ;-)
  31. kwolfXanClic: Right, so I'm waiting for your proposal that is easy, convenient and efficient
  32. FreakyPenguinXanClic: I dont think passing on two buffers is much more complicated than passing one...
  33. XanClicFreakyPenguin: That's not it, I mean SHM
  34. kwolfFreakyPenguin: It's the SHM part that makes it hard
  35. FreakyPenguinYou don't have to use it in your implementation, if you dont want to?
  36. XanClickwolf: My proposal would be a very monolithic one, just specific functions for every kind of stack ;-)
  37. XanClicFreakyPenguin: I do have to if I want to use some drivers, don't I?
  38. kwolfFreakyPenguin: The interface needs to allow it
  39. FreakyPenguinI don't see why I cannot just copy the buffer, if I dont want to implement shm?
  40. kwolfIn a monolithic kernel most of it will boil down to a nop
  41. XanClickwolf: I know but I look forward on paloxena2 ;-)
  42. kwolfFreakyPenguin: That's not the point. We're discussing interfaces, not implementations
  43. FreakyPenguinkwolf: Agreed. But that doesn't make the cdi implementation more complicated
  44. kwolfAnd if the interface doesn't allow for SHM, then you are forced to copy
  45. XanClicIsn't message passing enough?
  46. kwolfExcept for being slow...
  47. XanClicEvery OS developer may device on his own if he wants to share that memory or if he wants to copy
  48. XanClics/device/decide
  49. kwolfXanClic: [15:16] <kwolf> That's not the point. We're discussing interfaces, not implementations
  50. XanClicI know but you say the implementation would be always slow.
  51. kwolfIf the interface enforces copies, it will
  52. FreakyPenguinAnd the driver too, because it has to copy the data
  53. XanClicDoes it?
  54. 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?
  55. FreakyPenguinBut the driver has to put it in one big buffer together with the metadata and everything?
  56. XanClic"Together"? You told me that would be a sub-optimal idea, didn't you? ;-)
  57. XanClicI thought we had two buffers, one filled with metadata and one filled with payload
  58. FreakyPenguinWell then I don't understand the point of this discussion ;-)
  59. kwolfXanClic: No, it can't freely decide whether to copy or not
  60. kwolfShared Memory needs to be allocated as such
  61. kwolfYou only can share whole pages
  62. XanClicBut CDI was planned to be an easy interface, wasn't it?
  63. XanClicAnd I think SHM is not very easy...
  64. XanClicAnd it would be hard to copy the buffer all the time it changed
  65. XanClicYou would have to set all the pages to read-only and handle all the pagefaults then
  66. FreakyPenguinWell two additional functions that are in the case without shm just wrappers to malloc and free arent very hard to implement, are they?
  67. XanClicSo the driver developer had to handle both cases?
  68. FreakyPenguinWhat two cases?
  69. XanClicHaving SHM and don't having it
  70. FreakyPenguinI only see one ;-)
  71. XanClicIf you don't have SHM you cannot create a simple wrapper, do you?
  72. XanClicYou would have to copy the buffer all the time it is changed
  73. kwolfYou'd fall back to copying
  74. XanClic*All the time*
  75. XanClicOn byte set... Copy it.
  76. FreakyPenguinNo?
  77. XanClicBut that's SHM?
  78. FreakyPenguinYou just copy it once?
  79. kwolfOh. We're not intending to use the SHM to actually _update_ data
  80. FreakyPenguinWe don't want to emulate shm
  81. XanClicSo the driver would have to tell the OS when the buffer is done?
  82. kwolfIt's just for sending data one without copying
  83. kwolf*once
  84. XanClicSorry, but sounds too sophisticated in my opinion ;-)
  85. FreakyPenguinYou dont have to do it that way
  86. kwolfWait... How are you going to solve the problem without SHM anyway?
  87. kwolfI mean what you've just said that you actually _do_ need SHM
  88. XanClic<XanClic> kwolf: My proposal would be a very monolithic one, just specific functions for every kind of stack ;-)
  89. XanClicI do need SHM?
  90. kwolfThat doesn't answer the question
  91. XanClicNo, my USB driver has no problem on working without it
  92. kwolfI'm talking about audio
  93. XanClicDo what you want to ;-)
  94. kwolf+the fuck
  95. kwolfAs it's stated in the license
  96. XanClicAs stated in #niwohlos, too *g*
  97. kwolfafk
  98. kwolfback
  99. kwolfXanClic: So your solution is to ignore problems?
  100. XanClicMy solution is to ignore them as long as I'm able to ;-)
  101. kwolfThe problem is that a CDI interface is more or less set in stone once it's defined
  102. XanClicSo I can't define CDI.usb right now because I don't know all about USB 2.0
  103. FreakyPenguinWell, you know what you have to do *g*