Page MenuHomeFreeBSD

meka_tilda.center (Goran Mekić)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 19 2019, 8:59 AM (369 w, 6 h)

Recent Activity

Jul 5 2026

meka_tilda.center updated the diff for D57833: sound: track kqueue low watermark per-knote for mmaped channels.

Address the comments

Jul 5 2026, 1:54 AM

Jul 2 2026

meka_tilda.center updated the diff for D57833: sound: track kqueue low watermark per-knote for mmaped channels.

Extend chn_polltrigger() to cover kqueue+mmap case.

Jul 2 2026, 6:23 PM
meka_tilda.center added inline comments to D57833: sound: track kqueue low watermark per-knote for mmaped channels.
Jul 2 2026, 4:44 PM

Jun 30 2026

meka_tilda.center updated the diff for D57833: sound: track kqueue low watermark per-knote for mmaped channels.

Add code comments explaining why kqueue is special.

Jun 30 2026, 8:29 PM

Jun 29 2026

meka_tilda.center added a comment to D57833: sound: track kqueue low watermark per-knote for mmaped channels.

Before I do that, let's get the code in perfect shape. I mean, should I change chn_polltrigger and chn_pollreset to handle mmap or should I leave it as it is now?

Jun 29 2026, 11:43 PM

Jun 27 2026

meka_tilda.center added a comment to D57833: sound: track kqueue low watermark per-knote for mmaped channels.

It's not about mmap, it's about kqueue. Look at the following code:

Jun 27 2026, 5:33 PM

Jun 25 2026

meka_tilda.center added a comment to D57833: sound: track kqueue low watermark per-knote for mmaped channels.

I think the proper change would be to patch chn_polltrigger to accept pointer to knote and if it's NULL, do what it does now, if it's not, do what this patch does, but that would require changing chn_pollreset and pulling in struct knote into channel.h which I'm not sure we want or not, so please advise.

Jun 25 2026, 8:59 PM
meka_tilda.center retitled D57833: sound: track kqueue low watermark per-knote for mmaped channels from sound: fix low watermark for mmaped devices to sound: track kqueue low watermark per-knote for mmaped channels.
Jun 25 2026, 8:57 PM
meka_tilda.center updated the diff for D57833: sound: track kqueue low watermark per-knote for mmaped channels.

I was mislead by looking at select/poll and totally forgot that knotes persist in the kernel once registered. @kib thank you for pointing it out. As for title, I forgot to include "kqueue" in it to make it more obvious.

Jun 25 2026, 8:56 PM

Jun 24 2026

meka_tilda.center requested review of D57834: snd_dummy: advance pointers for both channels.
Jun 24 2026, 10:38 PM
meka_tilda.center requested review of D57833: sound: track kqueue low watermark per-knote for mmaped channels.
Jun 24 2026, 10:23 PM

Jun 15 2026

meka_tilda.center updated the diff for D57362: sound: Include more information in kevent returned from the kernel.
Jun 15 2026, 5:31 PM
meka_tilda.center updated the diff for D57410: sound: Adjust mmap example to use kqueue.

Forgot one of the comments.

Jun 15 2026, 9:53 AM
meka_tilda.center added inline comments to D57410: sound: Adjust mmap example to use kqueue.
Jun 15 2026, 9:50 AM
meka_tilda.center updated the diff for D57410: sound: Adjust mmap example to use kqueue.

Address the comments.

Jun 15 2026, 9:46 AM
meka_tilda.center updated the diff for D57362: sound: Include more information in kevent returned from the kernel.

Address the comments.

Jun 15 2026, 7:52 AM

Jun 3 2026

meka_tilda.center updated the diff for D57410: sound: Adjust mmap example to use kqueue.

In previous patch I acidently included kernel and map page patch, so this is a clean one.

Jun 3 2026, 3:39 PM
meka_tilda.center requested review of D57410: sound: Adjust mmap example to use kqueue.
Jun 3 2026, 3:37 PM
meka_tilda.center updated the diff for D57362: sound: Include more information in kevent returned from the kernel.

My English is terrible. Although man page edit describes what was done, the language is just bad. I even tried to ask AI to improve it and I still don't like it, so I obviously need help with wording. And yes, dsp_oss_syncstart patch fixes LOR we were seeing for so long. It's now part of D57399.

Jun 3 2026, 3:32 PM
meka_tilda.center requested review of D57399: sound: Start each channel individually.
Jun 3 2026, 2:10 AM

May 30 2026

meka_tilda.center requested review of D57362: sound: Include more information in kevent returned from the kernel.
May 30 2026, 5:44 PM

Apr 15 2026

meka_tilda.center added a comment to D54360: sound examples: Add MIDI kqueue example.

Given it works with umidi, should we close this? I think not as it works for me.

Apr 15 2026, 1:13 PM
meka_tilda.center abandoned D54359: sound: Add kqueue support to MIDI.
Apr 15 2026, 1:12 PM
meka_tilda.center added a comment to D54359: sound: Add kqueue support to MIDI.

Unification first, as this code is mostly "copy" of the umidi code. I think after unification one place will have the kqueue support and that will probably be copied over from umidi. That being said, do you want me to close this one?

Apr 15 2026, 1:11 PM
meka_tilda.center added a comment to D54359: sound: Add kqueue support to MIDI.

So, is it smart to work on this before umidi/midi unification? I can work on that, I just think it would be better if unification happened first.

Apr 15 2026, 1:09 PM
meka_tilda.center added a comment to D54360: sound examples: Add MIDI kqueue example.

I understood that you need to unify umidi and midi, that's why I left this review as is. Please tell me if I got it wrong.

Apr 15 2026, 1:06 PM

Apr 9 2026

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.
Apr 9 2026, 7:47 PM
meka_tilda.center added inline comments to D53749: sound examples: Add mmap example.
Apr 9 2026, 7:46 PM
meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.
Apr 9 2026, 7:43 PM

Apr 4 2026

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.
Apr 4 2026, 12:41 AM

Mar 28 2026

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

I forgot to change /dev/dsp5 to /dev/dsp. Sorry for the noise.

Mar 28 2026, 3:59 PM
meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

I followed SOSSO code more closely this time and got rid of the hardcoded 400ms sleep.

Mar 28 2026, 3:53 PM

Mar 14 2026

meka_tilda.center added a comment to D54359: sound: Add kqueue support to MIDI.

Sorry, I completely forgot about this. Give me a week and I'll start working on it again.

Mar 14 2026, 2:56 PM

Mar 11 2026

meka_tilda.center added a comment to D55670: virtual_oss: Introduce virtual_oss_default_control_device rc variable.

What about alternative approach as in "ask the /dev/dsp* what is its control device"? For hardware devices the answer is NULL, for virtual_oss, it's /dev/dsp.ctl (or whatever is configured). Or maybe get devices through nvlist and /dev/sndstat and see which devices are virtual. In any case, my idea is "ask the kernel". I don't have preferences on the exact implementation.

Mar 11 2026, 5:35 PM

Jan 10 2026

meka_tilda.center updated the diff for D54359: sound: Add kqueue support to MIDI.

I rebased this patch, but the problem is that I don't have the hardware to test it. I'll try to find cheap PCIe card to test this patch.

Jan 10 2026, 3:21 AM

Jan 2 2026

meka_tilda.center added a comment to D54360: sound examples: Add MIDI kqueue example.

The USB stack seems to have a default kqfilter method,so I suppose this is why it works. Does it work properly though?

Jan 2 2026, 4:42 PM
meka_tilda.center added a comment to D54360: sound examples: Add MIDI kqueue example.

I did not try it yet, but there is no way that the code in D54359 is related to this working, because it does not run with USB MIDI. Does it work without D54359?

Oh, it works on 15.0-RELEASE, so no wonder I wrote this patch so easily: it doesn't do anything 😄

Jan 2 2026, 4:28 PM
meka_tilda.center added a comment to D54360: sound examples: Add MIDI kqueue example.

Does this actually work? snd_uaudio(4) does not seem to implement a kqfilter method. I haven't checked whether the USB stack has a default handler. Also see my comment in D54359.

Jan 2 2026, 4:06 PM
meka_tilda.center added a comment to D54359: sound: Add kqueue support to MIDI.

Also I suppose you know this code does not work for USB MIDI, at the moment. I will eventually make USB MIDI attach to it, but currently this only works for physical MIDI.

Jan 2 2026, 3:55 PM
meka_tilda.center added a comment to D54359: sound: Add kqueue support to MIDI.

There are a lot of MIDI patches in review that simplify the code, so this won't apply. I can rewrite it on top of them if you want.

Jan 2 2026, 3:55 PM

Dec 27 2025

meka_tilda.center updated the diff for D54359: sound: Add kqueue support to MIDI.

As midi_destroy will be removed, adapt this patch for that.

Dec 27 2025, 6:37 PM

Dec 26 2025

meka_tilda.center updated the diff for D54359: sound: Add kqueue support to MIDI.

Use lock instead of qlock which will be removed in the future.

Dec 26 2025, 1:32 AM

Dec 25 2025

meka_tilda.center requested review of D54360: sound examples: Add MIDI kqueue example.
Dec 25 2025, 12:45 AM
meka_tilda.center added inline comments to D54359: sound: Add kqueue support to MIDI.
Dec 25 2025, 12:41 AM
meka_tilda.center requested review of D54359: sound: Add kqueue support to MIDI.
Dec 25 2025, 12:39 AM

Dec 18 2025

meka_tilda.center added a comment to D53749: sound examples: Add mmap example.

The official example at http://manuals.opensound.com/developer/mmap_test.c.html uses 50ms but that proved to be too much, probably because oss_init() sets low sized buffer. I'm not sure how to derive the number of microseconds to sleep, I just used the value that worked for me. I even tried experimenting with different values, but I have no idea how to get to a value that is based on some facts or measurement.

Dec 18 2025, 10:57 PM

Dec 17 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Reverting to a version which just waits for 0.4ms between iterations. I ran this program for ~100 times on my desktop and it didn't produce any glitches. Should I remove verbose or leave it as it is?

Dec 17 2025, 1:50 PM

Dec 16 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Calculate the amount of microseconds to sleep, but keep it in the range between 400 and 800 microseconds. Position is not updated continuously, but at some frequency. That means that value we get from ioctl can not be trusted to be accurate, which is the reason to limit the maximum duration of the sleep. The minimal duration of sleep is put in place so the code doesn't call ioctl too often.

Dec 16 2025, 7:12 PM

Dec 15 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Check if input and output config are the same by checking number of bytes and number of input/output channels. I had cases where input and output channel numbers are different, as well as difference in buffer_info.bytes when the number of input and output channels is the same. I'm afraid that handling all possible cases would make this example complicated, so I chose to write the code that insists that input and output configs are the same.

Dec 15 2025, 8:11 PM

Dec 11 2025

meka_tilda.center added inline comments to D54038: sound examples: Check if setting property was successful.
Dec 11 2025, 8:02 PM

Dec 8 2025

meka_tilda.center updated the diff for D54038: sound examples: Check if setting property was successful.

Warn only if sample format/rate/channels were not set to desired values, but fail only in simple.c if the format is not the requested one.

Dec 8 2025, 5:08 PM

Dec 6 2025

meka_tilda.center added inline comments to D54038: sound examples: Check if setting property was successful.
Dec 6 2025, 3:54 PM
meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Lowering usleep time and checking if ci.ptr is zero made all the glitches in the sound go away. I do need to run it for quite a few times to validate that, but in the worst case I significantly lowered the probability of gibberish on the output. Next, I need to calculate the usleep time based on ci.ptr.

Dec 6 2025, 2:23 AM

Dec 5 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

The usleep based mmap example based on official OSS example. There are three big things about it right now that make it not-so-perfect:

Dec 5 2025, 6:50 PM
meka_tilda.center added a comment to D53749: sound examples: Add mmap example.

