Page MenuHomeFreeBSD

christos (Christos Margiolis)
User

Projects

User Details

User Since
Jul 2 2021, 4:03 PM (167 w, 2 d)

Recent Activity

Yesterday

christos updated the diff for D46680: sound: Use unr(9) to produce unique channel unit numbers.

chn_getunr(): Use __assert_unreachable() instead of returning NULL.

Sun, Sep 15, 9:52 PM
christos added inline comments to D46680: sound: Use unr(9) to produce unique channel unit numbers.
Sun, Sep 15, 9:44 PM
christos added inline comments to D46680: sound: Use unr(9) to produce unique channel unit numbers.
Sun, Sep 15, 7:04 PM
christos added a comment to D46550: sound: Make sure chn_init() produces unique unit numbers.

An alternative approach using unr(9). Works with both ascending and descending order: https://reviews.freebsd.org/D46680

Sun, Sep 15, 6:39 PM
christos requested review of D46680: sound: Use unr(9) to produce unique channel unit numbers.
Sun, Sep 15, 6:39 PM
christos added a comment to D46550: sound: Make sure chn_init() produces unique unit numbers.

So, making this work when the list is sorted in descending order is quite more involved... The only viable solution I can think of is the following: 1) change from SLIST to TAILQ so that we can have TAILQ_FOREACH_REVERSE(), 2) introduce a CHN_FOREACH_REVERSE() macro, 3) store the sort type (i.e ascending or descending) in snddev_info, 4) check this sort type in chn_init(), and if it's ascending order, do what the patch does already, otherwise use CHN_FOREACH_REVERSE() instead instead of CHN_FOREACH(), so that the same code can keep working.

Sun, Sep 15, 5:52 PM
christos added a comment to D46550: sound: Make sure chn_init() produces unique unit numbers.

This only works when the vchans per type are sorted by unit, in ascending order, right? Aren't the vchans sorted in descending order?

VCHANs are also sorted in ascending order in the channel list stored in snddev_info since vchan_create() calls pcm_chn_add(), which in turn calls CHN_INSERT_SORT_ASCEND(). The descending sort happens in the children list of pcm_channel.

Sun, Sep 15, 2:58 PM
christos added a comment to D46550: sound: Make sure chn_init() produces unique unit numbers.

This only works when the vchans per type are sorted by unit, in ascending order, right? Aren't the vchans sorted in descending order?

Sun, Sep 15, 2:18 PM
christos updated the diff for D46549: sound: Sort channels by unit number as well.

Fix.

Sun, Sep 15, 2:05 PM
christos added a comment to D46548: sound: Simplify pcm_chnalloc() and fix infinite loop bug.

I think the endless loop was caused by goto vchan_alloc;: It skips the retry check, successfully calls vchan_setnew() with unchanged values, and then loops back through goto retry_chnalloc;. There's nothing else in there that would change and break the loop.

That endless loop would be triggered when the vchan_num < c->unit condition is met. I'd expect that to happen before spawning vchan X + 1 though.

Sun, Sep 15, 12:03 PM

Sat, Sep 14

christos updated the diff for D46418: mididump(1): Initial revision.

Introduce -t option to print "Timing Clock" messages on-demand, in order to
declutter output.

Sat, Sep 14, 5:04 PM
christos added a comment to D46418: mididump(1): Initial revision.

For real devices there's a "Timing clock" message coming at a certain frequency, too much noise to see the other MIDI messages. Maybe we could collect them and print them together, or add a flag to enable or disable printing them?

Sat, Sep 14, 4:41 PM
christos added a comment to D46520: sound: Retire SND_MAXVCHANS.

This is a clever solution for the maxautovchans sysctl. There's some aftermath though. With lots of channels and sysctl hw.snd.verbose=2, sndstat_prepare_pcm() does some memory allocation in sbuf_printf() while holding a lock:

