#
✕ nick:DmitrySharshakov[m]
#asahi-dev · 2022-08-19 12:14
DmitrySharshakov[m]povik: chadmed: https://tpaste.us/vyzo I guess this should work with MR 412 config style as of now. Put it somewhere for WP to find in the same order as `src/config/policy.lua.d/51-dsp-config.lua` (at least for in-tree). Keep in mind this is completely untested and I just reformatted the config with the best effort. Please be careful while testing
#asahi-dev · 2022-08-19 11:25
DmitrySharshakov[m]povik: I think the kernel driver should fetch machine name and set device name to, say `MacBook J314 Internal Speakers` not J314/6 which doesn't help to detect whether we need J314 or J316 filters.
#asahi-dev · 2022-08-19 10:57
DmitrySharshakov[m]Awesome, will implement a new-style config for it
#asahi-dev · 2022-08-19 10:54
DmitrySharshakov[m]Pls drop dump by here
#asahi-dev · 2022-08-19 10:53
DmitrySharshakov[m]Join us on IRC at #pipewire on OFTC. -- it is
#asahi-dev · 2022-08-19 10:53
DmitrySharshakov[m]I guess so
#asahi-dev · 2022-08-19 10:52
DmitrySharshakov[m]Won't you mind if we continue discussing selectors on PipeWire Matrix channel, as this is not directly related to Asahi Linux? Let's keep audio messages here to stuff like pw-dump and a config example I'll write on it
#asahi-dev · 2022-08-19 10:51
DmitrySharshakov[m]For a typical ALSA node these properties can be considered being important for identification: alsa.driver_name, alsa.id, alsa.long_card_name, alsa.name, alsa.subdevice_name, api.alsa.card.longname (especially if a specific device like laptop is being looked for), api.alsa.path, node.description, node.name, node.nick (the only truly identifying thing for HDMI audio devices)
#asahi-dev · 2022-08-19 10:47
DmitrySharshakov[m]So maybe we'd be better with a more versatile and flexible selector mechanism, which will only improve maintainability
#asahi-dev · 2022-08-19 10:46
DmitrySharshakov[m]But I'm not sure if searching through, say, 1000 configurations for audio devices each time one is plugged in should be a real trouble.
#asahi-dev · 2022-08-19 10:44
DmitrySharshakov[m]povik: It can with some extra C APIs
#asahi-dev · 2022-08-19 10:44
DmitrySharshakov[m]chadmed: It could be great if we implement a way to serialize names like this. So yes, for higher efficiency we could create such a structure
#asahi-dev · 2022-08-19 10:40
DmitrySharshakov[m]Well, for now I search for nodes by a custom interest descriptor. Config can bind to either node name, node nickname (aka user-readable name), node name + device path
#asahi-dev · 2022-08-19 10:38
DmitrySharshakov[m]`/usr/share/pipewire/devices/${device_id}` seems great, well essentially the same since you cannot easily have a simple device ID (it might be necessary to filter by address, nickname etc, not a VID/PID pair). So I guess it would be hard to avoid searching the config in memory
#asahi-dev · 2022-08-19 10:38
DmitrySharshakov[m]<chadmed> "the problem of doing it seamless..." <- "scripts like this" - if you mean policy script, it should fly into upstream WP and just be a part of its code. To add a device you add a config like I described in testing section, which is essentially just a serialized object, not any program.
#asahi-dev · 2022-08-19 10:34
DmitrySharshakov[m]And yes, I also added `"device.api":"dsp"` and `"node.virtual":false` props. They're necessary for node to look like a hardware node to PA clients, since some are quite picky like Plasma applet
#asahi-dev · 2022-08-19 10:33
DmitrySharshakov[m]I might have misunderstood the problem you need to solve - if so, I'd like to know and improve stuff :)
#asahi-dev · 2022-08-19 10:32
DmitrySharshakov[m]What kind of a long-term problem exists? This solves both discovery issue and ones related to exposing nodes (this config can hide underlying ALSA devices as good that no app other than wireplumber could even think there's something special going on, just a stereo sink)
#asahi-dev · 2022-08-19 10:30
DmitrySharshakov[m]chadmed: That is a universal format of config, you can have a lot of them and they won't bind to unknown hardware. This should be upstreamable (you just store a ton of those configs in a special dir and WP takes care of loading them as they are needed)
#asahi-dev · 2022-08-19 10:29
DmitrySharshakov[m]chadmed: Precisely this. It can (optionally) also check props of device node belongs to, in case that's important. I'll write a testing j314 config when povik (or you) sends me pw-dump
#asahi-dev · 2022-08-19 10:28
DmitrySharshakov[m]So we just put a similar file in /usr/share/.../policy.lua.d/51-macaudio.lua and those rules get imported
#asahi-dev · 2022-08-19 10:27
DmitrySharshakov[m]chadmed: No. Those are not scripts but generic WirePlumber configs
#asahi-dev · 2022-08-19 10:27
DmitrySharshakov[m]There're rules it uses to bind to nodes based on their and parent devices' properties. Then profile might be switched and filter chain loads (another rule added by such a config hides streams from user)
#asahi-dev · 2022-08-19 10:25
DmitrySharshakov[m]see details under testing section
#asahi-dev · 2022-08-19 10:08
DmitrySharshakov[m]Ah, I've seen a piece of info about some secure disable FPGA which gates the mic access away from SoC. Is MCA something like an I2S port for passing sound data to codec?
#asahi-dev · 2022-08-19 10:03
DmitrySharshakov[m]povik: That's alright, no need to hurry. Thanks!
#asahi-dev · 2022-08-19 10:03
DmitrySharshakov[m]povik: Isn't `admac` driver for capturing from it as a part of its functions? What's the roadblocker for internal mic and how is it wired up inside?
#asahi-dev · 2022-08-19 10:01
DmitrySharshakov[m]povik: Yes, you can change those detection preferences later as the driver changes, it's just for me to prepare stuff for you to test
#asahi-dev · 2022-08-19 10:00
DmitrySharshakov[m]povik: IIRC `s` suffix is M1 Pro and `c` suffix is M1 Max version
#asahi-dev · 2022-08-19 09:58
DmitrySharshakov[m]But whole paste of it could be decent as well
#asahi-dev · 2022-08-19 09:58
DmitrySharshakov[m]Essentially I need pw-dump info for speakers and mics (are they supported with WIP drivers?) locations i.e. how are they labeled by PipeWire's ALSA plugin
#asahi-dev · 2022-08-19 09:56
DmitrySharshakov[m]unrelated question: why aren't there any Apple Silicon hardware info dumps on something like linux-hardware.org? I guess such things should get published for acknowledging people on how is all the stuff exposed to software
#asahi-dev · 2022-08-19 09:53
DmitrySharshakov[m]and I guess I'll also need pw-dump for it (can be done on any PW version)
#asahi-dev · 2022-08-19 09:53
DmitrySharshakov[m]awesome :) then it's suitable for testing, let's start with kernel amp settings for protection and then set something up. I could do a draft of config based on asahi-audio repo files and send to you to test. What's your laptop model?
#asahi-dev · 2022-08-19 09:49
DmitrySharshakov[m]Great! Do you also have a mpb with 6-way sound (software crossover necessary)?
#asahi-dev · 2022-08-19 09:45
DmitrySharshakov[m]I want to get a review from usage in a real case. If necessary, I can help adapting existing configs to be loaded by my policy module
#asahi-dev · 2022-08-19 09:44
DmitrySharshakov[m]note 2: ping me when you check out amps HPF
#asahi-dev · 2022-08-19 09:44
DmitrySharshakov[m]note 1: you might need git-compiled PipeWire, at least if you unload the DSP chain
#asahi-dev · 2022-08-19 09:44
DmitrySharshakov[m]povik: I think my WirePlumber MR for supporting complex audio is now a PoC: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/412 . It's still not reviewable for upstreaming as might integrate poorly with other policies, but I'd like to see some design review from you and chadmed as people who have came up with the concept.
#asahi-dev · 2022-08-16 11:17
DmitrySharshakov[m]Volume optimization stuff will come later as it's even less noticeable for users (if noticeable at all). I only have some assumptions that efficiency, dynamic range and quality might have some improvements when volume changes are being sent to the amp hardware. So, for now task #1 for me is to do convenience + config things and only after that experiment with HW volume
#asahi-dev · 2022-08-16 11:17
DmitrySharshakov[m]Today I might be ready with sort of `dsp-monitor` which discovers nodes that require DSP and applies rules. Also that'd be the start for the config file structure and format
#asahi-dev · 2022-08-16 11:13
DmitrySharshakov[m]WirePlumber never works with ALSA libraries, so I'm talking about PipeWire abstraction of hardware volume. However I might need to dig deeper
#asahi-dev · 2022-08-16 11:12
DmitrySharshakov[m]AFAIK in case of current macaudio setup it's a Pro Audio with 6 channels
#asahi-dev · 2022-08-16 11:12
DmitrySharshakov[m]povik: Hmm, I mean passing it to ALSA node in PipeWire
#asahi-dev · 2022-08-16 09:32
DmitrySharshakov[m]<chadmed> "the driver exposes a human..." <- Thanks, that means we can find the node by an object manager interest with a constraint like `Constraint { "node.nick", "=", "J314" }`! That's great
#asahi-dev · 2022-08-16 09:31
DmitrySharshakov[m]beneficial compared to software sound attenuation or earlier stages
#asahi-dev · 2022-08-16 09:31
DmitrySharshakov[m]Also that custom config might (later, when I do design this) provide a function which takes 2 numbers and returns 6 of them to implement volume passthrough. So if user sets volume to the virtual sink, WirePlumber receives the evant, it's passed to a configured function which tells us how is L/R volume mapped to all of the 6 channels configured and then sent to ALSA node for the driver to feed volume into hardware, which should be
#asahi-dev · 2022-08-16 09:28
DmitrySharshakov[m]chadmed: Well, yes. I'm implementing a core WirePlumber logic and then a formatted config file is placed into `/usr/share/wireplumber/dsp.d/apple/j314x.lua` as a file containing a call to a function like `registerDSP({...filter-chain props...}, { "node.nick", "=", "J314" }) (which catches the device name from ALSA), and maybe some more configs like whether or not Pro Audio mode should be enabled.
#asahi-dev · 2022-08-16 09:25
DmitrySharshakov[m]chadmed: Yes, so how are `macaudio` ALSA devices labeled currently
#asahi-dev · 2022-08-16 09:24
DmitrySharshakov[m]povik: Precisely this. DSP configs can then be shipped in generic distro packages without problems of them working where they shouldn't

plus ›