#
…

2022-09-12

00:08thelounge7571340 has quit [Ping timeout: 480 seconds]
00:12e1eph4nt has joined #asahi-dev
00:19off^ has quit [Ping timeout: 480 seconds]
00:26thelounge7571340 has joined #asahi-dev
01:25thelounge7571340 has quit [Remote host closed the connection]
01:29thelounge7571340 has joined #asahi-dev
01:30e1eph4nt has quit [Ping timeout: 480 seconds]
01:39e1eph4nt has joined #asahi-dev
01:42thelounge7571340 has quit [Read error: Connection reset by peer]
01:42thelounge7571340 has joined #asahi-dev
02:42thelounge7571340 has quit [Remote host closed the connection]
02:46e1eph4nt has quit [Ping timeout: 480 seconds]
02:48thelounge7571340 has joined #asahi-dev
03:29e1eph4nt has joined #asahi-dev
03:48thelounge7571340 has quit [Remote host closed the connection]
03:53thelounge7571340 has joined #asahi-dev
04:20thelounge7571340 has quit [Ping timeout: 480 seconds]
04:52Z750 has joined #asahi-dev
04:52ids1024 has joined #asahi-dev
04:52kode54 has joined #asahi-dev
04:52esden has joined #asahi-dev
04:52koorogi has joined #asahi-dev
04:52arnd has joined #asahi-dev
04:52kendfinger has joined #asahi-dev
04:52_alice has joined #asahi-dev
04:52Simonx22 has joined #asahi-dev
04:52sjg1 has joined #asahi-dev
04:52turo has joined #asahi-dev
04:52Chainsaw has joined #asahi-dev
04:52philpax___ has joined #asahi-dev
04:52linxz has joined #asahi-dev
04:52tardyp has joined #asahi-dev
04:52tmlind has joined #asahi-dev
04:52x56 has joined #asahi-dev
04:52tych0 has joined #asahi-dev
04:52jkkm has joined #asahi-dev
04:54kendfinger has quit [Quit: Updating details, brb]
04:54azenla has joined #asahi-dev
05:22thelounge7571340 has joined #asahi-dev
05:32thelounge7571340 has quit [Ping timeout: 480 seconds]
05:34thelounge7571340 has joined #asahi-dev
05:42e1eph4nt has quit [Ping timeout: 480 seconds]
05:50e1eph4nt has joined #asahi-dev
05:58e1eph4nt has quit [Ping timeout: 480 seconds]
06:05SSJ_GZ has joined #asahi-dev
06:13refi64 has joined #asahi-dev
06:23e1eph4nt has joined #asahi-dev
06:34thelounge7571340 has quit [Read error: Connection reset by peer]
06:37thelounge7571340 has joined #asahi-dev
07:01thelounge7571340 has quit [Ping timeout: 480 seconds]
07:43e1eph4nt has quit [Ping timeout: 480 seconds]
08:00nsklaus has joined #asahi-dev
08:02jluthra_ has quit [Remote host closed the connection]
08:03jluthra_ has joined #asahi-dev
08:05thelounge7571340 has joined #asahi-dev
08:06nsklaus_ has quit [Ping timeout: 480 seconds]
08:07e1eph4nt has joined #asahi-dev
08:08rpirea__ has quit []
08:09rpirea has joined #asahi-dev
08:13marcanjannau: does your DT update also include all of povik's updates? (looks like it, but just checking)
08:15povikAFAIK it does
08:16marcanre the speaker volume caps, is there any chance we can move that config to the DT? it feels a bit wrong to have to hardcode that in the driver for each model
08:16e1eph4nt has quit [Ping timeout: 480 seconds]
08:18jannaumarcan: yes
08:23poviknot sure it's that wrong, since there's other model-specific quirks we need to hardcode
08:24povikhaving said that, i plan to move the caps to DT
08:25e1eph4nt has joined #asahi-dev
08:26nsklaus_ has joined #asahi-dev
08:26marcanwhat model-specific quirks can't be encoded in the DT? (not arguing with you, just want to get the full picture)
08:29povikas i plan it the driver won't probe with speakers on the general compatible (unless void_warranty=1), only for models for which we have written down the quirks or which we have explicitly blessed to be okay without quirks will the driver probe
08:29povikmarcan: see the fixup_controls in macaudio.c, e.g. the j314 tweeter highpass and over-current retry
08:30povikor the locking of left/right slot selection on codecs where it doesn't make sense
08:30povikso i just want to point out that as i plan it we have to explicitly enable each model in macaudio.c anyway
08:31jannaucan't we add that all to the dts and fail to probe if the devicetree doesn't have entries?
08:33nsklaus has quit [Ping timeout: 480 seconds]
08:36marcantesting new kernel merge now
08:48poviklike a quirk list?
08:49povikor express it in props and the driver refuses probe if there are props it doesn't know?
08:50marcanah, you mean so it can refuse to probe for "new things" it doesn't know about? can't we just use compatibles for that?
08:51marcanwe can just have models have a fallback compatible to the oldest "equivalent" model as far as driver support
08:51povikyeah, that i like
08:51marcanif we introduce new props that require handling the driver does not currently do, then those models don't get the old compatible
08:51povikstill some level of general compatibles
08:51povikcoarser than per-model
08:52marcanyeah, doesn't make sense to have true "general" compatibles here since the audio setups are quite diverse, but it does make sense to throw fallbacks in for models which are effectively the same setup as older ones
08:53povikthat actually works with the driver already, listing the compatible of past similar model
08:53marcanthat way we can support new machines that basically look like old ones (with different volume caps and other parameter values)
08:53marcanyeah, it'd just be adding actual properties for things on top of that
08:53marcan(for things we do expect to change like caps)
08:53povikand if we move the caps to dt, that may increase the versatility sonewhat
08:53povikyeah, sounds good
08:57marcanI see we already use the "* Tweeter" pattern to match tweeters, so that's probably pretty general already. Mostly just volume limits then (which probably should be specified per-speaker, ideally in those DT nodes but that might be a bit difficult with how ASoC is organized?)
08:57marcangoing to try to add j413
09:01thelounge7571340 has quit [Remote host closed the connection]
09:04thelounge7571340 has joined #asahi-dev
09:11marcanlooks like ~the same as j314
09:16marcanpovik: what does the ASI1 Sel force do?
09:23marcanheh, enabled everything and audio just works without any userspace :) (sounds like crap of course)
09:23marcanlooks like by default it only routes to tweeters
09:26marcanalright, first let's try to kill the speakers :p
09:28marcanI wonder if I can actually buy the "proper" version of I Won The Loudness War on Apple Music
09:30marcanokay, I'm concerned this track might destroy my speakers *in macOS*
09:30marcanjust hitting preview, lol
09:31marcanpovik: dare I say macOS-3dB was a good idea
09:32marcanand apparently I don't have AppleCare on the M1 MBA... ha. I know I do on the M2 one at least.
09:33e1eph4nt has quit [Ping timeout: 480 seconds]
09:58e1eph4nt has joined #asahi-dev
10:04thelounge7571340 has quit [Remote host closed the connection]
10:08e1eph4nt has quit [Ping timeout: 480 seconds]
10:08thelounge7571340 has joined #asahi-dev
10:18e1eph4nt has joined #asahi-dev
10:26marcanpovik: honestly, this sounds way scarier on the M1 MBA in macOS at full volume than on the M2 MBA in Linux
10:29marcanoh wait. I forgot volume=0.1, lol.
10:29marcanyeah okay this is properly scary
10:31marcanlet me get on macOS and get a reference for how these speakers are *supposed* to sound
10:55marcanheh, there's quite a bit of harmonics on a sine sweep... I wonder if I already screwed the speakers up a bit or it's normal
10:57chadmedare you just pumping the sine sweep into each driver with alsa? harmonics at ~480-500 and multiples thereof are non-pathological
10:57chadmedthe chassis themselves are quite noisy even going back to intel macbooks
10:58marcanI was using macos, but now trying alsa
10:58marcanit actually sounds more balanced without any EQ on alsa, I think apple are doing some really weird stuff...
10:58marcanespecially the woofer part
10:58chadmedyeah im really not a fan of what apple do
10:59chadmedits quite muddy and gross, almost like they got the beats team to handle the EQ
11:00chadmedthe woofers really pop at 500ish especially but its almost like apple try to accentuate that even more with whatever they do to give the perception of bass response at low volumes
11:02marcanit does look like I have more harmonics than with macOS, but this isn't a very controlled test
11:03marcanprobably also cancellation issues since I'm just sending it out of all drivers all at once
11:03marcanlet me do one at a time as a control
11:06marcanhmm... I think the highpass isn't getting applied to both tweeters?
11:07thelounge7571340 has quit [Remote host closed the connection]
11:07marcanalsamixer does show both controls at 800Hz though
11:08chadmed_ has joined #asahi-dev
11:11marcanpovik: you silly, you got the wrong register!
11:11marcanit's DC_BLK1, not DC_BLK0
11:13thelounge7571340 has joined #asahi-dev
11:24thelounge7571340 has quit [Read error: Connection reset by peer]
11:25thelounge7571340 has joined #asahi-dev
11:25e1eph4nt has quit [Ping timeout: 480 seconds]
11:25marcanwait no, it is 0, I can't read
11:25marcanbut then why does it look like it's not working for one tweeter?
11:32marcanI may have already damaged a tweeter...
11:32off^ has joined #asahi-dev
11:32marcanthe left one sounds super low compared to the right one
11:34e1eph4nt has joined #asahi-dev
11:35povikapplying the filter is audible on the woofers, so i think that should be alright
11:35Race has joined #asahi-dev
11:36chadmedwhen i played around with some of the alsamixer controls it also smushed the volume until i rebooted so you could try that too i guess
11:36chadmedspecifically the amp gain sliders did that
11:38marcanpovik: yeah, something else is the issue with my left tweeter
11:38marcanit's not just volume though
11:39marcansomething is very wrong here
11:39marcanlet me go back to macos...
11:39povikwasn't that before the volume field fix to tas2764, very early into development?
11:39povikchadmed: ^
11:39marcanokay, even the boot chime sounds weird now
11:39marcanI'm pretty sure I did damage
11:40chadmedpovik: probably, i never touched them again after the initial incident
11:40chadmedmarcan: oof thats unfortunate
11:40marcanand I had the volume caps all along, though I did briefly remove the HPFs and run sine sweeps in my confusion
11:41povikso it wasn't from macos you did the damage, that would make for a more amusing story :p
11:41marcanokay yeah this is rattling in macos
11:41marcanI screwed up my speakers yay!
11:41marcanit's weird though
11:41chadmedit mustve been teetering on the edge of death already somehow then, i ran multiple full volume sine sweeps when i was doing the DSP stuff :/
11:42povikthis isn't j314 i think
11:42povikmarcan: right?
11:42e1eph4nt has quit [Ping timeout: 480 seconds]
11:42chadmedoh yeah, odd that itd be significantly weaker though
11:43marcanoof these speakers are definitely busted, yup.
11:43povikso you can blow your speaker if you try very hard :D
11:44marcanI didn't try that hard!
11:44poviknot that we didn't know all along
11:44marcanI somehow managed to fry, I think, both tweeters? in different ways
11:44marcanthe left one is just half dead, very quiet and with a poor response
11:44marcanthe right one rattles
11:45marcanthe thing is, I don't know *when* I fried them
11:45marcanbecause if I'm reading my audacity recording right, they were already like that before I messed with the HPF
11:45marcanand the only thing I did between the macOS boot when things sounded fine and that, was run a few full sine sweeps (all drivers at once), *with* HPF and volume limiting
11:46marcanso that suggests the HPF + volume limit are *not* enough to prevent damage
11:46marcanunless... I fried them from macos running sine sweeps there
11:46marcanI'm not sure if I tested something sane in macos after the sweeps
11:46marcanbut it has to have been one of those two
11:48marcanok, comparing the last macos sweep with a new one, the rattling is definitely new
11:48chadmedhuh i wonder if it was indeed macos then
11:49chadmedthat would be incredible and hilarious if so
11:50e1eph4nt has joined #asahi-dev
11:51marcancomparing the first 2 recordings I have of linux sweeps, I think it was already damaged by the second one
11:51marcanbut possibly not the 1st
11:51marcanso it sounds like I killed it from linux, with a full-volume all-driver sweep, with all the safeties enabled
11:52povikso you traced macos before to get the cap
11:52povikon j413?
11:55marcanand I think I may have also damaged at least one of the woofers :D
11:55chipxxx has joined #asahi-dev
11:55marcansince it now rattles before even hitting the HPF threshold for the tweeters
11:58povikhm, i think the next step is finally looking at macos impulse response
11:58povikso we will see the precise envelope, and if there's a significant component of software attenuation
11:58marcanthis does also suggest that we need significantly lower volume caps, if we want to not have userspace responsibilities, unfortunately
11:59povikit is bit suspect the amp gain settings from macos are mostly the same across models
12:01marcanI do suspect you can kill the speakers from macos too, given the right audio (I mean, I did see a T2 Mac's speakers die from a simple electric piano patch, not even at full volume)
12:02marcanbut yeah, I think this time the damage was from linux
12:04chadmedpovik: would it not be better to just bump the kernel driver limits way down instead of copying the IRs from macos? both in terms of infallibility from userspace and affording us the ability to maximise the sound quality from these things
12:05chadmedtheyre already stupidly loud
12:07marcanI mean we should look at the macOS IRs just to see *what* it does
12:07marcananyway, I guess all that's left now is to blast I Won The Loudness War on it and see how much worse I can kill them?
12:10chadmed_ has quit [Quit: Konversation terminated!]
12:13marcanlet's see. took a reference speaker-test + sweeps before.
12:16chipxxx has quit [Remote host closed the connection]
12:19povikchadmed: i am not advocating for copying it, but we will be able to tell at what point we are contained in the vendor's frequency envelope, for example
12:19poviknot sure there's point in torturing the speakers further, marcan :D
12:20marcanscience!
12:20chadmedit's fun
12:21off^ has quit [Ping timeout: 480 seconds]
12:24marcanokay, I played the whole song and I can *smell* the voice coils cooking
12:24thelounge7571340 has quit [Read error: Connection reset by peer]
12:24chadmedawesome :D
12:24marcanlet's see how much damage I did :D
12:28marcanokay, now both tweeters are properly damaged, not just the left one
12:29marcanbut get this - the right woofer now rattles less!
12:29marcanthe song *improved* it!
12:31povikit just occurred to me we could have with a bit of work recorded the isense/vsense values from the test
12:31povikwell, next time...
12:31marcanyeah, I think that's also something we need to figure out
12:31marcanwant to work a bit on figuring that out, for when I get the machine back?
12:32marcanI was doing a pretty slow sine sweep (40 seconds). it's possible a much faster one will give us enough data while being less likely to kill drivers.
12:34marcanyup, definitely fixed the rattling. this is hilarious!
12:35chadmedi used either 10 or 15 seconds with REW, the machine was loud enough that it was able to pick up its sync/cal signals
12:37marcanthen again, the "fixed" right woofer might just be because it damaged it in a way that reduces its volume, and now it doesn't hit rattling level :D
12:37marcanthough I'm not entirely sure
12:38thelounge7571340 has joined #asahi-dev
12:38marcanbut yeah, in macOS now it basically just sounds like no tweeters, otherwise fine
12:46Race has quit [Ping timeout: 480 seconds]
12:46marcananyway, given all this, I'm going to make sure speakers are disabled across the board and push out testing kernels
12:47dottedmagmarcan: Remember "cleaner" floppy disks?
12:47dottedmagThis song is a "repair" song, kinda similar
12:47chadmedplasma burn in fixer but for melted electromagnets
12:49chadmedanyway i have tomorrow (mostly) off so happy to test on my machine if youve got asahi-wip rebased by then
12:57e1eph4nt has quit [Ping timeout: 480 seconds]
12:59chipxxx has joined #asahi-dev
13:06e1eph4nt has joined #asahi-dev
13:07marcanas for the woofers: macOS doesn't get anything below 80Hz out of them, though it does spit out odd harmonics from inputs as low as 25 Hz, which I suspect is a deliberate saturation filter
13:07marcanso we should probably set the HPF for the woofers to 50 Hz, I don't see the point in trying to pump out anything lower
13:15e1eph4nt has quit [Ping timeout: 480 seconds]
13:23e1eph4nt has joined #asahi-dev
13:26DmitrySharshakov[m]If you got colis overheated then it definitely seems that the problem lies in gain. Frequency related problems must not have caused that, since those could only do mechanical damage by oscillations
13:26DmitrySharshakov[m]<marcan> "so we should probably set the..." <- Yes, I suggested that. povik said it's the default of that amp (reset state)
13:27povikisn't it 4 Hz? let's check
13:28DmitrySharshakov[m]4 Hz wasn't there in the datasheet
13:28DmitrySharshakov[m]Ah, I forgot. it's 2 hz default (DC block)
13:28DmitrySharshakov[m]But I suggested 50, we agreed on that being excess
13:28DmitrySharshakov[m]It's unlikely to have had caused damage, but still
13:29marcanDmitrySharshakov[m]: I don't think that's true. the movement of the coils has feedback effects on voltage/current, which could increase current flow.
13:29povikexactly, the power transfer is frequency-dependent, i would imagine
13:29DmitrySharshakov[m]Well, inductance could do something bad as well...
13:29marcanhence, ISENSE/VSENSE might be useful here
13:30marcanI don't think this is what damaged the woofers though / caused the rattling, I think it's more likely that there are resonant peaks that cause things to break/get loose mechanically
13:30marcanbut it's still dumb to try to put put anything lower than 50Hz, you can *hear* the things moving at 20Hz even though they don't do much
13:30marcan*put out
13:31marcanas for the tweeters though, I do suspect those just cooked themselves at this volume, to some extent
13:31DmitrySharshakov[m]marcan: Also, chadmed noticed case vibrations on <50Hz, so they're unpleasant to users as well
13:31e1eph4nt has quit [Ping timeout: 480 seconds]
13:31marcanit's possible they seized up, and the remaining frequency that comes out is whatever the mechanical state they ended up in allows via resonance
13:31DmitrySharshakov[m]Seems to be. So lower the volume limits in HW
13:32marcanyeah, in general I think the tweeters are too loud sans EQ anyway, they actively hurt my ears
13:32marcanso maybe the trick here is to just lower the max volume of the tweeters
13:35DmitrySharshakov[m]I think we don't need high volume, let it be quiter. Laptop is a device for personal use, not public events, so we can reduce its output power
13:36DmitrySharshakov[m]IV sense is an interesting thing, actually interesting to implement just for the sake of coding. However, that leads to more risks
13:36povikwhat? no
13:36povikit has ~zero risk, and i know how to implement what we need to asoc so we can get the measurements
13:37povikalso, my goal is to get it safe, otherwise i am not going to limit the volume
13:37thelounge7571340 has quit [Remote host closed the connection]
13:37poviki enjoy how loud my macbook can get, and there will be others too
13:37DmitrySharshakov[m]Also, TAS2764 does that by streaming back, unsure whether it's easy to handle in kernel
13:37DmitrySharshakov[m]Is it implementable?
13:38DmitrySharshakov[m]povik: We can get the measurement, but need to react to it (preferably in kernel)
13:39poviki will implement what's needed so we can peek at the measurements, but we are not going to inspect them in kernel
13:39DmitrySharshakov[m]How? We just measure stuff?
13:39DmitrySharshakov[m]Ah, you mean during tests
13:39poviknot now, and probably never, given the upstream's stance on this
13:39DmitrySharshakov[m]Sorry for misunderstanding
13:39e1eph4nt has joined #asahi-dev
13:40DmitrySharshakov[m]I first thought we could make use of those measurements in runtime for extra safety
13:40povikwell we can, but it has to happen in userspace
13:41DmitrySharshakov[m]Yes, so that would be risky as I mentioned earlier
13:42thelounge7571340 has joined #asahi-dev
13:42marcanpovik: for safety reasons, there is an argument for doing something with the I/VSENSE data in the kernel I think, especially if the alternative is DSP in the kernel / trusting userspace
13:42marcanit depends on what we see, so let's get the data out first
13:42DmitrySharshakov[m]btw does Apple Care return the replaced parts?
13:42marcanbut I think we might be able to do something like a partial sampling where we don't necessarily process all the data, but just do RMS measurements on part of each frame, enough to decide whether to trip a safety mute
13:43marcanit's not nice but it's nicer than DSP in the kernel or requiring sane userspace
13:43DmitrySharshakov[m]marcan: Probably sth as simple as 'if higher than (say) 2 watts in some time, lower the gain'
13:43DmitrySharshakov[m]marcan: Yea, nice idea
13:43marcanI wouldn't lower the gain, I'd just mute for a second or so. this is supposed to be a last resort safety, under the assumption that userspace *is* trying to do the right thing in the normal case.
13:43DmitrySharshakov[m]But still I guess we just need to lower the volume
13:44DmitrySharshakov[m]marcan: Hmm, might be done like that as well
13:44DmitrySharshakov[m]Does macOS activate the I/V sense feedback ever?
13:45marcanI think macOS does activate it
13:46marcanpovik: an alternative would be to build this as a "speakersafetyd" that both enables the higher volume caps and watches over the I/VSENSE data, and is supposed to be simple / unrelated to any sound system in use
13:46marcanthen that'd need kernel checks to make sure that process is alive and processing input data, and if it stops, revert the increased volume caps
13:47rmkis "brcm,cal-blob" still being used?
13:47marcanbut at that point I'm not sure if that *really* buys you a whole lot over a kernel thread doing the same thing, so that'd be a discussion to have on the MLs
13:47marcanrmk: yes
13:47marcanm1n1 populates those properties
13:47povikthat's actually what upstream hinted towards in macaudio RFC v1/v2, not sure which one it was
13:47povikre: speakersafetyd
13:47povikwhen i wanted to get rid of the ISENSE/VSENSE stuff
13:48marcanyeah, the main thing is really how much processing does it have to do, and do you actually get anything out of it being in userspace at that point
13:48raytracer has joined #asahi-dev
13:48raytracer has quit []
13:48poviki can guess the upstream's arguments...
13:48marcanif it's just taking some envelopes and doing some simple hysteresis or whatever, I'm not sure punting that to userspace (with the additional complexity of watching over it from the kernel anyway, and having a handshake for the uncapping) actually buys you much?
13:48marcanI mean I know the usual arguments here
13:48DmitrySharshakov[m]Probably if maintainers are not against this kernel driver should take care of it
13:49marcanbut the usual use case isn't safety related
13:49marcanand the kernel is supposed to ensure safety
13:49DmitrySharshakov[m]btw I/V sense is used by most phones. Do some have upstream drivers for that? If so, let's take a look
13:50DmitrySharshakov[m]marcan: and another question is whether we really want that high volume level which will then be protectively clipped/muted/attenuated when it goes out of safe range
13:50marcanpovik: anyway, please see if you can get the data out :)
13:50marcanand I'll see about getting this thing repaired
13:51marcanDmitrySharshakov[m]: the problem is it being frequency-dependent
13:51marcanhaving volume caps is trivial
13:51povikmarcan: yeah, happy to :)
13:51marcanbut the maximum safe volume for all possible inputs may wind up being significantly lower than what macOS achieves
13:51povikand the other points i will leave for others to argue over on the lists
13:52marcanlet's see if the data is even useful at all
13:52DmitrySharshakov[m]marcan: Yes, so if it is significantly lower, then we have a need in something like that
13:52DmitrySharshakov[m]Yes, after we get a look at data we could try to find out how Android handles those events
13:52marcanI wish these things had a couple biquads we could just program... they already do a significant amount of DSP anyway
13:53marcanDmitrySharshakov[m]: Android has a whole audio framework, and you can trust it because Android is a fixed OS built for specific machines
13:53marcanthey have a different paradigm
13:53marcansame as Chrome OS
13:53marcanwhich is why I blew my Chromebook speakers when I poked around alsamixer
13:53marcanwith platforms like that, the platform can assume userspace is doing the "right" thing
13:53marcanour requirements are not the same for desktop linux
13:54DmitrySharshakov[m]marcan: Like the userspace is fixed and kernel gives no guarantees?
13:55marcanI doubt most Android platforms implement proper safeties in the kernel, they just rely on the userspace config being correct
13:55marcancase in point: at one point LineageOS for one of my older phones had the vibrator gain set too high, and it would rattle like hell
13:55marcanthey rely on userspace for everything on Android
13:55DmitrySharshakov[m]At least finding the code might make us know the amount of processing
13:56DmitrySharshakov[m]I guess RMS values with some multiplier should give us enough to trigger the safety mute
13:57DmitrySharshakov[m]But other platforms are likely to even scale the volume based on that data
13:58DmitrySharshakov[m]* DmitrySharshakov[m] goes to Texas Instruments website to find out more and revise the datasheet
13:59DmitrySharshakov[m]I think I've seen a whitepaper from them about using I/V sense in products
14:00povikif you find it link it please
14:00marcanDmitrySharshakov[m]: random example: my phone does it with a codec that has an actual DSP and firmware: https://github.com/LineageOS/android_device_google_bramble/tree/lineage-19.1/audio/cs35l41
14:00marcanso not useful for us
14:00marcanI suspect it's going to be like that, either DSP, or just userspace, for ~all android devices
14:02DmitrySharshakov[m]povik: sure, will do
14:02DmitrySharshakov[m]marcan: dream codec
14:03DmitrySharshakov[m]well, tas's also have a DSP, why not a firmware-enabled one? ;(
14:03DmitrySharshakov[m]At least they have HPF, thanks for that huh
14:07chipxxx has quit [Read error: No route to host]
14:10marcanhere's one that does it in userspace. this one of course is not ALSA, it's proprietary qualcomm nonsense: https://source.codeaurora.org/quic/le/platform/hardware/qcom/audio/tree/hal/audio_extn/spkr_protection.c?h=LV.AU.0.2.0.r1
14:10marcanso yeah, I have ~no hope of finding anything in this field that we can actually use
14:14DmitrySharshakov[m]However, that code looks to have some potential to reach the kernel. Not FFT, way smaller memory footprint, no tons of maths
14:15marcanah, it actually is tinyalsa, but it also uses custom stuff around it, so shrug
14:17skipwich has joined #asahi-dev
14:17DmitrySharshakov[m]Yes, some MSM audio headers at least. So probably it's not a standardized kernel API... Well, we should get that problem discussed on the LKML
14:18marcanDmitrySharshakov[m]: from what I can tell in that code, they only use VI feedback to compute speaker calibration, not normally at runtime
14:21skipwich has quit []
14:21skipwich has joined #asahi-dev
14:23DmitrySharshakov[m]https://source.codeaurora.org/quic/le/platform/hardware/qcom/audio/tree/hal/audio_extn/spkr_protection.c?h=LV.AU.0.2.0.r1#n2413 appears to be something continuous. though code is hard to understand, I'm not really into Android userspace parts to know where it plugs into
14:41DmitrySharshakov[m]Not the thing I recalled of, but definitely nice to read through (will do)
14:41thelounge7571340 has quit [Remote host closed the connection]
14:46DmitrySharshakov[m]https://www.ti.com/lit/an/slaa900/slaa900.pdf refers to a program used as a playground for evaluation, as well as some more (yet not directly related) facts about I/V sense
14:46DmitrySharshakov[m]Do all known AS Macs (except the iMac) use TAS2764 codecs?
14:46e1eph4nt has quit [Ping timeout: 480 seconds]
14:48DmitrySharshakov[m]I've read that those need software speaker protection, but there are ones from within SmartAmp lineup which implement the algorithm themselves. Sadly those likely aren't included in any models
14:51thelounge7571340 has joined #asahi-dev
14:57e1eph4nt has joined #asahi-dev
15:02marcanso I may have found where in the ADT the speaker amp level is set, and also it seems some macs use speaker-protection (which I think means VI sense) and some don't
15:03thelounge7571340 has quit [Ping timeout: 480 seconds]
15:03marcanit seems the original M1 trio never had speaker-protection, and the desktops (including iMacs) don't have it enabled. every laptop after that (t6k series and M2) does have it.
15:04DmitrySharshakov[m]Some do enable the feedback? Does j413 you've been testing use that, is there a backchannel in the traces?
15:04DmitrySharshakov[m]So j314 might be okay without it but with sound properly confined by amp settings?
15:05DmitrySharshakov[m]I think jannau once sent us a value being set somewhere for DC blocker. that was for like 2 Hz. Have you found a new DT prop then?
15:05DmitrySharshakov[m]* set somewhere in ADT for DC
15:07marcanapple does not use the DC blocker
15:08DmitrySharshakov[m]But where have you found that new info? Is it a register value embedded into DT or just a flag like `speaker-protection = 1`?
15:09marcanit's literally speaker-protection = 1
15:09marcanbut you can also tell because the speaker config has data for bytes 2-3 per speaker, which is probably the TDM feedback slots
15:10marcanand yeah, I'm pretty sure I know where the gain is set, hold on, let me augment the adt decoder for this
15:10DmitrySharshakov[m]are they in the speaker config (like some blank space in registers from the ADT)? I believe they are not in registers at all
15:11DmitrySharshakov[m]marcan: Wasn't it decoded automatically before?
15:12marcanno? it's a binary property
15:19marcanoh wait, there is this too
15:19marcanamp-dcblocker-config = 16641
15:19marcanso I guess they *do* use the dcblocker sometimes
15:20DmitrySharshakov[m]I've previously decoded this when jannau sent it. It means IRQZ on + 2 Hz DC blocker on both playback and recording (ivsense). Basically the default values after reset
15:22marcanonly for j413 and j493, but they just set it to 2Hz globally
15:23DmitrySharshakov[m]This means they added a config to the driver but are not currently using it so keep the default
15:23DmitrySharshakov[m]Maybe future software/hardware versions would make use of it
15:25marcanpovik: https://mrcn.st/p/0T06JXXf matches the gain values you saw
15:28off^ has joined #asahi-dev
15:36kryptnd[m] has joined #asahi-dev
16:05off^ has quit [Ping timeout: 480 seconds]
16:10thelounge7571340 has joined #asahi-dev
16:16e1eph4nt has quit [Ping timeout: 480 seconds]
16:26e1eph4nt has joined #asahi-dev
16:37e1eph4nt has quit [Ping timeout: 480 seconds]
16:45e1eph4nt has joined #asahi-dev
16:54e1eph4nt has quit [Ping timeout: 480 seconds]
16:59zzywysmmarcan: i saw you closed a bunch of pull requests and said you cherry picked some commits, but i don't see any linux branches with changes in the past 24 hours. are the commits only cherrypicked to your working copy so far?
17:01thelounge7571340 has quit [Ping timeout: 480 seconds]
17:02e1eph4nt has joined #asahi-dev
17:03jannauzzywysm: bits/* branches were updated I didn't check the contents
17:08thelounge7571340 has joined #asahi-dev
17:09zzywysmjannau: most recent bits branch modification was 3 days ago, specifically bits/030-misc. is that where the cherrypicks landed?
17:10e1eph4nt has quit [Ping timeout: 480 seconds]
17:18e1eph4nt has joined #asahi-dev
17:25jannauzzywysm: the merge requests / cherry-picks landed there and everything was rebased on v6.0-rc5
17:26zzywysmis that the new master branch? the asahi branch is still based on 5.19
17:26jannauhmm, shouldn't that result in a most recent branch modification of sunday? or is github just looking at the author date of the last commit
17:27jannauthere is no new merged branch since someone decided to test/destroy speakers instead
17:28jannaurust nvme linux driver roughly the samme speed as the C driver
17:39kloenkand the NVMe driver is not async, wonder what that will do.
17:40kloenkAs soon as I have time to maybe maybe understand the Mailbox framework, I plan to look, if it would make sense writing async for that, and the port RTkit to async rust. But sadly time is always not enough
17:44marcanI didn't push the merge yet, because I haven't properly tested it yet
17:45marcankloenk: I wouldn't spend time on mailbox, there's a good chance we just stop using that subsystem altogether
17:56thelounge7571340 has quit [Remote host closed the connection]
18:02thelounge7571340 has joined #asahi-dev
18:26e1eph4nt has quit [Ping timeout: 480 seconds]
18:34sven6.0-rc5 will break Bluetooth fwiw
18:42marcanalready reverted that
18:42marcan(see that bits branch)
18:50e1eph4nt has joined #asahi-dev
19:00jannauI hope you saw the comment in devicetree pull request
19:00jannaubreaking change is already in rc4
19:01jannaub82a26d8633cc89367fac75beb3ec33061bea44a
19:02thelounge7571340 has quit [Read error: Connection reset by peer]
19:03off^ has joined #asahi-dev
19:11thelounge7571340 has joined #asahi-dev
19:23thelounge7571340 has quit [Ping timeout: 480 seconds]
19:32thelounge7571340 has joined #asahi-dev
19:59e1eph4nt has quit [Ping timeout: 480 seconds]
20:01shorneHello, I watched the youtube stream about wifi debugging, and it seems marcan found out the broadcom suspend protocol is essentially the same as the current linux driver just using ringbuffer instead of register
20:02shorneIs the code for wlan_tracer.py posted anywhere?
20:02shorneI couldn't really tell how the Ring buffer tracing worked
20:03shornei.e. is it using a apple,asc-mailbox-v4 or apple,m3-mailbox-v2 ring buffer? or something else?
20:18kloenkmarcan: oh, what will be used instead of mailbox?
20:18kloenkMailbox would make it easier to have a more generic reactor
20:22shorneyeah, I think mailbox should be used, I was just wondering which of the mailbox drivers the wlan cummunication was using
20:24j`eyshorne: kloenk was replying to a comment about not using the linux mailbox api
20:24e1eph4nt has joined #asahi-dev
20:25svenI’m not sure if a lot of rtkit gains much from being converted to rust. Possibly the crashlog thing but im
20:25sven*but I’m not so sure about the rest
20:26svenshorne: Wi-Fi doesn’t use any of the apple, mailboxes
20:28shornesven: not yet, it seems for the power suspend its using some ringbuffer (its not in the driver yet)
20:28sventhat’s not related to these apple mailboxes
20:30shornehence my question, what is the ring buffer protocol bieng used there?
20:30svenI guess just the normal Broadcom WiFi thing
20:31thelounge7571340 has quit [Read error: Connection reset by peer]
20:32shorneIn this video, around this time: https://youtu.be/BN6tvoNNy94?t=19690
20:32shornethe wlan_tracer is printing D2HMailbox and RingMessage
20:33sventhat very much sounds like the usual Broadcom ringerbuffer thing
20:33e1eph4nt has quit [Ping timeout: 480 seconds]
20:35shornesven: btw I have been reading your driver code for sart/dart/nvme
20:35shorneall very nice stuff, great work so far
20:37thelounge7571340 has joined #asahi-dev
20:39sventhanks
20:40shorneyou are right, its just the broadcom ring buffer thats being using to trigger the suspend
20:40shornethe tracer code to decode that is in the video, but not pushed anywhere yet =(
20:40thelounge7571340 has quit [Remote host closed the connection]
20:43e1eph4nt has joined #asahi-dev
20:51rpirea_ has joined #asahi-dev
20:53rpirea has quit [Read error: Connection reset by peer]
20:59thelounge7571340 has joined #asahi-dev
21:49e1eph4nt has quit [Ping timeout: 480 seconds]
21:57e1eph4nt has joined #asahi-dev
21:58thelounge7571340 has quit [Remote host closed the connection]
22:03thelounge7571340 has joined #asahi-dev
22:06e1eph4nt has quit [Ping timeout: 480 seconds]
22:13e1eph4nt has joined #asahi-dev
22:21e1eph4nt has quit [Ping timeout: 480 seconds]
22:31e1eph4nt has joined #asahi-dev
23:02thelounge7571340 has quit [Read error: Connection reset by peer]
23:05thelounge7571340 has joined #asahi-dev
23:08derzahl has joined #asahi-dev
23:39e1eph4nt has quit [Ping timeout: 480 seconds]
…