Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to stream on for some special test #553

Closed
sanbrother opened this issue Sep 26, 2023 · 0 comments
Closed

Failed to stream on for some special test #553

sanbrother opened this issue Sep 26, 2023 · 0 comments
Assignees
Labels
needs triage new issues

Comments

@sanbrother
Copy link
Contributor

Step 2: Describe your environment

  • v4l2loopback version: 0x0006020d

      commit: 5bb9bed4e2a34761dc5dc188faec7315ae3930fe
    
  • kernel version: Linux MagicBookPro 6.2.0-26-generic building and installing on opensuse 12.2 (64 bit) #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

  • Distribution (+version): _____

      No LSB modules are available.
      Distributor ID:	Ubuntu
      Description:	Ubuntu 22.04.3 LTS
      Release:	22.04
      Codename:	jammy
    

Step 3: Describe the problem:

Steps to reproduce:

  1. Reload the module
    sudo modprobe -r v4l2loopback && sudo modprobe v4l2loopback video_nr=10,11 max_buffers=8
  2. Poll some event
# V4L2_EVENT_PRI_CLIENT_USAGE => 283115521
v4l2-ctl --poll-for-event=283115521 -d /dev/video10
  1. Run test app
./producer -d /dev/video10

Observed Results:

VIDIOC_STREAMON error 22, Invalid argument

Relevant Code:

	if (dev->image) {
		dprintk("allocating buffers again: %ld %ld\n",
			dev->buffer_size * dev->buffers_number, dev->imagesize);
		/* FIXME: prevent double allocation more intelligently! */
		if (dev->buffer_size * dev->buffers_number == dev->imagesize)
			return 0;

		/* if there is only one writer, no problem should occur */
		if (dev->open_count.counter == 1)
			free_buffers(dev);
		else
			return -EINVAL;
	}

I guess, v4l2-ctl makes counter == 1, and then the producer increases it to 2.
So, EINVAL is returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage new issues
Projects
None yet
Development

No branches or pull requests

2 participants