uma_zalloc_debug: zone "malloc-65536" with the following non-sleepable locks held:
exclusive sleep mutex pcm0:virtual_record:dsp0.vr216 (pcm virtual record channel) r = 0 (0xfffff800015a8460) locked @ /usr/src/sys/dev/sound/pcm/sndstat.c:1261
stack backtrace:
#0 0xffffffff80bc423c at witness_debugger+0x6c
#1 0xffffffff80bc5433 at witness_warn+0x403
#2 0xffffffff80ef2e44 at uma_zalloc_debug+0x34
#3 0xffffffff80ef2967 at uma_zalloc_arg+0x27
#4 0xffffffff80b21e8d at malloc+0x7d
#5 0xffffffff80bac3eb at sbuf_extend+0x7b
#6 0xffffffff80bac9aa at sbuf_put_byte+0xda
#7 0xffffffff80ba6318 at kvprintf+0xe68
#8 0xffffffff80bac7ed at sbuf_vprintf+0x6d
#9 0xffffffff80bac89f at sbuf_printf+0x3f
#10 0xffffffff808df4b4 at sndstat_read+0x7c4
#11 0xffffffff809d8fd4 at devfs_read_f+0xe4
#12 0xffffffff80bc8f40 at dofileread+0x80
#13 0xffffffff80bc8ac7 at sys_read+0xb7
#14 0xffffffff810779e8 at amd64_syscall+0x158
#15 0xffffffff81049c3b at fast_syscall_common+0xf8

I think we fixed a similar case for the nvlist sndstat interface.

Sat, Sep 14, 4:35 PM

Fri, Sep 6

christos retitled D46560: sound: Re-arrange vchan_setnew() initial checks and improve errno values from sound: Re-arrange initial checks and improve errno values to sound: Re-arrange vchan_setnew() initial checks and improve errno values.
Fri, Sep 6, 10:54 AM
christos requested review of D46560: sound: Re-arrange vchan_setnew() initial checks and improve errno values.
Fri, Sep 6, 10:54 AM

Thu, Sep 5

christos added inline comments to D46520: sound: Retire SND_MAXVCHANS.
Thu, Sep 5, 8:35 PM
christos updated the diff for D46520: sound: Retire SND_MAXVCHANS.

Remove snd_maxautovchans checks in sysctl_dev_pcm_vchans() and vchan_setnew()
to preserve previous behavior. This way we can still disable VCHANs globally
through hw.snd.maxautovchans and enable them on demand through
dev.pcm.X.[play|rec].vchans.

Thu, Sep 5, 8:33 PM
christos updated the diff for D46548: sound: Simplify pcm_chnalloc() and fix infinite loop bug.

Handle vchan_setnew() error case.

Thu, Sep 5, 8:09 PM
christos added inline comments to D46521: sound: Get rid of pnum and max variables in chn_init().
Thu, Sep 5, 8:03 PM
christos requested review of D46550: sound: Make sure chn_init() produces unique unit numbers.
Thu, Sep 5, 8:01 PM
christos requested review of D46549: sound: Sort channels by unit number as well.
Thu, Sep 5, 8:00 PM
christos requested review of D46548: sound: Simplify pcm_chnalloc() and fix infinite loop bug.
Thu, Sep 5, 8:00 PM
christos added a comment to D46520: sound: Retire SND_MAXVCHANS.

This will break some use cases, e.g. turning off vchans by default through sysctl hw.snd.maxautovchans=0 and then turning it on for some specific device with sysctl dev.pcm.0.play.vchans=32. While that's also achievable the other way round, we're definitely going to break some people's workflows.

This can indeed break. However, I think it makes more intuitive sense to set dev.pcm.X.[play|rec].vchans to 0 to disable VCHANs, than hw.snd.maxautovchans. I know you said "by default", but still, that's just my humble opinion :)

I'm fine with that opinion. Problem is, it's far easier to set hw.snd.maxautovchans=0 than going for the individual pcm devices in both directions. And it's suggested for exactly this purpose by sound(4):

