comedi_buf_write_samples(9)
π comedi_buf_write_samples(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes, the actual kernel API manual, and yes, this page is about comedi_buf_write_samples(9) and it's lowkey iconic. Sit down, grab a strawberry π, let's get into it.
β¨ NAME β¨
comedi_buf_write_samples β write sample data to the COMEDI buffer π
π¦ SYNOPSIS π¦
unsigned int comedi_buf_write_samples (struct comedi_subdevice *s ,
const void *data , unsigned int nsamples );
like, that's the whole signature, no cap. π
πΈ ARGUMENTS πΈ
sβ the COMEDI subdevice. it's the main character here, honestly πdataβ pointer to the source samples. this is where the good stuff lives π«Άnsamplesβ number of samples to write. like, how many you wanna send β¨
π DESCRIPTION π
so here's the vibe: this function writes up to nsamples samples into the COMEDI acquisition data buffer that's associated with the subdevice. it marks the buffer as written, and it updates the acquisition scan progress too. multitasking queen π
but wait β plot twist π β if there isn't enough room for the number of samples you asked for, the number of samples actually written gets limited to whatever will fit. and then the COMEDI_CB_OVERFLOW event flag gets set, which causes the acquisition to terminate with an overrun error. it's giving dramatic exit π not a drill, that's literally what happens.
also: set the COMEDI_CB_BLOCK event flag if any samples are written β that's what causes waiting tasks to be woken when the event flags are processed. wake up besties, data's here π
β RETURN β
the amount of data written, measured in bytes. that's it, that's the return value π
π§ SEE ALSO π§
kernel file ./drivers/comedi/comedi_buf.c, plus these besties right here:
comedi_buf_write_alloc(9)comedi_buf_write_free(9)comedi_buf_read_n_available(9)comedi_buf_read_alloc(9)comedi_buf_read_free(9)comedi_buf_read_samples(9)
go read them, iykyk ππ
fr fr keep the overflow thing in mind β that overrun error is real and it will end your acquisition. stay safe out there π
and that's the page! π¦ big ups to ./drivers/comedi, dated October 2026, for the source/version β and the page itself is comedi_buf_write_samples(9), slay, periodt. πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms