Page MenuHomeFreeBSD
Feed Advanced Search

Oct 18 2024

christos committed rG97570db05ced: sound: Move root feeder initialization to separate function (authored by christos).
sound: Move root feeder initialization to separate function
Oct 18 2024, 8:45 AM
christos committed rG0a0301deb5b6: sound: Move global variable initialization to sound_modevent() (authored by christos).
sound: Move global variable initialization to sound_modevent()
Oct 18 2024, 8:45 AM
christos closed D46844: sound: Do not cast return value of malloc(9).
Oct 18 2024, 8:45 AM
christos committed rG41ff41776145: sound: Fix indendation in sound_modevent() switch statement (authored by christos).
sound: Fix indendation in sound_modevent() switch statement
Oct 18 2024, 8:45 AM
christos closed D46836: sound: Shorten channel names.
Oct 18 2024, 8:45 AM
christos closed D46834: sound: Remove useless newspd check in sysctl_dev_pcm_vchanrate().
Oct 18 2024, 8:45 AM
christos closed D46835: sound: Simplify channel creation and deletion process.
Oct 18 2024, 8:45 AM
christos committed rGad4c8671bdda: sound: Use unr(9) to produce unique channel unit numbers (authored by christos).
sound: Use unr(9) to produce unique channel unit numbers
Oct 18 2024, 8:45 AM
christos closed D46833: sound: Simplify vchan_create() error paths.
Oct 18 2024, 8:45 AM
christos committed rG142aca25b07c: sound: Sort channels by unit number as well (authored by christos).
sound: Sort channels by unit number as well
Oct 18 2024, 8:45 AM
christos closed D46522: sound: Retire SND_MAXHWCHAN.
Oct 18 2024, 8:45 AM
christos closed D46715: snd_dummy: Drain callout during detach.
Oct 18 2024, 8:45 AM
christos closed D46821: sound: Move root feeder initialization to separate function.
Oct 18 2024, 8:45 AM
christos committed rGb973a14d354f: sound: Simplify pcm_chnalloc() and fix infinite loop bug (authored by christos).
sound: Simplify pcm_chnalloc() and fix infinite loop bug
Oct 18 2024, 8:45 AM
christos closed D46749: sound: Move global variable initialization to sound_modevent().
Oct 18 2024, 8:45 AM
christos committed rGde8ee333388b: sound: Get rid of pnum and max variables in chn_init() (authored by christos).
sound: Get rid of pnum and max variables in chn_init()
Oct 18 2024, 8:45 AM
christos closed D46856: sound: Fix indendation in sound_modevent() switch statement.
Oct 18 2024, 8:45 AM
christos committed rG998de46c5145: sound: Remove KASSERT from vchan_setnew() (authored by christos).
sound: Remove KASSERT from vchan_setnew()
Oct 18 2024, 8:45 AM
christos closed D46680: sound: Use unr(9) to produce unique channel unit numbers.
Oct 18 2024, 8:45 AM
christos closed D46549: sound: Sort channels by unit number as well.
Oct 18 2024, 8:45 AM
christos closed D46548: sound: Simplify pcm_chnalloc() and fix infinite loop bug.
Oct 18 2024, 8:45 AM
christos closed D46521: sound: Get rid of pnum and max variables in chn_init().
Oct 18 2024, 8:45 AM
christos closed D46545: sound: Remove KASSERT from vchan_setnew().
Oct 18 2024, 8:45 AM

Oct 17 2024

christos added a comment to D45982: snd_hdsp*: Free up channel resources in case of CHANNEL_INIT() failure.

While testing with snd_hdspe I ran into the following warning, but I can't really make sense of it:

Jul 21 17:36:14 current kernel: uma_zalloc_debug: zone "malloc-16384" with the following non-sleepable locks
held:

This is a consequence of the fact that sndstat_read() works by allocating an sbuf, which may grow as data is added, then copying out the resulting buffer via uiomove().