[...]

Therefore people are currently using it, and it's not a good idea to silently break their workflow.

Thu, Sep 5, 5:24 PM
christos requested review of D46545: sound: Remove KASSERT from vchan_setnew().
Thu, Sep 5, 5:03 PM
christos updated the diff for D46418: mididump(1): Initial revision.

Read 2 bytes (instead of 3) in case byte1 in SysEx is 0.

Thu, Sep 5, 4:35 PM
christos added a comment to D46521: sound: Get rid of pnum and max variables in chn_init().

Any comment related to the patch?

Thu, Sep 5, 4:25 PM

Wed, Sep 4

christos added inline comments to D46521: sound: Get rid of pnum and max variables in chn_init().
Wed, Sep 4, 2:22 PM
christos added a comment to D46520: sound: Retire SND_MAXVCHANS.

We're changing semantics of hw.snd.maxautovchans here. Currently it's possible to override maxautovchans via the per pcm device vchans sysctl, with this patch it becomes a hard limit.

Wed, Sep 4, 1:52 PM

Tue, Sep 3

christos requested review of D46522: sound: Retire SND_MAXHWCHAN.
Tue, Sep 3, 3:53 PM
christos updated the diff for D46520: sound: Retire SND_MAXVCHANS.

Update and depend on D46521.

Tue, Sep 3, 3:53 PM
christos requested review of D46521: sound: Get rid of pnum and max variables in chn_init().
Tue, Sep 3, 3:52 PM
christos added a comment to D46520: sound: Retire SND_MAXVCHANS.

I will also add a RELNOTES entry when I commit it.

Tue, Sep 3, 3:26 PM
christos requested review of D46520: sound: Retire SND_MAXVCHANS.
Tue, Sep 3, 3:26 PM
christos updated the diff for D46418: mididump(1): Initial revision.

Fix SysEx handling. In the case of 3-byte VendorID, I am not sure if we should
read 3 _additional_ bytes (what the patch does), or 2.

Tue, Sep 3, 1:39 PM
christos added inline comments to D46418: mididump(1): Initial revision.
Tue, Sep 3, 1:23 PM
christos added inline comments to D46418: mididump(1): Initial revision.
Tue, Sep 3, 1:22 PM
christos added inline comments to D46418: mididump(1): Initial revision.
Tue, Sep 3, 12:59 PM

Mon, Sep 2

christos updated the diff for D46418: mididump(1): Initial revision.
  • read(2) on-demand. Introduce read_byte() function.
  • Get rid of EVENT_MASK.
Mon, Sep 2, 4:17 PM
christos added inline comments to D46418: mididump(1): Initial revision.
Mon, Sep 2, 4:15 PM

Sun, Sep 1

christos committed rGb8aeb7101724: mixer(8) tests: Fix cleanup routine (authored by olivier).
mixer(8) tests: Fix cleanup routine
Sun, Sep 1, 1:31 PM

Sat, Aug 31

christos committed rGe9a30c90d31e: ObsoleteFiles.inc: Fix examples path (authored by christos).
ObsoleteFiles.inc: Fix examples path
Sat, Aug 31, 4:37 PM

Fri, Aug 30

christos added a comment to D35772: beep(1): Add support for rendering text and numbers as audio..

I am interested to take/continue this feature. Are others already working?

Fri, Aug 30, 8:00 PM
christos added a comment to D35776: vtspeakd(1): Initial version of console speaker daemon..

I am interested to take/continue this feature. Are others already working?

Fri, Aug 30, 8:00 PM
christos closed D46491: mixer(8) tests: Fix cleanup routine.
Fri, Aug 30, 5:25 PM
christos committed rG080c85127e3f: mixer(8) tests: Fix cleanup routine (authored by olivier).
mixer(8) tests: Fix cleanup routine
Fri, Aug 30, 5:25 PM
christos retitled D46491: mixer(8) tests: Fix cleanup routine from Fix cleanup step when no mixer nor snd_dummy to mixer(8) tests: Fix cleanup routine.
Fri, Aug 30, 5:19 PM
christos accepted D46491: mixer(8) tests: Fix cleanup routine.

LGTM. I will commit the patch and add you as the author, as it needs some style(9) fix as well. Thanks!

Fri, Aug 30, 5:18 PM

Mon, Aug 26

christos committed rG91b1e2a4a84b: sound examples: Delete stale ossinit.h file (authored by christos).
sound examples: Delete stale ossinit.h file
Mon, Aug 26, 1:55 PM
christos committed rGf63d0c39d9d7: ObsoleteFiles.inc: Update after sound changes (authored by christos).
ObsoleteFiles.inc: Update after sound changes
Mon, Aug 26, 1:55 PM
christos committed rG8156d8598f59: sound: Improve sndstat nvlist feederchain format (authored by christos).
sound: Improve sndstat nvlist feederchain format
Mon, Aug 26, 1:55 PM
christos committed rGf060ed39805d: sound examples: Move MIDI example out of OSS directory (authored by christos).
sound examples: Move MIDI example out of OSS directory
Mon, Aug 26, 1:55 PM
christos committed rGa59e4c405572: sound examples: Simplify audio example (authored by christos).
sound examples: Simplify audio example
Mon, Aug 26, 1:55 PM
christos committed rG276d76adf984: sound examples: Simplify MIDI example (authored by christos).
sound examples: Simplify MIDI example
Mon, Aug 26, 1:55 PM
christos committed rGcf9d2fb18433: mixer(8): Implement hot-swapping (authored by christos).
mixer(8): Implement hot-swapping
Mon, Aug 26, 1:55 PM
christos committed rG6ab8b418dc10: sound tests: Add SNDSTIOC_ADD_USER_DEVS test (authored by christos).
sound tests: Add SNDSTIOC_ADD_USER_DEVS test
Mon, Aug 26, 1:55 PM

Sat, Aug 24

christos committed rG7ae4868a9a1a: sound examples: Delete stale ossinit.h file (authored by christos).
sound examples: Delete stale ossinit.h file
Sat, Aug 24, 12:17 PM
christos committed rG0864dfe6299b: sound: Improve sndstat nvlist feederchain format (authored by christos).
sound: Improve sndstat nvlist feederchain format
Sat, Aug 24, 12:10 PM
christos committed rGc3516c6533a1: ObsoleteFiles.inc: Update after sound changes (authored by christos).
ObsoleteFiles.inc: Update after sound changes
Sat, Aug 24, 12:10 PM
christos committed rG6747b1a8218f: sound examples: Move MIDI example out of OSS directory (authored by christos).
sound examples: Move MIDI example out of OSS directory
Sat, Aug 24, 12:09 PM
christos committed rG3decd659a788: sound examples: Simplify audio example (authored by christos).
sound examples: Simplify audio example
Sat, Aug 24, 12:09 PM
christos committed rG0ca4d5d8209c: sound examples: Simplify MIDI example (authored by christos).
sound examples: Simplify MIDI example
Sat, Aug 24, 12:09 PM
christos closed D46309: sound: Improve sndstat nvlist feederchain format.
Sat, Aug 24, 12:09 PM
christos committed rG9aac27599aca: mixer(8): Implement hot-swapping (authored by christos).
mixer(8): Implement hot-swapping
Sat, Aug 24, 12:09 PM
christos committed rG2668e76d6e76: sound tests: Add SNDSTIOC_ADD_USER_DEVS test (authored by christos).
sound tests: Add SNDSTIOC_ADD_USER_DEVS test
Sat, Aug 24, 12:09 PM
christos closed D46308: sound examples: Move MIDI example out of OSS directory.
Sat, Aug 24, 12:09 PM
christos closed D46307: sound examples: Simplify audio example.
Sat, Aug 24, 12:09 PM
christos closed D46306: sound examples: Simplify MIDI example.
Sat, Aug 24, 12:09 PM
christos closed D46253: mixer(8): Implement hot-swapping.
Sat, Aug 24, 12:09 PM
christos closed D46228: sound tests: Add SNDSTIOC_ADD_USER_DEVS test.
Sat, Aug 24, 12:09 PM

