User Details
- User Since
- Jul 2 2021, 4:03 PM (194 w, 2 d)
Sat, Mar 22
Fri, Mar 21
So from a quick investigation, the problem with mmap seems to be the fact that the memory used by the mmap is actually a channel's buffer:
static int dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, int nprot) { ... *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); ... }
Which means that when we hot-swap, and as a result, we close the previous device's channels, the buffer also gets deleted. I am wondering what a solution to this could be while also avoiding overcomplicating things. Perhaps we could use global (i.e., not per-channel) buffers so that we can point each new device to them?
Do not ignore value from dsp_poll() in vdsp_poll(), otherwise we might block
there forever.
- bus_topo_lock() around uses of devclass_*().
- Pass the unit as argument to vdsp_getdev(). Will be useful in the follow-up patch.
Committed and created new tag: https://github.com/freebsd/virtual_oss/commit/6d7f60c21497989f1527465f5e9b493174ac9095
Thu, Mar 20
Wed, Mar 19
Fix 24-bit formats as well.
@mav @markj I have gotten down the functionality of splitting the default into playback and recording already, so I can confirm this is possible, but I still want to finalize this patch first before I submit the next one for review. The main problem currently is how we can trigger vdsp_getdev() from outside the cdevsw context, so that we can account for cases where an application may not call a cdevsw function for a while. Again, as I described in a previous comment, a possible scenario, which sounds a bit ugly IMHO, is to keep our own list of cdevprivs, so that we can fetch them whenever we want. I am not sure however if devfs_get_cdevpriv() would work in those cases, where the cdevsw function is triggered from outside the cdevsw context, though -- I'll need to test this. Do you have any ideas with regards to this?
Abandoning not exactly because of mav@'s comment per-se, but because I didn't realize that this patch could be problematic for people who plug into the headphone jack, but with headphones that do not have a microphone as well. I guess this is better set in /boot/device.hints.
Tue, Mar 18
Mon, Mar 17
New ALC257 patch: D49396
@wulf Is this change breaking something on your device?
Address Ed's comment.
Sat, Mar 15
Fri, Mar 14
Thu, Mar 13
Wed, Mar 12
Address Mark's comments.
Rebase.
Tue, Mar 11
Mon, Mar 10
Sat, Mar 8
Is this good to go?
Fri, Mar 7
- Address ziaee@'s man page comment.
- Restored hw.snd.basename_clone and dsp_clone(), but instead of cloning /dev/dsp${hw.snd.default_unit}, we are cloning vdsp_cdev, which is defined as /dev/vdsp. This way we preserve backwards compatibility with virtual_oss, since it can override /dev/dsp with its own. Update man page accordingly.
- Check whether the channels are not NULL, as opposed to checking priv->flags and assuming the channels will be non-NULL.
- Check for !DSP_REGISTERED() after acquiring the new cdevpriv in vdsp_getdev(), as well as in vdsp_open().
Thu, Mar 6
@dev_submerge.ch If I'm not mistaken, your sosso library works with mmap. Could the test case it has be of any use to make sure this patch doesn't break anything?
Reflect changes in D47932.
Reflect changes in D47932.
Return to __always_inline __unused. I think it is better to leave it like
that for now and avoid complicating the code base further.
With the exception of the latest comments I left last time, LGTM.
I think we should just go ahead with using __always_inline __unused for now.