In general, blocking memory allocations are not permitted while holding a mtx(9) mutex, hence the warning. To work around this, one would typically add a "drain" callback function to the sbuf, that it calls to write out data once the buffer is full. In this case, the callback would write out buffered data via uiomove(), after which the buffer can be reused and thus doesn't need to grow. See sbuf_set_drain(9).

I will take care of this. Thanks.

Thinking about this again, my suggestion won't work since uiomove() also can't be called with a mutex held. (It's possible for copyout() to take a page fault, and the page fault handler may sleep.)

One other approach is to build the output twice, the first time is used to get the length of the output, without writing to the buffer. Then one allocates the buffer using the provided size, and then actually fills it.

Oct 17 2024, 4:08 PM
christos abandoned D46520: sound: Retire SND_MAXVCHANS.
Oct 17 2024, 3:24 PM
christos requested review of D47167: onyx: Remove unreachable if condition.
Oct 17 2024, 2:41 PM
christos requested review of D47166: snd_hda: Identify NVIDIA GM204.
Oct 17 2024, 2:36 PM
christos requested review of D47165: audio/sound-juicer: Update to 3.40.0.
Oct 17 2024, 1:58 PM
christos updated the diff for D46700: sound: Introduce global driver lock.

After discussion with markj@, keep PCM_GIANT_* and just use the new
SND_LOCK for uses of devclass_get_maxunit() and where needed, global variable
setting in sysctl handlers.

Oct 17 2024, 1:42 PM
christos added a comment to D46680: sound: Use unr(9) to produce unique channel unit numbers.

Bump.

Oct 17 2024, 11:42 AM
christos added a comment to D46836: sound: Shorten channel names.
  1. What is the intended meaning of the "name" field? It was sort of descriptive before, but now you're tying it to the device path.

As mentioned before, the meaning remains exactly the same.

The "name" field was meant as a descriptive label before, now it's a copy of an internal identifier that looks like a device path but isn't. It's not obvious to me whether you want to unify it with dsp_unit2name() everywhere or not. And without knowing all uses it's hard to tell whether that's a good idea.

Oct 17 2024, 11:37 AM

Oct 16 2024

christos updated the diff for D47152: snd_hda: Remove duplicate HDA_INTEL_CMLK* entries.

Remove CMLKH duplicate as well.

Oct 16 2024, 8:59 PM
christos retitled D47152: snd_hda: Remove duplicate HDA_INTEL_CMLK* entries from snd_hda: Remove duplicate HDA_INTEL_CMLKLP entry to snd_hda: Remove duplicate HDA_INTEL_CMLK* entries.
Oct 16 2024, 8:58 PM
christos updated the diff for D46700: sound: Introduce global driver lock.

Use a shared lock instead. Fixes some bugs I missed (didn't realize I wasn't
using a non-MPSAFE driver when testing...).

Oct 16 2024, 4:22 PM
christos updated the diff for D46700: sound: Introduce global driver lock.

Use sx(9) instead of mtx(9) so that we can sleep with the lock held.

Oct 16 2024, 3:15 PM
christos added inline comments to D46700: sound: Introduce global driver lock.
Oct 16 2024, 2:44 PM
christos updated the diff for D46700: sound: Introduce global driver lock.

Retire PCM_GIANT_ENTER() and PCM_GIANT_LEAVE/PCM_GIANT_EXIT() and replace with
2 two PCM_SND_LOCK() and PCM_SND_UNLOCK() macros (I'm open to propositions for
a better name).

Oct 16 2024, 2:32 PM
christos updated the summary of D46700: sound: Introduce global driver lock.
Oct 16 2024, 2:29 PM
christos requested review of D47152: snd_hda: Remove duplicate HDA_INTEL_CMLK* entries.
Oct 16 2024, 1:42 PM
christos added inline comments to D46862: rc.d/sendmail: Return non-zero if the daemon fails to start or is not running.
Oct 16 2024, 1:13 PM · rc
christos added inline comments to D46862: rc.d/sendmail: Return non-zero if the daemon fails to start or is not running.
Oct 16 2024, 1:12 PM · rc
christos added a comment to D46836: sound: Shorten channel names.
  1. What is the intended meaning of the "name" field? It was sort of descriptive before, but now you're tying it to the device path.
Oct 16 2024, 12:30 PM
christos accepted D46862: rc.d/sendmail: Return non-zero if the daemon fails to start or is not running.

LGTM. Only a minor nit: in the commit message there is a typo: "sendmai daemon ...".

Oct 16 2024, 10:36 AM · rc

Oct 13 2024

christos added inline comments to D46680: sound: Use unr(9) to produce unique channel unit numbers.
Oct 13 2024, 9:23 PM
christos updated the diff for D46680: sound: Use unr(9) to produce unique channel unit numbers.

Make unr(9) per-softc. I don't know how I missed this one...

Oct 13 2024, 9:17 PM
christos added a comment to D46847: sound: Fix hot-unload page fault.

I just put your reproduce code into a shell script. Setup is a bhyve VM, 4 cores, pcm0 is a passthrough USB audio interface, script operates on pcm1 which is snd_dummy as in your example.

I tried this exact scenario, but still cannot reproduce the panic after multiple times of running the script. Is there some non-default configuration you're using?

Nothing special, I don't have any non-default config in this test VM. It took me about 7 attempts to reproduce this with 50 channels (as in your example), I think it took less attempts with 100 as I had in my script originally. I also updated src in the meantime, same panic.

Oct 13 2024, 7:53 PM
christos added a comment to D46847: sound: Fix hot-unload page fault.

Interesting. What do you do exactly to reproduce those? Also what is the configuration you're using?

I just put your reproduce code into a shell script. Setup is a bhyve VM, 4 cores, pcm0 is a passthrough USB audio interface, script operates on pcm1 which is snd_dummy as in your example.

Oct 13 2024, 5:44 PM
christos added a comment to D46836: sound: Shorten channel names.

I don't care too much about the device names, but I think we should conceptually separate them from what we display to the end user. As a future goal we may want to have something more elaborate in the OSS audio info name field, e.g. dsp.virtual_play.1 <Dummy Audio Device>.

I agree with printing something more elaborate, although I'd prefer a different naming scheme than this one. But we can discuss it in the future. :-)

You are changing the content of the name field here. We have to assess where and what it is used for. As I try to explain, the different use cases may demand different formatting and content, thus I want to know what we cater to here.

Oct 13 2024, 4:34 PM
christos added a comment to D46700: sound: Introduce global driver lock.

@markj any opinion (see previous comment)?

Oct 13 2024, 4:27 PM
christos updated the diff for D46857: sound: Improve /dev/sndstat channel info readability.

Split buffer line as well.

Oct 13 2024, 4:14 PM
christos retitled D46857: sound: Improve /dev/sndstat channel info readability from sound: Indent channel info lines for more readability to sound: Improve /dev/sndstat channel info readability.
Oct 13 2024, 4:14 PM

Oct 12 2024

christos accepted D35958: rc/tests: Skip oomprotect tests in a jail.

Approved.

Oct 12 2024, 9:49 PM · rc

Oct 9 2024

christos accepted D46924: rc.d/sendmail: Fix the rcorder block.

Approved.

Oct 9 2024, 11:04 PM · rc

Oct 8 2024

christos accepted D47007: committers-src: Add myself (0mp).
Oct 8 2024, 10:06 AM

Oct 4 2024

christos added a comment to D46857: sound: Improve /dev/sndstat channel info readability.

I'd prefer a smaller indent, maybe 2 spaces instead of the 8 space standard tabs, also for the first indent level. As is, the lines regularly exceed 80 character screen width and break the visual indent with the overflow.
But this is already an improvement, thanks!

Oct 4 2024, 8:14 AM
christos added a comment to D46847: sound: Fix hot-unload page fault.

Interesting. What do you do exactly to reproduce those? Also what is the configuration you're using?

Oct 4 2024, 8:05 AM
christos added a comment to D46836: sound: Shorten channel names.

I don't care too much about the device names, but I think we should conceptually separate them from what we display to the end user. As a future goal we may want to have something more elaborate in the OSS audio info name field, e.g. dsp.virtual_play.1 <Dummy Audio Device>.

Oct 4 2024, 7:56 AM

Oct 3 2024

christos added a reviewer for D46836: sound: Shorten channel names: zlei.
Oct 3 2024, 2:57 PM
christos updated the diff for D46836: sound: Shorten channel names.

New naming scheme: dspX.[virtual_]play|record.Y

Oct 3 2024, 2:55 PM
christos updated the summary of D46836: sound: Shorten channel names.
Oct 3 2024, 2:54 PM
christos updated the diff for D46700: sound: Introduce global driver lock.

Use new global driver lock instead of bus_topo_*.

Oct 3 2024, 2:24 PM
christos retitled D46700: sound: Introduce global driver lock from sound: Use bus_topo_lock() where needed to sound: Introduce global driver lock.
Oct 3 2024, 2:22 PM
christos added a comment to D46857: sound: Improve /dev/sndstat channel info readability.

Any comments?

Oct 3 2024, 2:06 PM
christos added a comment to D46847: sound: Fix hot-unload page fault.

In general it makes sense to remove entry points (a device file in this case) first when tearing down a driver, so this is probably fine.

Oct 3 2024, 2:06 PM

Oct 1 2024

christos updated the test plan for D46857: sound: Improve /dev/sndstat channel info readability.
Oct 1 2024, 5:44 PM
christos added inline comments to D46700: sound: Introduce global driver lock.
Oct 1 2024, 2:23 AM
christos added a comment to D46836: sound: Shorten channel names.

If I'm not mistaken, this name field corresponds to the name entry in the SNDCTL_AUDIOINFO ioctl. OSSv4 defines it as follows:

A string that contains the "full" description of the device.

This sounds like it should be presentable to normal users and help them to identify the device.
Could you verify that this string is actually used in GUIs like VLC? I don't have Xorg running on CURRENT.

Oct 1 2024, 2:09 AM
christos requested review of D46857: sound: Improve /dev/sndstat channel info readability.
Oct 1 2024, 2:09 AM
christos updated the diff for D46749: sound: Move global variable initialization to sound_modevent().
  • s/sound_glob_init()/sound_global_init()/
  • Move indendation fix to separate patch: D46856
Oct 1 2024, 1:53 AM
christos requested review of D46856: sound: Fix indendation in sound_modevent() switch statement.
Oct 1 2024, 1:52 AM
christos updated the diff for D46811: vmm.4: Add ppt device detach example.

Address Mark's comments.

Oct 1 2024, 1:36 AM

Sep 29 2024

christos added a reviewer for D46811: vmm.4: Add ppt device detach example: andrew.
Sep 29 2024, 5:18 PM
christos added a comment to D46836: sound: Shorten channel names.

This makes sysctl hw.snd.verbose=2; cat /dev/sndstat harder to read, and we lose the ability to grep for play, record and virtual there. Also I think this is shown verbatim in GUIs like VLC, do we expect normal users to understand the subtle notion of [v]p|r?

Sep 29 2024, 4:44 PM
christos added a comment to D46845: sound: Use M_WAITOK where possible.

LGTM, I suppose this is save when called through SYSINIT?

Sep 29 2024, 4:40 PM
christos added inline comments to D46821: sound: Move root feeder initialization to separate function.
Sep 29 2024, 3:33 PM
christos updated the test plan for D46847: sound: Fix hot-unload page fault.
Sep 29 2024, 2:48 PM
christos requested review of D46847: sound: Fix hot-unload page fault.
Sep 29 2024, 2:47 PM
christos requested review of D46846: sound: Do not check for NULL if sbuf is allocated with SBUF_AUTOEXTEND.
Sep 29 2024, 2:09 PM
christos added inline comments to D46821: sound: Move root feeder initialization to separate function.
Sep 29 2024, 1:34 PM
christos updated the diff for D46845: sound: Use M_WAITOK where possible.

Fix.

Sep 29 2024, 1:34 PM
christos updated the summary of D46845: sound: Use M_WAITOK where possible.
Sep 29 2024, 1:33 PM
christos reclaimed D46845: sound: Use M_WAITOK where possible.
Sep 29 2024, 1:33 PM
christos added a comment to D46845: sound: Use M_WAITOK where possible.

I accidentally posted a draft patch, which contained some errors. Will re-submit the correct one soon.

Sep 29 2024, 1:25 PM
christos abandoned D46845: sound: Use M_WAITOK where possible.
Sep 29 2024, 1:24 PM
christos requested review of D46845: sound: Use M_WAITOK where possible.
Sep 29 2024, 1:23 PM
christos requested review of D46844: sound: Do not cast return value of malloc(9).
Sep 29 2024, 12:50 PM
christos accepted D46837: snd_hdsp(4): Support AO4S-192 and AI4S-192 extension boards..
Sep 29 2024, 12:16 PM
christos added inline comments to D46821: sound: Move root feeder initialization to separate function.
Sep 29 2024, 10:52 AM

Sep 28 2024

christos requested review of D46836: sound: Shorten channel names.
Sep 28 2024, 4:01 PM
christos requested review of D46835: sound: Simplify channel creation and deletion process.
Sep 28 2024, 3:48 PM
christos added inline comments to D46834: sound: Remove useless newspd check in sysctl_dev_pcm_vchanrate().
Sep 28 2024, 3:18 PM
christos requested review of D46834: sound: Remove useless newspd check in sysctl_dev_pcm_vchanrate().
Sep 28 2024, 3:16 PM
christos requested review of D46833: sound: Simplify vchan_create() error paths.
Sep 28 2024, 3:12 PM

Sep 27 2024

christos updated the diff for D46749: sound: Move global variable initialization to sound_modevent().

Move to separate function.

Sep 27 2024, 5:55 PM
christos added inline comments to D46749: sound: Move global variable initialization to sound_modevent().
Sep 27 2024, 5:55 PM
christos requested review of D46821: sound: Move root feeder initialization to separate function.
Sep 27 2024, 5:55 PM
christos added a comment to D46680: sound: Use unr(9) to produce unique channel unit numbers.

@dev_submerge.ch Any comments? As I mention in the commit message, wanting to sort in descending order (and as a result, breaking the mechanism proposed in D46550) is highly unlikely, but I think it's good to be on the safe side.

Using existing KPI is a plus, but the *_unr() is quite complex. It introduces another mutex and additional allocations in our case. Regarding the issue discussed in D46520, this makes the runtime implications non-obvious. We'll have to test that. Also this change trades the list order requirement in for the complexity of an additional unr allocation that we must not leak.

Sep 27 2024, 4:46 PM
christos added a comment to D46520: sound: Retire SND_MAXVCHANS.

I suspect the traversal of the channel list to have an impact. If we traverse it for every allocation, and the list getting longer, we get O(N^2) for N allocations. That should be easy to prove by doing a benchmark of allocations with few vchans and compare that to situations with 1'000, 10'000 and 100'000 preallocated vchans.

Some brief tests seem to support this theory, we have a scaling problem. Allocating 1000 vchans from 0 is almost instantaneous, while allocating from 100000 to 101000 takes about 10 seconds.

I think even without preallocation, we still need some hard upper bound for the number of vchans, like @olce proposed. 10ms per allocation can already be problematic for multimedia applications. And we should have a close look at how we deallocate the vchans again.

Sep 27 2024, 3:55 PM
christos updated the diff for D46811: vmm.4: Add ppt device detach example.

s/hypervisor/ppt/

Sep 27 2024, 11:15 AM
christos added inline comments to D46811: vmm.4: Add ppt device detach example.
Sep 27 2024, 11:13 AM