#
…

2022-03-08

00:01skoobasteeve_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
00:01skoobasteeve has joined #asahi-dev
00:02jnn is now known as jn
00:03skoobasteeve has quit []
00:04skoobasteeve has joined #asahi-dev
00:24chadmedpovik: do you know how apple handles crossover frequencies and EQing of the speaker arrays in these machines? is it DSP in CoreAudio or is there some magic sauce somewhere at a lower level?
00:24bisko has quit [Read error: Connection reset by peer]
00:59user982492 has joined #asahi-dev
01:07jnn has joined #asahi-dev
01:10jn has quit [Ping timeout: 480 seconds]
03:27PhilippvK has joined #asahi-dev
03:30phiologe has quit [Ping timeout: 480 seconds]
03:46kov has quit [Quit: Coyote finally caught me]
03:46kov has joined #asahi-dev
03:48amw has joined #asahi-dev
05:21marcan< kettenis> what I would like to do in OpenBSD is have a single stereo sample stream and be able for the amplifier codecs to pick the right channel out of that stream
05:21marcanthe different speakers need different sample streams though
05:21marcansince EQ/filtering will be involved
05:22marcanwe could do that as a stopgap if the hardware can do it, but it definitely wouldn't be the long-term solution
05:22marcanlong-term on Linux I expect userland will have to deal with this
05:31chadmedit would be nice to expose those things to userland. i find the j314s speakers just a teeny bit too boomy under whatever macos does so id like to drop out 100-200hz and 4k-6k a little bit to clear them up
05:31chadmed(without adding extra DSP into the audio chain)
05:38marcanit pretty much has to be userland; EQ in the kernel would never fly
05:39marcanI'm thinking we need a way of specifying a matrix of FIR impulses or IIR/biquad chains
05:39marcanprobably in ALSA, done with profiles in such a way that downstream software just sees it as a stereo device
05:39marcanideally it should be transparent to PA/JACK/whatever you put in front, though of course nothing stops you from bypassing it and hitting the hardware directly, or writing your own custom profile
05:48shenki has quit [Quit: leaving]
05:48marcando you know about ALSA UCM2 and card profiles?
05:48marcanlook in /usr/share/alsa for that stuff
05:48marcanwe can have e.g. card/device profiles that insert a filter to generate the streams for the individual speakers
05:48marcanand UCM2 is used for things like jack plug/unplug and switching routing
05:51marcanchances are with that and existing ALSA infra we can make all this work without too much fuss
05:51marcanbut we'd want to get such a plug-in upstreamed of course
05:51marcanas far as the kernel goes, its only job is to provide a multichannel output device with one channel per speaker
05:52chadmedyeah, i was just thinking about hooking in to something like alsaequal or this
05:53chadmedmy one thing was just that you cant guarantee itll be present on whatever distro a user picks, but that doesnt really matter too much imo. we could just put a "hey if you want your speakers to not sound crap, install this plugin" line on the wiki somewhere. plus whatever we choose to do will ship with Asahi
05:53gladiac has joined #asahi-dev
05:53marcanthis is all part of "distros have to care"
05:53marcanit's not our job to make everything magically work on every distro
05:54chadmedyeah exactly
05:54marcanbut the core distro-agnostic things we can do are 1) getting the kernel/DT stuff done, 2) try to upstream such an EQ plugin so distros pick it up, and 3) upstream the profiles/impulses
05:54marcanalternatively, provide a packageable repo with 3) and distros can package 2) and have it depend on that
05:54user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:56marcanin the end there is always going to be some level of tweaks that distros will have to do to make things smooth on these (or any) machines; our job is to make that *possible* and relatively painless, not magically happen for every distro :-)
05:56user982492 has joined #asahi-dev
05:56marcanbut that's why we have the Asahi reference distro stuff, to show people how to do it
05:57marcanpovik: what's the DT situation, btw? think we can ship something forward-looking for speaker support on most of the laptops at least, even if the kernel is in flux?
05:58marcaneither way today I'm going to work on the installer again, I want to add an "upgrade my m1n1/u-boot" option so users can at least do that easily in the future
06:00marcanI'm also getting the feeling working on chainloading sooner than I intended might be a good idea; punt on the signatures for now (not like ALARM does secureboot anyway yet), if I can just have it chainload from FAT that's already a big win
06:01marcanyou know, might just do that today, kinda feel like it
06:01marcanmight be a better use of the day than m1n1 upgrades since it supersedes that
06:01marcan(even if we still want that option eventually)
06:01marcanI really like the idea that our first release will let us improve hardware support with only a `pacman -Syu`
06:04chadmeditll be a necessity for end users at some point regardless i think. all the messages kmutil throws at you about it being able to blow your computer up and irradiate your house are scary
06:17marcanyeah, of course
06:17marcanwas just thinking of doing it later originally but.... eh, it's going to help me get a release out by agonizing less about what makes the first cut
07:44povikmarcan: we can ship something forward-looking but not 100% guaranteed it won't need to change
07:44povikmore like 90%
07:46povikhm, the 'model' string maybe needs to be more specific for UCM to match against
07:47povikalso the MCA binding changed when i added proper power domain support (needs audio_p also passed in)
07:47povikso if we are shipping new DT we need to ship at least a bit of new kernel drivers
07:48povik(audio-wise)
07:55povik has quit [Read error: Connection reset by peer]
07:55povik has joined #asahi-dev
07:56chadmedif UCM needs to match the model string, i would just add the actual model ID, so like "MacBook Pro J314/6 Integrated Audio"
07:56povikwe need to confirm UCM does that
07:58tanty has quit []
07:58poviki am inclided to ship all of the new audio stuff. in the evening if i find time i should do a pass over it, get in shape and let people test it
07:58kettenismarcan: IIRC the speaker amplifiers have some sort of programmable filter
07:59povikreally?!
07:59poviki now they get a separate sample stream at least on j314/6
07:59poviks/now/know
08:00povik(meaning that's how macos uses them)
08:00chadmedUCM uses the card name as referenced by aplay -l, so on OF platforms that should be the model string. spaces are replaced with hyphens
08:00kettenisanyway, I think sending a 4-channel (or even 6-channel) stream down to MCA should be fine as well in cases where a software equalizer is preferred
08:01kettenisbut I think it should be done as a single DMA channel; not 4 independent DMA channels
08:01kettenisotherwise properly synchronizing the channels becomes an issue I fear
08:02povikof course, would be insane to do independent channels
08:04poviki see there's some DC-blocking filter at least on the tas2764 (which i reference for speakers on j314)
08:04povikit's configurable, would be surprised if we can use that sensibly though
08:18clrwf0x80 has joined #asahi-dev
08:35the_lanetly_052__ has joined #asahi-dev
08:41clrwf0x80Hi everybody! May I have bootable image for asahi linux for m1?
08:45clrwf0x80https://github.com/AsahiLinux/asahi-installer will end up with tar czf ../installer.tar.gz .
08:46j`eyclrwf0x80: join #asahi for help
08:51tanty has joined #asahi-dev
09:18jnn is now known as jn
09:45clrwf0x80 has quit [Remote host closed the connection]
09:58user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
10:09j`eyChaosPrincess: oh right, I thought it must be you, would e strange if another person did it too :P
10:10ChaosPrincessi am at the point where it reads files from disk and checks signatures
10:22subject38[m] has joined #asahi-dev
10:24kettenispovik: looks like I misremembered it's the cs42l83 that includes an equalizer
10:46povikyeah, that makes sense
11:10chadmedpovik: ucm2 actually uses the alsa/kernel driver name from sysfs to pick a config profile, not the model string from the DT
11:12povikah, good to know
11:12povikchadmed: but here we would have multiple models covered by the same driver
11:12povikwhat then?
11:12povikeach should have a different profile, at least different crossover configuration
11:13povikdon't know if that will tie into ucm
11:15chadmedseems like ucm is able to probe the alsa driver for the actual card's name, which im guessing is what comes from the dt model string?
11:16chadmedbut it seems like it wants device major:minor type strings to match against
11:16povik ret = snd_soc_of_parse_card_name(card, "model");
11:16povikfrom macaudio.c ^^
11:16povikuh, major:minor
11:17chadmedyeah that particular way of doing it seems to rely on usb stuff so disregard
11:21chadmedtheres a function to register a long name for the card. the docs make reference to using it to grab DMI information on systems with intel hda, but the actual function seems to just take a pointer to a char, so we could just feed snd_soc_of_parse_card_name to it and see if that works i guess
11:21chadmedthe docs say it specifically exists to let UCM differentiate between devices that all use the same driver
11:22povikwhat's DMI?
11:23povik> In computing, Direct Media Interface (DMI) is Intel's proprietary link between the northbridge and southbridge on a computer motherboard.
11:23chadmedan intel interconnect
11:24poviki can't believe intel got their own function like that, instead of some generic approach to this very generic problem
11:24chadmedbut the function just takes a const char * as the long name
11:24povikright, i am all for just using that
11:24povikas you suggest
11:25povikhow is the dmi name exposed to userspace?
11:25kettenisin this case DMI means Desktop Management Interface
11:25kettenisbetter known as SMBIOS
11:26chadmedthe first argument to the function is the pointer to snd_soc_card so i guess it just attaches itself to the device in the driver
11:26kettenis(strictly speaking SMBIOS is one of the standards released by the DMI consortium)
11:27povikchadmed: yeah, but where does userspace find the dmi name?
11:27povikif you see that in the ucm code
11:27povikPossible card long names may be: DellInc.-XPS139343-01-0310JH ASUSTeKCOMPUTERINC.-T100TA-1.0-T100TA Circuitco-MinnowboardMaxD0PLATFORM-D0-MinnowBoardMAX
11:28kettenisgiven the software development quality control in the PC world, the DMI model should be seen as a random string that might bear a relationship to the actual hardware you're running on ;)
11:28povik"some degree of correlation"
11:29kettenisin other words, only use it as a last resort
11:29kettenisI currently disable the SMBIOS support in U-Boot since it assumes there is memory below the 4GB mark
11:29povikargh, i have been putting off writing ucm configuration, now it seems we might even need to touch ucm code
11:30chadmedseems to just get the long name magically
11:31povikwhoa, we are balancing on the code/configuration barrier here
11:31chadmedyeah so im saying that if it turns out the dmi name function behaves as we think it does, all we need to do is name the ucm config file the same thing as the model string in the dt
11:31chadmedand we get ucm support for free
11:32chadmedwith no changes to ucm or alsa
11:32povikunderstood, although it's kind of a hack
11:33chadmedwell i guess the "proper" way they want you to do it is have a separate ASoC driver for each device. this dmi name function seems to have been added as a hack to get around that in the first place
11:33povikno, having separate drivers is also a hack
11:33povikchanging the alsa/ucm mess, if there's indeed no other way, is the proper way
11:34povikbut i feel we don't understand it fully yet
11:34povikchadmed: do you know what ${OpenName} is?
11:34povikor is there some place i can refer to?
11:35chadmedhttps://www.alsa-project.org/alsa-doc/alsa-lib/group__ucm__conf.html <- this just refers to it as the "original ucm card name"
11:35chadmedthis is why its 2022 and still no one takes audio on linux seriously
11:36povikwhat about having an driver-specific configuration file, which then looks up a model-specific file based on ${CardName} ?
11:38chadmedyeah thats the way id do it if we can pass the name of the device to userspace
11:39chadmedwhich should just be in ${CardName}
13:13King_InuYasha has joined #asahi-dev
13:29WindowPain has joined #asahi-dev
13:38yuyichao has quit [Ping timeout: 480 seconds]
13:44riker77 has quit [Ping timeout: 480 seconds]
13:49riker77 has joined #asahi-dev
14:04yuyichao has joined #asahi-dev
14:15mazmarcan: perf stuff now queued. feel free to also merge my irq/aic-pmu branch in your tree if you need to resolve conflicts.
14:22klaus has joined #asahi-dev
14:45amarioguy has joined #asahi-dev
14:59amarioguy has quit [Ping timeout: 480 seconds]
15:00amarioguy has joined #asahi-dev
15:20Gaelan_ is now known as Gaelan
16:41amarioguy has quit [Ping timeout: 480 seconds]
17:07marcanmaz: cool, think AICv2 can go in if I respin it tomorrow? (just changing that reg entry thing)
17:07marcan(+rebase)
17:08mazmarcan: ideally, I'd like an ack from robher on the binding. if he can rubber stamp that, I'll take the series in.
17:09mazplease base it on -rc3 though. I'll take care of conflicts.
17:09mazthanks
18:47___nick___ has joined #asahi-dev
18:48___nick___ has quit []
18:49___nick___ has joined #asahi-dev
18:51Method has quit [Quit: ZNC 1.8.2+deb1+bionic2 - https://znc.in]
18:51Method has joined #asahi-dev
19:08the_lanetly_052__ has quit [Ping timeout: 480 seconds]
19:48yuyichao_ has joined #asahi-dev
19:52yuyichao has quit [Ping timeout: 480 seconds]
20:10user982492 has joined #asahi-dev
20:12gladiac has quit [Quit: k thx bye]
20:17* povikhas a 6-channel ALSA device on MBP
20:17poviki am going to make it you can open it as 2-channel or 6-channel device
20:18kettenisthat was my idea for openbsd as well
20:21povikat first i thought it would be too involved because ASoC doesn't let the machine driver selectively disable codecs
20:21povikbut then i realized i can let them be enabled, just send null samples their way
20:22poviknot optimal, but i expect most people will drive all 6 speakers anyway
20:40ketteniswhat happens if you send the same sample stream to all three speakers for a single stereo channel?
20:40povikyou mean how bad it sounds? :p
20:40povikcan't be told with speaker-test, let's see
20:41poviki think maybe the 4 channel masks can help do that
20:52povikwhy is my music sped up?!
21:03povikkettenis: i played around with it for a bit (by overlapping the TDM slots as you would probably do)
21:03povikit doesn't sound nearly as good as when apple does its thing, i would say
21:03ah-[m]wow you're getting sound via the speakers? is this m1 or m1 pro/max?
21:03povikthere's the question of gain for the individual speakers
21:03povikah-[m]: m1 pro
21:03ah-[m]awesome!
21:08user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:10kettenispovik: does it sound better than with just 2 speakers is the question though
21:18povikit sounds kind of weird when you naively combine the speakers, as if it is off somehow
21:18poviki like it best going all in on woofer 1
21:20povikyeah, i will be interested to hear how you or someone else would describe, kettenis
21:20povikbut for me woofer 1 is the way to go, out of the simple approaches
21:20poviks/would describe/would describe it/
21:25kettenisI've parked the audio driver stuff for OpenBSD for now since I've been working on getting the m1 pro/max working and improving the OpenBSD installer a bit
21:32jannausigh, chainloading m1n1 breaks dcp. it crashes immediately after starting it
21:46jannaulinux crash is a different problem
22:08user982492 has joined #asahi-dev
22:25will[m]12 has joined #asahi-dev
22:30will1[m] has joined #asahi-dev
22:37user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:51alyssa has joined #asahi-dev
22:51alyssajannau: re dcp breaking with t6000 m1n1 stuff
22:51alyssaat risk of asking the obvious, is m1n1 doing its own dcp init code?
22:52alyssa(the 12.x path marcan added)
22:58crabbedhaloablut has quit []
22:58crabbedhaloablut has joined #asahi-dev
23:00crabbedhaloablut has quit []
23:00crabbedhaloablut has joined #asahi-dev
23:01yuyichao_ has quit [Ping timeout: 480 seconds]
23:20yuyichao_ has joined #asahi-dev
23:25amarioguy has joined #asahi-dev
23:25user982492 has joined #asahi-dev
23:37amarioguy has quit [Ping timeout: 480 seconds]
23:51amarioguy has joined #asahi-dev
…