Fri, Aug 23

christos abandoned D46377: sound: Fix SEQ_SYSEX() macro.

Alright, didn't know we could use just GitHub for this. Thank you. :)

Fri, Aug 23, 7:38 PM
christos added a comment to D46377: sound: Fix SEQ_SYSEX() macro.

Bump.

Isn't this the same as the patch submitted by Ivan on github? https://github.com/freebsd/freebsd-src/pull/1374

If so, and you think the patch is reasonable, you can just approve it and we'll take care of landing it into src with the correct attribution etc..

Fri, Aug 23, 5:40 PM
christos updated the diff for D46418: mididump(1): Initial revision.

Minor fix.

Fri, Aug 23, 3:50 PM
christos updated the diff for D46418: mididump(1): Initial revision.
  • Add bound check for ctls[].
  • Use b2 instead of b1 for vendorid in SysEx.
Fri, Aug 23, 3:47 PM
christos added inline comments to D46418: mididump(1): Initial revision.
Fri, Aug 23, 3:34 PM
christos added a comment to D46418: mididump(1): Initial revision.

Inspired by aseqdump, but more user-friendly (printing note names, frequencies, control names, ...), and also native so it does not require ALSA or any sound backend. In the future I would like to support MIDI 2.0 events as well, but I think for now we can roll with just MIDI 1.0.

Fri, Aug 23, 3:28 PM
christos updated the test plan for D46418: mididump(1): Initial revision.
Fri, Aug 23, 3:21 PM
christos requested review of D46418: mididump(1): Initial revision.
Fri, Aug 23, 3:19 PM
christos added a comment to D46306: sound examples: Simplify MIDI example.

Bump.

Fri, Aug 23, 2:03 PM
christos added a comment to D46309: sound: Improve sndstat nvlist feederchain format.

Bump.

Fri, Aug 23, 2:03 PM
christos added a comment to D46377: sound: Fix SEQ_SYSEX() macro.

Bump.

Fri, Aug 23, 2:03 PM
christos updated the diff for D46227: audio(8): Initial revision.
  • Introduce play|rec.autoconv and realtime controls.
    • Maybe the names could be improved
    • See XXXs in mod functions
    • In mod_realtime() the values are hard-coded to the defaults for when realtime=0, but I am not sure if that’s right.
  • play|rec.rate and play|rec.format: Report vchanrate/format but made it read-only when VCHANs are disabled.
  • Is OSS caps useful info?
  • Future goals:
    • Implement iostat -w <n>-like option as a future goal. I would like to think some more about a concise, yet useful/user-friendly output format, consider how many properties each channel has.
    • Think about Florian's comment: “We can still show the hardware rate / format, but we don't have to show mixdown or virtual channel properties when VCHANs are disabled, nor do we have to show different formats when bitperfect is set. Part of the simplification is to hide what is not relevant in a situation.”.
    • Improve the -v option in the future.
    • Write a test script
Fri, Aug 23, 2:00 PM
christos retitled D46227: audio(8): Initial revision from [WIP] audio(8): Initial revision to audio(8): Initial revision.
Fri, Aug 23, 1:59 PM

Tue, Aug 20

christos added inline comments to D46306: sound examples: Simplify MIDI example.
Tue, Aug 20, 9:19 PM
christos updated the diff for D46306: sound examples: Simplify MIDI example.

Make reads more robust.

Tue, Aug 20, 9:18 PM
christos updated the diff for D46309: sound: Improve sndstat nvlist feederchain format.

