Understanding the property "block-size" for elements "filesrc" and "filesink" w.r.t device files in Linux

vk_gst venkateshkuppan26 at gmail.com
Thu Sep 13 15:39:31 UTC 2018

Hallo again James,

I followed up your suggestions and have partial progress towards the steps
you mentioned. Please be prepared to read a long  observation list. :) 

1. Reading through the source code of elements 'filesink' and 'filesrc', I
see the following :
1.a.  filesink open is a normal 'open' system call, with no specific changes
for regular files or device files. The write operation first goes through
all the buffers and then writes it using the `write` system call to the file
descriptor. The mode of writing is binary.

1.b. filesrc - again 'open' and 'read' system calls. Open is performed in
read only and binary. First a 'fstat' is performed on the file to check if
its a regular file(for all other file types, the code emits an error, also
confusing for me as to device file is also considered as a regular file
here). Appropriate 'seek' is done for regular file and ignored for special

I do not see any usage of blocksize in the source code for filesink and
filesrc elements. I guess its being abstracted at some other level in the
GNOME system.

2. My server is an imx6 device(running debian) and it transmits video over
the serial port to the PC running Ubuntu. I ran strace over filesink for the
initial test and the results are in the attached files. I performed the
testing with block sizes configured to 4096 and 16384. However I do not
observe any changes in the strace output. 

Also the command for strace you mentioned did not work on imx6. I managed to
use the following command : 
strace write[/dev/ttyUSB0]  and the trace is attached in files. 

For the commands you mentioned, following are the outputs:
root at stretch-dev:/home/debian# strace -e write=5
strace: must have PROG [ARGS] or -p PID
Try 'strace -h' for more information.

Also the following commands produced the same error:
strace -e trace=write
strace -e trace=desc

I still need to perform it on filesrc, but I stopped since I do not see any
differences in the attached file, or may be I am interpreting it wrongly. 
Have a look and let me know what you think about it. 

I look forward for your suggestions/ideas.



Sent from: http://gstreamer-devel.966125.n4.nabble.com/

More information about the gstreamer-devel mailing list