ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
Method has joined #asahi-dev
ntl has joined #asahi-dev
ntl is now known as NathanLadd
NathanLadd has quit [Remote host closed the connection]
cylm_ has quit [Ping timeout: 480 seconds]
___nick___ has joined #asahi-dev
___nick___ has quit []
___nick___ has joined #asahi-dev
rootbeerdan has quit [Quit: rootbeerdan]
gabuscus has quit []
jeisom has quit [Quit: Leaving]
gabuscus has joined #asahi-dev
utsweetyfish has quit [Remote host closed the connection]
utsweetyfish has joined #asahi-dev
ciara has joined #asahi-dev
ciara has quit [Read error: Connection reset by peer]
utsweetyfish has quit [Remote host closed the connection]
utsweetyfish has joined #asahi-dev
ciara has quit [Quit: Leaving]
crabbedhaloablut has joined #asahi-dev
bisko has quit [Ping timeout: 480 seconds]
ciara has joined #asahi-dev
NathanLadd has joined #asahi-dev
ciara has quit [Read error: Connection reset by peer]
utsweetyfish has quit [Remote host closed the connection]
ciara has joined #asahi-dev
utsweetyfish has joined #asahi-dev
NathanLadd has quit [Ping timeout: 480 seconds]
utsweetyfish has quit [Remote host closed the connection]
utsweetyfish has joined #asahi-dev
NathanLadd has joined #asahi-dev
spuos has quit [Remote host closed the connection]
NathanLadd has quit [Ping timeout: 480 seconds]
psykose has quit [Remote host closed the connection]
psykose has joined #asahi-dev
utsweetyfish has quit [Remote host closed the connection]
utsweetyfish has joined #asahi-dev
novafacing99 has quit [Ping timeout: 480 seconds]
cylm_ has joined #asahi-dev
utsweetyfish has quit [Remote host closed the connection]
utsweetyfish has joined #asahi-dev
ellyq has quit [Read error: No route to host]
timokrgr has quit [Quit: User left the chat]
timokrgr has joined #asahi-dev
jacksonchen666 has quit [Quit: WeeChat 3.8]
eiln has joined #asahi-dev
<eiln>
jannau: I'll build on the sio-loader branch for now
leitao has joined #asahi-dev
nst has quit [Quit: WeeChat 3.8]
<povik>
haven't we merged that yet?
<povik>
no we haven't
<eiln>
I'll just patch adt to match the sio struct. I have to add another range for the firmware heap anyway
nst has joined #asahi-dev
<chadmed>
ok so final piece of the puzzle for the speakers is going to be _somehow_ convincing pipewire to tie the volume knob of a sink to a parameter in a filter chain
<chadmed>
pipewire filter graphs can change their parameters at runtime
<chadmed>
but it currently has to be done manually
<chadmed>
if we can make pipewire present the volume knob of the lsp equal loudness plugin as _the_ volume then we're home free
<chadmed>
that popping noise is back and i think its just a limitation of the codecs that we have to work around by making the speakers sound good at full volume and then using the equal loudness plugin to maintain a consistent profile when the user turns the volume down
<chadmed>
so close to greatness...
dsharshakov has joined #asahi-dev
<dsharshakov>
chadmed: could you please open a new issue for that? It'd be more convenient to discuss implementation details there
<dsharshakov>
that should go to pipewire/pipewire, not WP
nst has quit [Ping timeout: 480 seconds]
nst has joined #asahi-dev
dsharshakov has quit [Quit: Page closed]
jeisom has joined #asahi-dev
<povik>
chadmed: elaborate on the popping noise, i don't understand
<chadmed>
povik: its not overexcursion, it sounds almost like clipping artefacts but the signal is nowhere near being saturated
<chadmed>
its ~the same pop/click that is audible when you abrubptly mute/pause a stream sometimes, but much louder
<povik>
hm, no faults reported from the codec? (in dmesg)
<chadmed>
nope
<povik>
how does making it sound good at full volume work around the clicks if we don't know what causes them?
jeisom has quit [Quit: Leaving]
<povik>
fwiw apple configures some undocumented registers on the codec, we don't know to what end
<povik>
in the ivsense branches the linux driver can mimick the apple quirks
<povik>
it's controlled with a bitmask in an `apple_quirks` parameter on the tas2764 module
<povik>
you either need to supply it at boot, or you can change it at runtime then use the reset_codecs.sh script from macaudio-userutils
<povik>
might be worth the try playing around with that
<chadmed>
povik: we tune at full volume such that the clicks do not happen (this is possible ive already tried it) then use the equal loudness plugin to keep that sonic profile across the volume range
<chadmed>
i mocked this up in carla so i know it can be done, and is what youd usually do. everything ive been doing lately has been desperately trying to work around this because we cant control the loudness compensator at runtime
<povik>
i would understand if the popping noise was introduced in some processing stage that you would work around it by rearranging the graph
<povik>
but if the popping is introduced in the codecs what can you do in the processing to work around it?
<chadmed>
what im doing atm is driving the bass "enhancement" harder than it neds to be driven so that it sounds right at normal volumes
<chadmed>
which is why im pretty sure its just digital clipping inside the codecs once the volume going in goes up past a certain amount
<chadmed>
if i tune the graph (bass enhancement, compressor, etc) for sounding "right" at max volume then none of this matters
<povik>
ah i see
<chadmed>
we avoid clipping by simply making it impossible at max volume
<chadmed>
the part im kind of at a loss to explain is that if i push the volume *past* where this noise becomes audible, it goes away for a bit until i push hard enough to get overexcursion
<chadmed>
that might just be the compressor not being quite right though
<povik>
so if you tune it to sound "right" at max volume, the bass would be attenuated at normal volumes?
<povik>
so it would sound off?
<chadmed>
yeah, without equal loudness compensation you get aggressive rolloff in the bass and treble
<chadmed>
so all you get is honky mids
<chadmed>
bit of an unfortunate double-whammy with where the human ear's sensitivity peaks and how these speakers behave
<povik>
ok, but if you introduce the equal loudness compensation, wouldn't you effectively get what you started out with, that caused the clipping noise?
<chadmed>
no because the equal loudness compensation would do nothing at max volume, and then do its compensation as we turn the volume down
<chadmed>
it never actually boosts anything, it only attenuates
<chadmed>
it just pulls the mids down faster than it does treble and bass, based on iso 226:2003 curves
<chadmed>
so nothing will ever be boosted relative to whatever we specify at max volume
<povik>
so the change here is that you don't enhance the basses as hard at max volume, if you tune it differently and introduce the equal loudness compensation, is that right?
<chadmed>
yeah thats the idea
<chadmed>
like i said ive mocked this up in carla and it all works
<chadmed>
in fact it was one of the first things i did under the assumption that the loudness compensator could be controlled from pipewire
jeisom has joined #asahi-dev
<povik>
ok, now i get it :)
<chadmed>
yeah sorry its hard to really explain unless youre actually in front of the thing and can hear whats going on
<povik>
no worries
<chadmed>
doesnt help that using loudness compensation like this is not the "traditional" way youd use it :P
<chadmed>
but its what apple does and seemingly every other microspeaker engineer on earth now so *shrug*
c10l has quit [Ping timeout: 480 seconds]
c10l has joined #asahi-dev
<eiln>
on a vaguely related note, apple does some post-processing on the frames
<eiln>
beyond the normal exposure/saturation stuff, I notice skin tones are brightened
<eiln>
independent from face detection, that's for the heart halo filterr heh
<eiln>
I doubt I'll have the time for it. if anyone wants to look at it, please do
<povik>
you don't get fully processed frames from isp?
ciara has quit [Read error: No route to host]
ciara has joined #asahi-dev
jeisom has quit [Quit: Leaving]
<eiln>
povik: filters are identical as macos. it still looks good, but I guess that wasn't enough for them
bisko has joined #asahi-dev
jeisom has joined #asahi-dev
jeisom has quit [Ping timeout: 480 seconds]
<marcan>
eiln: no need for that, software postpro is out of scope for the driver and kinda overkill right now (unlike the speakers where you really really really need DSP for it to be usable at all)
<marcan>
if someone is bored I'm sure there's fun stuff to be done with PipeWire, but it's completely optional
NathanLadd has joined #asahi-dev
iyes has joined #asahi-dev
NathanLadd has quit []
Z750 has quit [Quit: Ping timeout (120 seconds)]
Z750 has joined #asahi-dev
Z750 has quit []
Z750 has joined #asahi-dev
Z750 has quit [Quit: Ping timeout (120 seconds)]
Z750 has joined #asahi-dev
cylm_ has quit [Ping timeout: 480 seconds]
iyes has quit [Quit: This computer has gone to sleep]
rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
Guest8625 has quit [Quit: Bridge terminating on SIGTERM]
Jamie has joined #asahi-dev
Jamie is now known as Guest8880
rhysmdnz has joined #asahi-dev
MortimerHoughton has joined #asahi-dev
iyes has joined #asahi-dev
MortimerHoughton has quit [Quit: leaving]
dsharshakov has joined #asahi-dev
iyes has quit [Quit: This computer has gone to sleep]
<dsharshakov>
chadmed: :bell: you've got a message in #pipewire. Is it possible to use mb_compressor_mono in place of stereo one because stereo doesn't have separate channel volumes? If so, won't it hog performance a lot bc of extra plugin instance?
<dsharshakov>
re PipeWire and ISP: if any processing suitable for userspace is necessary, feel free to play around with libcamera. However, if ISP's model can be integrated into v4l2, there should be at least minimal function set with v4l2
<dsharshakov>
with libcamera you can integrate a webcam with your own kernel interface into PW. The problem why it's not the sole method is that not all apps work fine with v4l2 - pw adapter lib
dsharshakov has quit [Quit: Page closed]
midou has quit [Ping timeout: 480 seconds]
<eiln>
dsharshakov: thank you, will look into it
iyes has joined #asahi-dev
iyes has quit []
midou has joined #asahi-dev
ciara has quit [Read error: Connection reset by peer]
ciara has joined #asahi-dev
leitao has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ntl has joined #asahi-dev
ntl is now known as NathanLadd
dsharshakov has joined #asahi-dev
<dsharshakov>
eiln: did you manage to solve the multiple-buffer issue? If so, you likely don't really need libcamera path as v4l2 works fine. Probably ISP does most stuff itself and driver doesn't have to do any processing thus kernel-only impl is fine
ciara has quit [Read error: Connection reset by peer]
ciara has joined #asahi-dev
sam_ is now known as Guest8894
Guest8894 has quit [Remote host closed the connection]
sam_ has joined #asahi-dev
<eiln>
dsharshakov: I did figure it out, thanks to everyone here, but I actually bruteforced CISP_CMD_CH_BUFFER_POOL_CONFIG_GET to disable that (now I'm really sorry for that wall of text, whoops). the new permutation of config vals also lets me send the (required per-frame) meta buffer with the frames, so that's half the number of irqs needed & ensures frames are never dropped bc the
<eiln>
frame/meta count is off. I believe macos' weird batching scheme was bc of the face detection prediction mask, which effs up the cadence.
<dsharshakov>
well, likely you'll manage to do it without complex kernel-userspace pairing with libcamera. V4L2 is better is terms of compatibility and versatility right now
roxfan has joined #asahi-dev
ciara has quit [Read error: Connection reset by peer]
dsharshakov has quit [Quit: Page closed]
WindowPa- has joined #asahi-dev
<eiln>
** we can still send batches (1 <= n <= 16), more efficent obv
WindowPain has quit [Ping timeout: 480 seconds]
eiln has quit [Quit: WeeChat 4.0.3]
jeisom has joined #asahi-dev
___nick___ has quit [Ping timeout: 480 seconds]
crabbedhaloablut has quit []
ciara has joined #asahi-dev
chadmed has quit [Remote host closed the connection]
NathanLadd has quit [Ping timeout: 480 seconds]
NathanLadd has joined #asahi-dev
pthariensflame has joined #asahi-dev
pthariensflame has quit []
darkapex has quit [Remote host closed the connection]
darkapex has joined #asahi-dev
cy8aer has joined #asahi-dev
ourdumbfuture_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]