I think I'll try my luck with http://manuals.opensound.com/developer/mmap_test.c.html first and fit it into our example and once the usleep version works, see what are the values of ptr compared to the ones in kqueue scenario. My thinking is "if I can't fix it, move to simpler example", which I'm hoping the official docs are. Anyway, I didn't give up on this code, I just need to approach it from the different angle, for now.

Dec 5 2025, 3:11 AM

Dec 4 2025

meka_tilda.center added inline comments to D54038: sound examples: Check if setting property was successful.
Dec 4 2025, 4:21 PM
meka_tilda.center added inline comments to D54038: sound examples: Check if setting property was successful.
Dec 4 2025, 3:35 PM
meka_tilda.center updated the diff for D54038: sound examples: Check if setting property was successful.

Give more info on failed set attempt

Dec 4 2025, 3:14 PM
meka_tilda.center updated the diff for D54038: sound examples: Check if setting property was successful.

Fix copy/paste typo.

Dec 4 2025, 11:30 AM
meka_tilda.center updated the diff for D54038: sound examples: Check if setting property was successful.

Check sample format, rate and channels after they are set.

Dec 4 2025, 11:29 AM

Dec 3 2025

meka_tilda.center updated the diff for D54038: sound examples: Check if setting property was successful.

Check sample rate and format after ioctl call. While here, print sample size and number of channels of configured device.

Dec 3 2025, 11:16 AM

Dec 2 2025

meka_tilda.center added a comment to D53749: sound examples: Add mmap example.

I am looking into the code in general and I want to figure out how to display information so it makes more sense, not just dump printf.

Dec 2 2025, 7:21 PM
meka_tilda.center requested review of D54038: sound examples: Check if setting property was successful.
Dec 2 2025, 7:20 PM

Nov 28 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Rebase after oss.h fix

Nov 28 2025, 3:13 PM

Nov 26 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Remove needless include

Nov 26 2025, 8:01 PM
meka_tilda.center requested review of D53939: sound examples: Fix buffer mapping/allocation.
Nov 26 2025, 6:43 PM

Nov 20 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Map or allocate buffer in oss_init. For some reason with this patch probability of producing proper sound is way higher. I still have to add GETIPTR/GETOPTR checks and usleep based on the position.

Nov 20 2025, 4:12 PM
meka_tilda.center added a comment to D53749: sound examples: Add mmap example.

Let me try to compensate the drift by reading SNDCTL_DSP_GETIPTR and SNDCTL_DSP_GETOPTR and experiment with that for a bit.

Nov 20 2025, 3:12 PM

Nov 19 2025

meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

I forgot to edit Makefile. Fixed now.

Nov 19 2025, 4:24 PM
meka_tilda.center updated the diff for D53749: sound examples: Add mmap example.

Remove extra functions as they are very simple

Nov 19 2025, 3:40 PM
meka_tilda.center added a comment to D53749: sound examples: Add mmap example.

That's the strange thing. If I run it 20-30 times, I would get roughly half of the times distorted sound, half of the times normal sound. Also, I tried having one config and two events for read and write, but I couldn't produce any sound like that. Anyway, let me fix this example to conform to the comments and lets go from there.

Nov 19 2025, 3:18 PM

Nov 14 2025

meka_tilda.center added reviewers for D53749: sound examples: Add mmap example: christos, dev_submerge.ch.
Nov 14 2025, 12:39 AM
meka_tilda.center requested review of D53749: sound examples: Add mmap example.
Nov 14 2025, 12:39 AM

Nov 12 2025

meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I tested simple, select and poll on the real hardware. As that machine is not running CURRENT, I can't test kqueue. @christos, do you have any means on testing it on real hardware? I tried to test it in bhyve with -s 6,hda,play=/dev/dsp,rec=/dev/dsp but none of the examples work properly that way.

Nov 12 2025, 7:10 PM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Reword comments and fix Makefile

Nov 12 2025, 12:34 PM
meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I already fixed those as well as share/examples/Makefile, I just want to check if everything is working, and that has to wait for my day job to finish.

Nov 12 2025, 11:50 AM

Nov 11 2025

meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I just realized I copy/pasted the same first license comment everywhere. Can you tell me what should I put in the "Copyright" lines, please?

Nov 11 2025, 3:41 PM
meka_tilda.center abandoned D36795: Example of audio/MIDI with select(2), poll(2) and kqueue(2).
Nov 11 2025, 3:39 PM

Nov 10 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Improve comment regarding usage of interleaved format and channels.

Nov 10 2025, 9:48 PM
meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I tested all examples with real hardware. Well, all except kqueue, as the machine with the actual hardware is 14.3 based.

Nov 10 2025, 9:36 PM
meka_tilda.center added inline comments to D53353: sound examples: Extend and clean up.
Nov 10 2025, 9:34 PM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Fix to_channels and to_interleaved and address other comments.

Nov 10 2025, 9:33 PM

Nov 9 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Move contents of README into comments, mostly in oss.h

Nov 9 2025, 9:14 PM

Nov 8 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

More cleanup from old example

Nov 8 2025, 5:10 PM
meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I just remembered one more comment I can't find. It is about setting fragments. I'd like to leave it there and in the comments mention that setting fragments is optional. I'd like to have a full examples so people interested in sound don't have to wonder how things are done. To be honest, official OSS documentation could use some improvement. At least I found it hard to understand what exactly I need to do.

Nov 8 2025, 1:01 PM

Nov 7 2025

meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

I hope I found all comments. It was not obvious I would have to click on a line number beside comment to get old comments.

Nov 7 2025, 12:09 PM

Nov 6 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

I missed old comments as I moved files from oss directory. It took me a while to realize how to read them. Sorry for the noise.

Nov 6 2025, 11:11 PM

Nov 3 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

I really hope this is OK way to handle 24 bits.

Nov 3 2025, 5:35 PM

Nov 2 2025

meka_tilda.center added a comment to D53353: sound examples: Extend and clean up.

The directory where these files live is "oss". As everything is about OSS in "sound" directory, should I perhaps rename oss to audio? My reasoning is that there are audio and MIDI examples that we can show, so "oss" is a bit missleading. Or maybe have share/examples/oss and audio and midi under it? Anyway, when I started writing the examples I only wrote audio part, so "sound" was appropriate, which probably isn't the case any more.

Nov 2 2025, 11:57 AM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Use per-config buffer.

Nov 2 2025, 11:48 AM

Nov 1 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Address the rest of the comments (without moving README to comments).

Nov 1 2025, 5:26 PM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

I hope I addressed all the comments except showing example for both polling directions and readme. I think if a person understands polling in one direction, it is easy to extrapolate how to work with two directions. As these are examples, not complete guides, I would argue that this is good enough, especially in kqueue case where both directions would create two events and example would become more complicated. As I do plan to add mmap example once this is merged, that example will have input device and output device so even that configuration will be shown, I just don't think that all examples should split the sound card into two directions. As for the readme, good catch, I didn't think of that, but let's make the code in the examples good and I'll change the readme to correspond to those changes.

Nov 1 2025, 12:05 PM
meka_tilda.center retitled D53353: sound examples: Extend and clean up from sound: Extend examples with polling mechanisms to sound examples: Extend and clean up.
Nov 1 2025, 11:35 AM

Oct 31 2025

meka_tilda.center added inline comments to D53353: sound examples: Extend and clean up.
Oct 31 2025, 10:39 PM
meka_tilda.center added inline comments to D53353: sound examples: Extend and clean up.
Oct 31 2025, 10:29 PM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Add triggering.

Oct 31 2025, 3:50 PM

Oct 25 2025

meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

One more wrong device fixed

Oct 25 2025, 9:08 PM
meka_tilda.center updated the diff for D53353: sound examples: Extend and clean up.

Use default DSP device

Oct 25 2025, 9:07 PM
meka_tilda.center requested review of D53353: sound examples: Extend and clean up.
Oct 25 2025, 6:46 PM

Oct 22 2025

meka_tilda.center added inline comments to D53188: sound tests: Test polling.
Oct 22 2025, 12:15 PM