Use snd_aftm2str() instead of plain hex value for the rest of the feeder
classes.

Tue, Aug 20, 3:24 PM
christos updated the summary of D46309: sound: Improve sndstat nvlist feederchain format.
Tue, Aug 20, 3:23 PM
christos added a comment to D46307: sound examples: Simplify audio example.

I suppose the original idea by @meka_tilda.center was to implement another example using mmap, at least there's code fragments for that. What's the plan regarding a mmap example?

Tue, Aug 20, 3:06 PM
christos updated the diff for D46253: mixer(8): Implement hot-swapping.

Address Florian's comment.

Tue, Aug 20, 2:57 PM
christos updated the summary of D46377: sound: Fix SEQ_SYSEX() macro.
Tue, Aug 20, 2:37 PM
christos closed D46376: audio/virtual_oss: Enable BT_SPEAKER by default.
Tue, Aug 20, 2:35 PM
christos committed R11:8e3cfe23a82e: audio/virtual_oss: Enable BT_SPEAKER by default (authored by christos).
audio/virtual_oss: Enable BT_SPEAKER by default
Tue, Aug 20, 2:35 PM
christos updated the summary of D46377: sound: Fix SEQ_SYSEX() macro.
Tue, Aug 20, 11:34 AM
christos requested review of D46377: sound: Fix SEQ_SYSEX() macro.
Tue, Aug 20, 11:32 AM
christos requested review of D46376: audio/virtual_oss: Enable BT_SPEAKER by default.
Tue, Aug 20, 11:19 AM

Sat, Aug 17

christos added a comment to D46227: audio(8): Initial revision.

Or something more concise to include more information, because this format will end up with too big lines if we want to include most info we can have about a channel. What would be nice is if this could run in a top(1)-like loop, but this would require us to call read_dev() constantly so that variable info like xruns, feedcount etc are updated. If you mean something like this then it could be a useful feature to troubleshoot problems.

Something like the -w or interval parameter of iostat(8) / zpool-iostat(8)?

Sat, Aug 17, 5:26 PM
christos added a comment to D46227: audio(8): Initial revision.

@dev_submerge.ch What do you think about the comment above? The only thing I'd add is, regarding the generic play|rec.rate and play|rec.format controls I proposed, it might be tricky to figure out what rate/format to report when VCHANs are disabled (in which case we can just report vchanrate and vchanformat).

Is there a vchanrate and vchanformat with vchans disabled? Because in sysctl(8) they just disappear. IIRC cat /dev/sndstat reports these parameters for the primary channel, so they should be accessible somehow. From a user's perspective there's actually two interesting infos to know, the mixdown format and rate, and the hardware format and rate.

Sat, Aug 17, 4:32 PM
christos updated the diff for D46253: mixer(8): Implement hot-swapping.

Issue warning in case hw.snd.basename_clone is not set.

Sat, Aug 17, 1:55 PM

Aug 15 2024

christos added a comment to D46253: mixer(8): Implement hot-swapping.

I do not think it overrides the default unit. It turns off hw.snd.basename_clone, so that sound(4) disables access to the /dev/dsp node, in order for virtual_oss to create an actual /dev/dsp device. This is done so applications can still open /dev/dsp as they would normally, but in reality they open the virtual_oss device. It's a hack I guess.

As you explain, if /dev/dsp is created by virtual_oss, then setting the hw.snd.default_unit sysctl has no effect. Applications will open the virtual_oss device. Since we're integrating mixer(8) with virtual_oss here, I think we should issue a warning in that case. It's not obvious to the user. Could be done in a separate patch though.

Aug 15 2024, 4:30 PM
christos added inline comments to D46309: sound: Improve sndstat nvlist feederchain format.
Aug 15 2024, 4:13 PM
christos requested review of D46309: sound: Improve sndstat nvlist feederchain format.
Aug 15 2024, 4:12 PM