2023-08-04
00:07pbsds has quit [Quit: The Lounge - https://thelounge.chat]
00:08pbsds has joined #asahi-dev
00:40tstraus13 has joined #asahi-dev
00:43mikelee has quit [Remote host closed the connection]
00:54mikelee has joined #asahi-dev
01:06ellyq has quit [Quit: system poweroff requested]
01:14ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
01:16marcantarzeau: glad to hear that! hope you hang around and feel free to ask any questions :) (I know this stuff is kind of complicated)
01:17marcancy8aer: kernel dual-boot rollbacks are not (fully) supported when device tree compat breaks happen. this is expected and a limitation we accept. once device tree bindings are upstreamed, they become stable, and this doesn't happen any more.
01:18marcanyou still want to pull device trees from the most recent installed kernel, since backwards-compatible changes do happen that are required to support new hardware, and you also often need m1n1 updates to go along with it (though we generally try to keep the m1n1 side also backwards compatible)
01:19jeisom has quit [Quit: Leaving]
01:20jeisom has joined #asahi-dev
01:25ourdumbfuture has joined #asahi-dev
01:34mikelee has quit [Ping timeout: 480 seconds]
01:37jeisom has quit [Ping timeout: 480 seconds]
01:50ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
01:54ourdumbfuture has joined #asahi-dev
01:58cylm has joined #asahi-dev
01:59cylm_ has quit [Ping timeout: 480 seconds]
02:00gabuscus has quit []
02:18ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:29ourdumbfuture has joined #asahi-dev
02:30gabuscus has joined #asahi-dev
02:41ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:00skipwich has quit [Quit: DISCONNECT]
03:01skipwich has joined #asahi-dev
03:17bisko has joined #asahi-dev
03:17crabbedhaloablut has joined #asahi-dev
03:30bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:33bisko has joined #asahi-dev
03:35leitao has joined #asahi-dev
03:43leitao has quit [Ping timeout: 480 seconds]
03:44tstraus13 has quit [Remote host closed the connection]
03:46bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
04:33sefidel has quit [Remote host closed the connection]
04:34sefidel has joined #asahi-dev
05:03mikelee has joined #asahi-dev
05:26cylm has quit [Ping timeout: 480 seconds]
05:36mikelee has quit [Ping timeout: 480 seconds]
05:38mikelee has joined #asahi-dev
05:54mikelee has quit [Ping timeout: 480 seconds]
06:07eiln has joined #asahi-dev
06:11jannaupairing of a logitech mouse persistantly failed with kde's wizard but worked with bluetoothctl on the first try
06:20roxfan has quit [Ping timeout: 480 seconds]
06:21cy8aermarcan: Yes I accept this too and declare this as something we call in german a childhood desease.
06:26cy8aerBut with the possibility to rebuild the boot.bin before rebooting into another kernel via "update-m1n1" like in the asahi dists (and not via a packaged and assembled boot.bin we just have with the debian packages) this is a good compromise. And for debian I look for creating a clone of the asahi-scripts and contact @Glanzmann for this.
06:38lena has joined #asahi-dev
06:41adryzz has quit [Ping timeout: 480 seconds]
06:43eilnisp processes frames in batches (2 <= n <= 10), so all n frames are bundled up in a single doorbell / interrupt cycle. batch count can differ per cycle, macos usually uses 2 or 3, prolly their timing/scheduling algo
06:43eilnthe problem is that it's minimum 2 frames, but I have no guarantees on the number of (user) queued buffers (because they're from users). past the limit (v4l2 max buf count is 32) I can at least split them into sub-batches
06:44eilnfrom my understanding (limited) the only way to enforce the "at least 2" is by making up a fake format of 2 chroma & 2 luma (...)
06:44eilnI can't just hang until the user queues another one, so rn I have a "fallback" second frame under kernel ownership, which wastes half of the work (but it's better than nothing)
06:46lena has quit [Ping timeout: 480 seconds]
06:47marcanhttps://www.kernel.org/doc/html/v4.16/media/uapi/v4l/vidioc-reqbufs.html#vidioc-reqbufs is a bit ambiguous but doesn't clearly seem to state that allocating more buffers than requested is illegal
06:48marcan"A larger number is also possible when the driver requires more buffers to function correctly."
06:53eilnbut delivery is dequeue. http://www.infradead.org/~mchehab/kernel_docs/userspace-api/media/v4l/capture.c.html
06:54eilnunder read_frame in case IO_METHOD_MMAP, the user dequeues a (done) buffer, and enqueues another for processing
06:55marcanso the idea is you force the buffer count allocated to always be at least 2 (or 4), and then tell ISP it's okay to deliver 2 frames once 2 free buffers are available
06:59marcanone thing you *could* do is unconditionally always allocate at least 1 more buffer than userspace requested, so that if userspace is trying to allocate some exact number of buffers it wants "in flight", there will always be one extra one in the queue (but userspace could still use too many in that case anyway)
07:01marcanhttps://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-videobuf2.html <- see min_buffers_needed
07:04zkrx has joined #asahi-dev
07:06marcanfwiw I just checked ffplay and it requests 256 buffers, gets 32, pops 6, then starts alternately queuing and dequeuing, eventually catching up with more queueing (?)
07:07marcanhttps://www.kernel.org/doc/html/v4.9/media/uapi/v4l/vidioc-g-parm.html <- you also need to set readbuffers to 2+ I think
07:08leitao has joined #asahi-dev
07:13marcaneiln: looks like queue_setup is allowed to do stuff with the buffer count, see e.g. v4l2-pci-skeleton.c
07:15eilnif there's 6 in, I can process 2-6 at once. if i do 6, they'd pop one, and add one. the next dequeue would hang without a way to enqueue
07:16leitao has quit [Ping timeout: 480 seconds]
07:18marcanactually no, if you do 6 why wouldn't that work? they'd pop one, and add one, but there's 5 more left to pop so it won't block
07:20marcanif the queue has 6 empty buffers, you request 6 frames from ISP, they come back. you mark all those buffers as full. userspace dequeues one, enqueues it, dequeues another one, enqueues it, etc. until it either runs out of all 6 or the driver decides to ask ISP for more data
07:31marcaneiln: sorry if I'm completely misunderstanding the issue here, queueing shenanigans get hairy :(
07:32eilnmarcan: deadlock is the VIDIOC_DQBUF ioctl, which polls for one buf to be processed by the driver
07:32eilnuser initally requests all buffers with VIDIOC_REQBUFS. that count I can modify/gurantee. after that, when stream starts, the driver marks the processed buffers and kicks them out of the queue. then those can be delivered to userspace polling with VIDIOC_DQBUF. most processes would use alternating enqueue/dequeue, which for the ISP is NOT 1 but the batch count.
07:33eilnsay the reqbufs count is 3. I'd mark two done, leaving me with 1 in the queue. but the user would typically only poll for one dequeue, and (logically) enqueue one more. there's now 2 in my queue, which I'd process both and send off. the user (again) dequeues one and enqueues another, leaving 1 in the queue. they'd hang on the next dequeue because we're not operating on the same
07:34marcanbut it's not dequeuing empty buffers from the queue, it's dequeueing processed buffers, no?
07:36marcanreqbufs is 3, you send 2 off to ISP. ISP comes back with that data, you mark 2 code. there are now 2 complete buffers in the queue and 1 empty buffer. user dequeues one of the complete buffers, and re-enqueues it. there are now 2 empty buffers in the queue, which you send off to ISP, and they come back. userspace dequeues one buffer from the processed list, and re-enqueues it. there is now 1 ...
07:36marcan... empty buffer in the queue. the next dequeue it grabs another processed buffer, since you still have 2 of those.
07:37marcanlike the way I see this there are two queues, one of empty buffers and one of processed buffers, and buffers move from empty to processed under driver control, and from processed to empty under userspace control
07:38dylanchapell has quit [Ping timeout: 480 seconds]
07:41eilnI only have one queue, p->queued list. I don't track done bufs. the user has to re-queue it into the queued list
07:45eilnin the irq I'd do vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); list_del(&buf->link); for both buffers
07:45eilnthe buf being buf = list_first_entry_or_null(&video->buffers, struct aspeed_video_buffer, link);
07:52_jannau__I don't think there is a problem from my experience writting and reading v4l2 uuser space code
07:54_jannau__user space dequeues buffers as fast as it needs to and holdson to as many buffers as it needs
07:57_jannau__in a typical display scenario 3 buffers are needed. user space needs 1 for display and enqueues it after next was dequeued and is display. the driver has in the mean time 1 frame for processing
07:58_jannau__if the driver needs at least 2 frames for processing the queue size has to be at least for. the driver can enforce that at request_buffers time
08:01_jannau__if if user space needs more buffers, it needs to request buffers. we can add 1 or 2 to that number
08:06marcaneiln: my understanding of the queueing is this: https://gist.github.com/marcan/2ef2c3ecbf0aebf1459c1ce2adc960d2
08:07marcanbasically every time you call vb2_buffer_done those get put into a list, and dqbuf will pull from that list
08:08marcanqueued_list is "buffers not owned by userspace", isp->buffers is "buffers owned by the device", and done_list is "buffers waiting to be dequeued by userspace"
08:09marcanyou don't actually block in the driver proper, you just add buffers to isp->buffers until there are enough to submit, and only submit at that point
08:17leitao has joined #asahi-dev
08:19leitao has quit []
08:37MajorBiscuit has joined #asahi-dev
08:41marcanunrelated note: finally got around to poking SMC from macOS. on an M1 air in screen-off idle, with SSH over WiFi active, PSTR claims 0.2-0.4W
08:43marcanPPBR (battery power) is higher but I think that might be a lie, since it doesn't track PSTR well at all
08:43ohmadcs^ has quit [Remote host closed the connection]
08:44chadmedhmmm ok i think we're a bit higher than that with EAS at the desktop so there might be some gains left on the table in the cpus
08:46marcanI mean we have schematics for some of these things, and plaintext SMC firmware for all the M1s :p
08:49leitao has joined #asahi-dev
09:07leitao has quit [Ping timeout: 480 seconds]
09:34eiln[ 27.304247] apple-isp: frame 62: meta_iova: 0x3a40000 luma_iova: 0x3d00000 chroma_iova: 0x3de4000
09:34eiln[ 27.563717] apple-isp: frame 63: meta_iova: 0x3a48000 luma_iova: 0x3a50000 chroma_iova: 0x3b34000
10:05dylanchapell has joined #asahi-dev
10:29adryzz has joined #asahi-dev
10:49leitao has joined #asahi-dev
10:59chadmedok im starting to think that funky volume-ramping thing macos does might actually be required
11:02chadmedrapid volume changes below ~400hz cause popping which i have been thinking all this time is the result of overexcursion
11:11heyda has quit [Ping timeout: 480 seconds]
11:12ourdumbfuture has joined #asahi-dev
11:29leitao has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:36ChaosPrincess has quit [Quit: WeeChat 4.0.2]
11:37ChaosPrincess has joined #asahi-dev
11:39roxfan has joined #asahi-dev
11:44lena has joined #asahi-dev
11:44adryzz has quit [Remote host closed the connection]
11:45lena6 has quit [Remote host closed the connection]
11:45lena6 has joined #asahi-dev
12:02lena has quit [Quit: .]
12:03roxfan2 has joined #asahi-dev
12:08roxfan has quit [Ping timeout: 480 seconds]
12:08ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
12:08systwi_ has quit [Read error: Connection reset by peer]
12:10systwi has joined #asahi-dev
12:13systwi has quit [Read error: Connection reset by peer]
12:13adryzz has joined #asahi-dev
12:14systwi has joined #asahi-dev
12:14adryzz has quit []
12:14ourdumbfuture has joined #asahi-dev
12:17kettenismarcan: are you sure about those PSTR values? Sounds like you're off by a factor 10 to me
12:18leitao has joined #asahi-dev
12:27ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
12:28dsharshakov has joined #asahi-dev
12:29dsharshakovchadmed: do you hear the popping while adjusting the volume or when content volume changes rapidly?
12:30dsharshakovwell, a click effect is sort of expected once volume premultiplier jumps, and unlikely that's going to hurt HW (unsure)
12:31dsharshakovPW has some stuff for volume ramping currently: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1579 . It's not yet wired up to pulse-server
12:31dsharshakovDoes macOS feature some sort of autogain + compressor for that?
12:32chadmedim not really entirely sure how it works and its been over a year since i even looked at coreaudio's graph
12:33dsharshakovlibebur128 + some modification like EE's one but with inertia (not just holding the level, but ramping it to the new level)
12:33chadmedfor all i know it could actually just be overexcursion but if that were the case then it would appear with my 0 dBFS sine wave
12:34dsharshakovlookahead? Does it work with anything other than files? Or it just buffers some time ahead?
12:35chadmedall i remember is kinda speculating as to how it works based on some strings in the obfuscated plists
12:35chadmedand then reading about popping and sudden changes in volumes in the asoc and TI documentation and put the pieces of the puzzle together
12:35dsharshakovdoes it add latency? is there a way to know whether it's used when RT apps like DAWs do their output with latency-critical params?
12:36chadmedtheres a coreaudio preset which gives "raw" access to the output but i would wager this never, ever, ever gets used
12:36ourdumbfuture has joined #asahi-dev
12:36dsharshakovso it's likely to be that this AU doesn't have huge buffer
12:37chadmedand i would assume it adds _some_ latency of course but i havent benched or RE-ed any of the coreaudio stack beyond reading strings in plists
12:37dsharshakovdoes EE (easyeffects) autogain give similar results when you drag the slider after the expected volume change? which content causes this?
12:38dsharshakovwell, it's certainly not just zero latency, but probably rt-friendly if supposedly used in any scenario
12:40chadmednow that ive started testing on a 13" with different codecs but the same woofers, im leaning towards this being some limitation in the digital side of the codecs
12:40chadmedi can crank absolutely heinous volumes through those and get some very obvious overexcursion but none of this digital-sounding popping noise
12:41dsharshakovwe can move to #pipewire, maybe there are some people who could help
12:41dsharshakovmaybe it's a D/A side thing, why would TI write else? btw is their doc not confidential?
12:42dsharshakovtry to make a recording of the noise as well and put that on PW Matrix
12:43dsharshakov13" Intel Pro uses an HDA codec or something T2-related?
12:44jeisom has joined #asahi-dev
12:45chadmedits a cirrus hda thing, the driver is an out-of-tree monstrosity but it works ~the same as ours does (raw access to the individual drivers)
12:46chadmedanyway re confidentiality, the codecs are just TAS2764 with a different name lasered on to the top
12:46dsharshakovI meant some writeup re volume changes. Is it in datasheet or an article by ti?
12:52c10l has quit [Quit: Bye o/]
12:52chadmedim not going to run the unconstrained raw output for long because its not pay week this week, but it doesnt _seem_ to happen via the raw output even up to 100%
12:54chadmedso we're either saturating the convolvers somehow (even though the volume isnt indicating anywhere near 0 dBFS anywhere) or something deeper is up
12:55chadmedive already bypassed the bass thing and the compressor and it just gets worse so im thinking its something in the convolver
12:55leitao has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:58chadmed has quit [Quit: Konversation terminated!]
13:00c10l has joined #asahi-dev
13:00chadmed has joined #asahi-dev
13:00leitao has joined #asahi-dev
13:03chadmed has quit []
13:03chadmed has joined #asahi-dev
13:03ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
13:05ourdumbfuture has joined #asahi-dev
13:07chadmed has quit []
13:08chadmed has joined #asahi-dev
13:11Cyrinux9474 has quit []
13:11Cyrinux9474 has joined #asahi-dev
13:17dsharshakovwhich branch of the dsp repo do you use?
13:17dsharshakovis it with bankstown in?
13:24dsharshakovunsure if it will be reproducible with typical hw, but will try
13:30chadmedi just have to change where we add the compensatory gain, ill just tweak the dynamics processor to deal with it
13:45sid-linux has joined #asahi-dev
14:11dsharshakov has quit [Quit: Page closed]
14:25marcanare you sure it's working? and dynticks and all that kind of stuff? the CPUs need to go idle and stay idle
14:27marcankettenis: also you need to make sure the CPUfreq is set to the lowest pstate when going idle
14:29kettenisI *think* it is working, and when I actually suspend clock interrupts are completely disabled
14:34ketteniswith "lowest pstate" you mean the lowest state advertised in the app tables in the DT isn't it?
14:51eiln has quit [Quit: WeeChat 4.0.2]
14:51ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:03leitao has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:05leitao has joined #asahi-dev
15:13nela has quit [Quit: bye!]
15:13nela has joined #asahi-dev
15:24ourdumbfuture has joined #asahi-dev
15:29mikelee has joined #asahi-dev
15:34ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:42ourdumbfuture has joined #asahi-dev
15:49mikelee has quit [Ping timeout: 480 seconds]
15:58cylm has joined #asahi-dev
16:14mikelee has joined #asahi-dev
16:15matrix_ds has quit [Quit: Bridge terminating on SIGTERM]
16:17matrix_ds has joined #asahi-dev
16:17matrix_ds has quit [Excess Flood]
16:18matrix_ds has joined #asahi-dev
16:18williamdes-m has joined #asahi-dev
16:23mikelee has quit [Ping timeout: 480 seconds]
16:28V--I--P has joined #asahi-dev
16:31MajorBiscuit has quit [Quit: WeeChat 3.6]
16:34V--I--P has quit [Remote host closed the connection]
16:39highvoltage[m] has joined #asahi-dev
16:39mjolnir[m] has joined #asahi-dev
16:40paddatrapper_ has joined #asahi-dev
16:40ahdeb[m] has joined #asahi-dev
16:40tumblingweed has joined #asahi-dev
16:40ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
16:43ourdumbfuture has joined #asahi-dev
16:52leitao has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:58leitao has joined #asahi-dev
17:05ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:06deflated8837 has quit [Ping timeout: 480 seconds]
17:07leitao has quit [Ping timeout: 480 seconds]
17:14mikelee has joined #asahi-dev
17:22mikelee has quit [Ping timeout: 480 seconds]
17:24leitao has joined #asahi-dev
17:32leitao has quit [Ping timeout: 480 seconds]
17:39mikelee has joined #asahi-dev
17:48mikelee has quit [Remote host closed the connection]
17:48mikelee has joined #asahi-dev
17:55sid-linux has quit [Ping timeout: 480 seconds]
17:59mikelee has quit [Remote host closed the connection]
18:06mikelee has joined #asahi-dev
18:18MaxxRoach has joined #asahi-dev
18:22hightower2 has joined #asahi-dev
18:24MaxxRoach has quit []
18:25MaxxRoac_ has joined #asahi-dev
18:44Z750 has quit [Quit: Ping timeout (120 seconds)]
18:44Z750 has joined #asahi-dev
18:46MaxxRoac_ has quit [Remote host closed the connection]
18:50mikelee has quit [Remote host closed the connection]
18:58mikelee has joined #asahi-dev
19:02mikelee has quit [Remote host closed the connection]
19:02mikelee has joined #asahi-dev
19:09zalyx0 has quit [Quit: later alligator]
19:11zalyx0 has joined #asahi-dev
19:11zalyx0 has quit []
19:12MaxxRoach has joined #asahi-dev
19:16mikelee has quit [Remote host closed the connection]
19:18zalyx0 has joined #asahi-dev
19:19zalyx0 has quit []
19:20MaxxRoach has quit [Ping timeout: 480 seconds]
19:30MaxxRoach has joined #asahi-dev
19:35WindowPa- has quit [Read error: Connection reset by peer]
19:37WindowPain has joined #asahi-dev
19:46ourdumbfuture has joined #asahi-dev
19:47MaxxRoach has quit [Ping timeout: 480 seconds]
19:48MaxxRoach has joined #asahi-dev
19:53rootbeerdan has joined #asahi-dev
20:02MaxxRoach has quit [Remote host closed the connection]
20:02MaxxRoach has joined #asahi-dev
20:09maximbaz has quit [Quit: bye]
20:09maximbaz has joined #asahi-dev
20:11MaxxRoach has quit []
20:14qyliss has quit [Quit: bye]
20:16qyliss has joined #asahi-dev
20:17MaxxRoach has joined #asahi-dev
20:18MaxxRoach has quit [Remote host closed the connection]
20:19MaxxRoach has joined #asahi-dev
20:46roxfan2 has quit [Ping timeout: 480 seconds]
20:48roxfan has joined #asahi-dev
20:52ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:07ourdumbfuture has joined #asahi-dev
21:24Bey0ndB1nary has joined #asahi-dev
21:36cylm has quit [Ping timeout: 480 seconds]
21:48Bey0ndB1nary has quit []
22:09mikelee has joined #asahi-dev
22:10mikelee has quit [Remote host closed the connection]
22:17MaxxRoach has quit [Remote host closed the connection]
22:17MaxxRoach has joined #asahi-dev
22:20mikelee has joined #asahi-dev
22:21mikelee has quit [Remote host closed the connection]
22:22mikelee has joined #asahi-dev
22:23mikelee has quit [Remote host closed the connection]
22:25MaxxRoach has quit [Ping timeout: 480 seconds]
22:29mikelee has joined #asahi-dev
22:30mikelee has quit [Remote host closed the connection]
22:35MaxxRoach has joined #asahi-dev
22:43MaxxRoach has quit [Ping timeout: 480 seconds]
22:47mikelee has joined #asahi-dev
22:52crabbedhaloablut has quit []
22:53MaxxRoach has joined #asahi-dev
22:55mikelee has quit [Ping timeout: 480 seconds]
23:01MaxxRoach has quit [Ping timeout: 480 seconds]
23:02ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:09MaxxRoach has joined #asahi-dev
23:09mikelee has joined #asahi-dev
23:17MaxxRoach has quit [Ping timeout: 480 seconds]
23:18mikelee has quit [Remote host closed the connection]
23:19mikelee has joined #asahi-dev
23:22jeisom has quit [Remote host closed the connection]
23:22jeisom has joined #asahi-dev
23:22mikelee has quit [Remote host closed the connection]
23:23mikelee has joined #asahi-dev
23:24ourdumbfuture has joined #asahi-dev
23:27MaxxRoach has joined #asahi-dev
23:30jeisom has quit [Ping timeout: 480 seconds]
23:31mikelee has quit [Remote host closed the connection]
23:34ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:35MaxxRoach has quit [Ping timeout: 480 seconds]
23:37WindowPain has quit [Quit: ZNC 1.8.2 - https://znc.in]
23:39ourdumbfuture has joined #asahi-dev
23:41rootbeerdan has quit [Quit: rootbeerdan]
23:43WindowPain has joined #asahi-dev
23:44MaxxRoach has joined #asahi-dev
23:52MaxxRoach has quit [Ping timeout: 480 seconds]