#asahi-dev · 2022-11-23 07:29
dsharshakovWell, fpu stuff is hard for kernel, yea#asahi-dev · 2022-11-23 07:28
dsharshakovWell, less things that could break, bug out or be mishandled by users#asahi-dev · 2022-11-23 07:28
chadmedthe actual V/I by themselves arent useful#asahi-dev · 2022-11-23 07:28
chadmedwhats important to prevent meltdown is the temperature of the coils and magnets, and to derive that from V/I we need a bunch of floating point maths#asahi-dev · 2022-11-23 07:28
chadmedyeah but simpler is not better in this case#asahi-dev · 2022-11-23 07:28
dsharshakovWell, simpler and feels safer than a daemon monitored by a watchdog#asahi-dev · 2022-11-23 07:26
chadmedalso why bother with a semi-hacky kernel gaffer tape solution when we _know_ what we need to do to implement it properly and can do so with much more freedom in userspace? #asahi-dev · 2022-11-23 07:25
chadmedsomething something floating point i think idk#asahi-dev · 2022-11-23 07:25
dsharshakovYes, but why not a simple averaging thing for vi in kernel?#asahi-dev · 2022-11-23 07:24
chadmedthe other thing is having safety stuff outside of any particular audio server means itll work for everyone using bare alsa, pulse, etc#asahi-dev · 2022-11-23 07:24
dsharshakovOh btw wanted to ask povik to add a panic handler turning safety mute on just in case. At least on PC systems hang can keep the audio playing#asahi-dev · 2022-11-23 07:24
chadmedwe already have that, the amps cut out on certain failure conditions and theyve been programmed to bring themselves back up after doing so #asahi-dev · 2022-11-23 07:23
dsharshakovYup. And why not a kernel based alarm system for emergency shutdown?#asahi-dev · 2022-11-23 07:22
chadmedbut at the same time that really does sound like good long term goal... #asahi-dev · 2022-11-23 07:22
chadmedon one hand implementing that in pipewire is probably going to be nightmarish since it has to keep track of _all_ the mixer controls and stuff and then that would need to be generalised for all similar devices with some new system/format for safety rules#asahi-dev · 2022-11-23 07:21
chadmednope, which im ambivalent about#asahi-dev · 2022-11-23 07:21
dsharshakovThat simple? No need to handle VI sense in PW to avoid approaching limits using DSP?#asahi-dev · 2022-11-23 07:21
chadmedand simply lowering the max volume to fix it is stupid because you lose a boatload of headroom and make the whole thing quieter when really you just want certain frequencies quieter for tiny fractions of a second at a time#asahi-dev · 2022-11-23 07:20
chadmedso we dont need to worry about it from a DSP perspective, the compressor is there because the cones flapping against the chassis is not a meltdown problem, its a physical constraint problem#asahi-dev · 2022-11-23 07:20
chadmedsupposedly a userspace daemon monitoring the V/ISENSEs of the speaker amps that will talk directly to alsa and cut the volumes in alsamixer dynamically to prevent meltdown#asahi-dev · 2022-11-23 07:16
dsharshakovWhats up on safety research btw? Will it live in kernel or a daemon monitored by it?#asahi-dev · 2022-11-23 07:16
dsharshakovSure, disclaimer WP isn't a safety software!!!#asahi-dev · 2022-11-23 07:13
chadmedso all we need out of wireplumber is hiding the "real" device and loading the filter chain automatically a la UCM#asahi-dev · 2022-11-23 07:13
chadmedyep, safety et al will be handled elsewhere either in the DSP chain or as an external thing that talks directly to alsa#asahi-dev · 2022-11-23 07:12
dsharshakovOkay, so my task is limited to loading filter chain for now?#asahi-dev · 2022-11-23 07:12
chadmedi.e. linking the volume control to the volume knob on the equal loudness plugin #asahi-dev · 2022-11-23 07:11
chadmedyeah that problem is all fixed, the final frontier now is just tying the volume control to a port on a plugin in the chain #asahi-dev · 2022-11-23 07:11
dsharshakovSo you managed to make woofers not touch the lower case?#asahi-dev · 2022-11-23 07:07
chadmedactually we might want the equal loudness plugin to work properly at some point#asahi-dev · 2022-11-23 07:06
chadmedthere are none at the moment actually, i figured out how to integrate the compressor in a sane way#asahi-dev · 2022-11-23 07:05
dsharshakovchadmed: could you please discuss new audio requirements in PipeWire IRC room? Not urgent#asahi-dev · 2022-11-23 04:10
cyrozapMMIO registers) that the code ROM would have done, so having the code ROM do that too is redundant.#asahi-dev · 2022-11-23 04:10
cyrozapThis write (https://github.com/AsahiLinux/linux/blob/602fee88eb0603f4d7576797397aff6b33b41765/drivers/usb/host/xhci-pci-asmedia.c#L233-L234) halts the CPU (I think by holding it in reset), so anything the code ROM does is just going to get thrown away when that write happens. And when it comes out of reset executing from code RAM, the loaded firmware will do the same init stuff (clearing/initializing #asahi-dev · 2022-11-23 04:05
cyrozapbtw, I don't think you need to do the reset to code ROM here at all: https://github.com/AsahiLinux/linux/blob/602fee88eb0603f4d7576797397aff6b33b41765/drivers/usb/host/xhci-pci-asmedia.c#L222-L230#asahi-dev · 2022-11-23 04:03
cyrozapI think I'm going to try some stuff myself on an ASM3142 I have here, and report back with my findings.#asahi-dev · 2022-11-23 03:58
cyrozapI wrote a bunch of stuff, but then realized it didn't apply :P#asahi-dev · 2022-11-23 03:57
cyrozapActually, never mind.#asahi-dev · 2022-11-23 03:46
cyrozapOh, and one more thing:#asahi-dev · 2022-11-23 03:43
cyrozapAnd to be clear, those sleep values were obtained by experimentation and I just set them to "good enough to work reliably but not too slow", so you might want to experiment to see if you can get away with smaller delays.#asahi-dev · 2022-11-23 03:42
cyrozapmuch issues (though I do remember adding the sleeps for the indirect MMIO writes), but C kernel code writing to PCI MMIO may simply be writing all the registers too fast for the chips internal busses to keep up.#asahi-dev · 2022-11-23 03:41
cyrozapmarcan: Regarding instability, thinking again about what I needed to do to get direct firmware loading working on the older chips, I think you might need to confirm the writes to the address registers for both the indirect code RAM writes and the indirect MMIO writes. And yes, you might also need the sleeps, too. My Python code using PCI config space accesses is slow enough that I didn't experience #asahi-dev · 2022-11-23 03:19
cyrozaphave someone decap and image both the 2142 and the 3142 so we can confirm if they really are the same die, and check the mask revision numbers to confirm what changed.#asahi-dev · 2022-11-23 03:18
cyrozapthey support the same speeds on both USB and PCIe. Since ASMedia no longer lists the 2142 on their website, and the 2142 and 3142 have different chip version numbers (which you can access by doing an indirect read to byte 0x150B2), I'm pretty sure they just fixed something in the silicon and called it a new chip to avoid having to explain multiple 2142 revisions to their customers. I hope to eventually #asahi-dev · 2022-11-23 03:18
cyrozapAccording to the product pages (https://web.archive.org/web/20181003174332/http://www.asmedia.com.tw/eng/e_show_products.php?cate_index=175&item=178 and https://web.archive.org/web/20181003174337/http://www.asmedia.com.tw/eng/e_show_products.php?cate_index=175&item=179), compared to the 2142, the 3142 supports "Multiple INs"--I don't know enough about USB to understand what that means. Other than that, #asahi-dev · 2022-11-23 03:06
marcancould be a product differentiation thing#asahi-dev · 2022-11-23 03:06
marcan(IIRC 3142 has higher speed USB support?)#asahi-dev · 2022-11-23 03:06
marcanas in you can turn a 2142 into a 3142#asahi-dev · 2022-11-23 03:06
marcanI think some people said they are the same chip, and the firmware is the only difference#asahi-dev · 2022-11-23 03:05
cyrozapAnd yes, you might need to confirm the writes.#asahi-dev · 2022-11-23 03:05
cyrozapIf you do use the public part number, I'd use 2142 instead of 3142, since as far as I can tell the 3142 is just a newer die revision of the 2142. No idea what the _actual_ differences are, but they both use the same firmware images and have identical mask ROMs.