vodunvibe
August 31st, 2006, 04:17 AM
Spca5xx
The spca5xx driver included in the Dapper Drake (6.06) Ubuntu kernel works out of the box for most people, as it has been the case for myself until recently when I tried using my Webcam on an my other computers.
Unfortunately for some, trying to use their camera with the spca5xx driver when other USB devices are present on the same host controller bus as the camera, the following error appear:
No space left on device
can't open /dev/video0: No space left on device.
I have a Logitech QuickCam Communicate STX and an hp USB Multimedia Cordless Kit with a wireless keyboard and wireless mouse connected to the same host controller as my camera which. I also had the same error message as a result of this configuration.
The spca5xx driver supports a variety of cameras. For a full list of supported cameras, take a look at http://mxhaard.free.fr/spca5xx.html
Problem
When other USB devices are present on the same host controller bus as the camera, the bandwidth requirements of the spca5xx driver are not being met, with some hardware configurations. The spca5xx driver is asking for more bandwidth than is available which results in the following error messages:
No space left on device
can't open /dev/video0: No space left on device.
There is a very good howto for the Spca5xx driver at https://help.ubuntu.com/community/Spca5xx
if you haven't encountered the “No space left on device” error message.
Solutions
There are multiple solutions which will work depending on your hardware configuration.
Please be advised that it is best to connect the camera directly to the motherboard and not use a USB HUB.
The only solution which worked in my particular situation, was to dig into the spca5xx source code (spca5xx-20060501 (http://mxhaard.free.fr/spca50x/Download/spca5xx-20060501.tar.gz)) and modify it by adding a fix, due to the fact that no matter which USB port I used, my camera always appeared on the same host controller bus as my USB keyboard and mouse.
If you've already unsuccessfully shuffled your USB devices from port to port, you might want to skip ahead to Solution 2 and compile and install the modified spca5xx source code.
Solution 1 - Put the camera on a separate USB host controller bus.
Solution 2 - Compile and install the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906).
Solution 3 - Buy an separate USB controller card. (This is a last resort solution which I wanted to avoid at all cost.)
Solution 1 - Put the camera on a separate USB host controller bus
Try to put the camera on a separate USB host controller bus with no other devices on it.
(Assuming you don't have a USB keyboard and USB mouse. If you do skip to the next section)
Unplug all other USB devices from your computer, leaving only the camera.
If the camera works, then you need to figure out which USB ports are connected to which controller. You need to use your other USB devices after all. Experiment by connecting your other USB devices one by one to another USB port and see if the camera still works. If the camera stops working after connecting a device it means that the port you just used is on the same USB host controller bus as you camera.
If after trying different combination of USB ports, you are not successful, try one of the following solutions.
Solution 1 - Put the camera on a separate USB host controller bus (USB keyboard and USB mouse)
Try to put the camera on a separate USB host controller bus with no other devices on it.
(If you can find a set PS/2 keyboard and mouse, try the above solution if not continue)
Unplug all other USB devices from your computer, leaving only the camera and USB keyboard or only the camera and USB mouse, not both.
If the camera doesn't work, experiment by connecting the camera to another USB port. Try all the other ports until you find one that works.
If the camera works, then you need to figure out which USB ports are connected to which controller. You need to use your other USB devices after all. Experiment by connecting your other USB devices one by one to another USB port and see if the camera still works. If the camera stops working after connecting a device it means that the port you just used is on the same USB host controller bus as you camera.
If the camera still doesn't work, please do not despair. Try the following solution.
Solution 2 - Compile the modified spca5xx source code.
The fix works by gradually lowering the bandwidth requirements of the driver (spca5xx-20060501) and works even when other USB devices are present on the same host controller bus as the camera.
Then same method can also be used to resolve the same issue on the qc-usb QuickCam Express Driver.
The new driver will be installed at this location (kernel 2.6 +): /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
The new driver will be installed at this location (kernel 2.4): /lib/modules/`uname -r`/kernel/drivers/usb/
Please use one of the following 3 options:
Automated Installation Script
Manual Installation
Patch
Automated Installation Script
Download the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) and save it on your desktop.
Download the script (http://ubuntuforums.org/attachment.php?attachmentid=15348&stc=1&d=1157486121) or copy and paste it in a new file and save it on your desktop.
If you downloaded the script (http://ubuntuforums.org/attachment.php?attachmentid=15348&stc=1&d=1157486121) extract it from the archive using:
tar xfvz spca5xxvodunvibeFixScript.tar.gz
Execute the script on your desktop or in the same directory as the archive spca5xx-20060501vodunvibeFix.tar.gz
./spca5xxvodunvibeFix
#!/bin/sh
#spca5xxvodunvibeFix
#
# This Script to automatically installs spca5xxvodunvibeFix
#
## Exit if any command does not complete successfully.
#set -o errexit
#trap 'echo "The previous command did not complete successfully. "' ERR
echo "This script will extract and install spca5xx-20060501vodunvibeFix.tar.gz"
echo -e "\nThe following will also be downloaded and installed:"
echo "linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc"
echo "This script has been tested on Ubuntu Breezy Badger (5.10) and Dapper Drake (6.06)."
echo -e "\nPress enter to continue. CTRL-C to abort"
read
if grep -q "5.10" /etc/issue ; then
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc-3.4
export CC=gcc-3.4
else
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc
fi
KERNEL_VERSION=`uname -r`
MODULE_INSTALLDIR=/lib/modules/$KERNEL_VERSION/kernel/drivers/media/video/spca5xx
if [ -d /lib/modules/`uname -r`/build ]
then
echo "The link Exists"
else
echo "Creating link"
ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
fi
#Move the modified spca5xx source code from your home directory to /usr/src
cd /usr/src
sudo mv ~/Desktop/spca5xx-20060501vodunvibeFix.tar.gz .
#Extract it from the archive:
sudo tar xfvz spca5xx-20060501vodunvibeFix.tar.gz
cd spca5xx-20060501vodunvibeFix
#Compile the spca5xx source code
sudo make clean
sudo make
#Remove the old driver from memory
sudo modprobe -r spca5xx
echo -e "\nBacking up current spca5xx.ko kernel module\n"
#Backup the current spca5xx.ko kernel module
sudo cp -p $MODULE_INSTALLDIR/spca5xx.ko $MODULE_INSTALLDIR/spca5xx.ko.`date -Iseconds`
#Install the new driver at this location /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
sudo make install
#Load the new driver
sudo modprobe spca5xx
#Check dmesg and the system logs for errors
dmesg
echo spca5xxvodunvibeFix Finished!
read
Manual Installation
Download the necessary packages.
To compile the drivers we need to make sure that the following packages are installed from the Ubuntu repositories:
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc
If you are using Ubuntu Breezy Badger (5.10) you need gcc 3.4:
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc-3.4
export CC=gcc-3.4
Create a link to the kernel source if it does not exist.
sudo ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
Download the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) and save it on your desktop.
Move the modified spca5xx-20060501vodunvibeFix.tar.gz (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) from your home directory to /usr/src
cd /usr/src
sudo mv ~/Desktop/spca5xx-20060501vodunvibeFix.tar.gz .
Extract the files from the archive.
sudo tar xfvz spca5xx-20060501vodunvibeFix.tar.gz
Enter the directory.
cd spca5xx-20060501vodunvibeFix
Compile the spca5xx source code.
sudo make clean
sudo make
Remove the old driver from memory.
sudo modprobe -r spca5xx
Backup the current spca5xx.ko kernel module.
sudo cp -p /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/spca5xx.ko /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/spca5xx.ko.`date -Iseconds`
Install the new driver at this location: /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
sudo make install
Load the new driver.
sudo modprobe spca5xx
Check dmesg and the system logs for errors.
dmesg
tail -f /var/log/syslog
Enjoy your webcam.
Patch
The more experienced users can use the following patch (http://ubuntuforums.org/attachment.php?attachmentid=15349&stc=1&d=1157486121) and perform a manual installation.
To apply the patch from your current working directory, with a subdirectory called spca5xx-20060501 use:
patch -p0 < spca5xx-20060501-vodunvibe-Nospaceleftondevice.patch
To apply the patch, in the spca5xx-20060501 directory use:
patch -p1 < spca5xx-20060501-vodunvibe-Nospaceleftondevice.patch
This patch is currently against the spca5xx-20060501 (http://mxhaard.free.fr/spca50x/Download/spca5xx-20060501.tar.gz) source.
diff -urN spca5xx-20060501.orig/drivers/usb/spca5xx.c spca5xx-20060501/drivers/usb/spca5xx.c
--- spca5xx-20060501.orig/drivers/usb/spca5xx.c 2006-04-29 11:38:07.000000000 -0400
+++ spca5xx-20060501/drivers/usb/spca5xx.c 2006-09-05 13:19:04.000000000 -0400
@@ -1574,6 +1574,66 @@
spca50x->funct.stopN(spca50x);
}
+
+/************************************************** ********************
+* spcaReducePacketSize
+* Function Fixes the bandwidth problem that occurs
+* when other USB devices are on the same host controller bus as the
+* camera by gradually lowering the bandwidth requirements of the driver.
+* It works even when other USB devices are present on the same
+* host controller bus as the camera.
+*
+* Problem
+* When other USB devices are present on the same host controller
+* bus as the camera, the bandwidth requirements of the spca5xx driver
+* are not being met. The spca5xx driver is asking for more bandwidth
+* than is available which results in the following error messages:
+*
+* No space left on device
+* can't open /dev/video0: No space left on device.
+* usb_submit_urb(0) ret -28
+*
+*
+* Many thanks to all the wonderful people contributing to this project.
+*
+* Great work!
+* vodunvibe [AT] NO@SPAM.PLEASE yahoo DOT com
+* 2006-08-27
+*
+************************************************* **********************/
+static int spcaReducePacketSize(struct usb_spca50x *spca50x, int n, int err)
+{
+ int size=896, fx, i;
+ err("spcaReducePacketSize: vodunvibe - The usb_submit_urb(%d) transfer request submission failed - You probably have another device sharing the same USB Host Controller Bus as your camera. Try using another USB port, on a different host controller bus.", n);
+ while (err == -ENOSPC && size >= 0) {
+ err("spcaReducePacketSize: vodunvibe - Lowering the bandwidth requirements - New packet size (%d) ", size);
+ spca50x_set_packet_size(spca50x, size);
+ spca50x->sbuf[n].urb->transfer_buffer_length = spca50x->packet_size * FRAMES_PER_DESC;
+ for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
+ spca50x->sbuf[n].urb->iso_frame_desc[fx].offset = spca50x->packet_size * fx;
+ spca50x->sbuf[n].urb->iso_frame_desc[fx].length = spca50x->packet_size;
+ }
+ size-=128;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
+ err = usb_submit_urb(spca50x->sbuf[n].urb, GFP_KERNEL);
+#else
+ err = usb_submit_urb(spca50x->sbuf[n].urb);
+#endif
+ }
+
+ if (!err) {
+ for (i = 0; i < SPCA50X_NUMSBUF; i++) {
+ spca50x->sbuf[i].urb->transfer_buffer_length = spca50x->packet_size * FRAMES_PER_DESC;
+ for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
+ spca50x->sbuf[i].urb->iso_frame_desc[fx].offset = spca50x->packet_size * fx;
+ spca50x->sbuf[i].urb->iso_frame_desc[fx].length = spca50x->packet_size;
+ }
+ }
+ }
+ return err;
+}
+
+
static int spca50x_init_isoc(struct usb_spca50x *spca50x)
{
@@ -1649,7 +1709,15 @@
#endif
if (err) {
err("init isoc: usb_submit_urb(%d) ret %d", n, err);
- return err;
+ if (err == -ENOSPC) {
+ err = spcaReducePacketSize(spca50x, n, err);
+ if (err) {
+ err("init isoc: After spcaReducePacketSize - usb_submit_urb(%d) ret %d", n, err);
+ return err;
+ }
+ }else{
+ return err;
+ }
}
}
Many thanks to all the wonderful people contributing to this project.
The spca5xx driver included in the Dapper Drake (6.06) Ubuntu kernel works out of the box for most people, as it has been the case for myself until recently when I tried using my Webcam on an my other computers.
Unfortunately for some, trying to use their camera with the spca5xx driver when other USB devices are present on the same host controller bus as the camera, the following error appear:
No space left on device
can't open /dev/video0: No space left on device.
I have a Logitech QuickCam Communicate STX and an hp USB Multimedia Cordless Kit with a wireless keyboard and wireless mouse connected to the same host controller as my camera which. I also had the same error message as a result of this configuration.
The spca5xx driver supports a variety of cameras. For a full list of supported cameras, take a look at http://mxhaard.free.fr/spca5xx.html
Problem
When other USB devices are present on the same host controller bus as the camera, the bandwidth requirements of the spca5xx driver are not being met, with some hardware configurations. The spca5xx driver is asking for more bandwidth than is available which results in the following error messages:
No space left on device
can't open /dev/video0: No space left on device.
There is a very good howto for the Spca5xx driver at https://help.ubuntu.com/community/Spca5xx
if you haven't encountered the “No space left on device” error message.
Solutions
There are multiple solutions which will work depending on your hardware configuration.
Please be advised that it is best to connect the camera directly to the motherboard and not use a USB HUB.
The only solution which worked in my particular situation, was to dig into the spca5xx source code (spca5xx-20060501 (http://mxhaard.free.fr/spca50x/Download/spca5xx-20060501.tar.gz)) and modify it by adding a fix, due to the fact that no matter which USB port I used, my camera always appeared on the same host controller bus as my USB keyboard and mouse.
If you've already unsuccessfully shuffled your USB devices from port to port, you might want to skip ahead to Solution 2 and compile and install the modified spca5xx source code.
Solution 1 - Put the camera on a separate USB host controller bus.
Solution 2 - Compile and install the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906).
Solution 3 - Buy an separate USB controller card. (This is a last resort solution which I wanted to avoid at all cost.)
Solution 1 - Put the camera on a separate USB host controller bus
Try to put the camera on a separate USB host controller bus with no other devices on it.
(Assuming you don't have a USB keyboard and USB mouse. If you do skip to the next section)
Unplug all other USB devices from your computer, leaving only the camera.
If the camera works, then you need to figure out which USB ports are connected to which controller. You need to use your other USB devices after all. Experiment by connecting your other USB devices one by one to another USB port and see if the camera still works. If the camera stops working after connecting a device it means that the port you just used is on the same USB host controller bus as you camera.
If after trying different combination of USB ports, you are not successful, try one of the following solutions.
Solution 1 - Put the camera on a separate USB host controller bus (USB keyboard and USB mouse)
Try to put the camera on a separate USB host controller bus with no other devices on it.
(If you can find a set PS/2 keyboard and mouse, try the above solution if not continue)
Unplug all other USB devices from your computer, leaving only the camera and USB keyboard or only the camera and USB mouse, not both.
If the camera doesn't work, experiment by connecting the camera to another USB port. Try all the other ports until you find one that works.
If the camera works, then you need to figure out which USB ports are connected to which controller. You need to use your other USB devices after all. Experiment by connecting your other USB devices one by one to another USB port and see if the camera still works. If the camera stops working after connecting a device it means that the port you just used is on the same USB host controller bus as you camera.
If the camera still doesn't work, please do not despair. Try the following solution.
Solution 2 - Compile the modified spca5xx source code.
The fix works by gradually lowering the bandwidth requirements of the driver (spca5xx-20060501) and works even when other USB devices are present on the same host controller bus as the camera.
Then same method can also be used to resolve the same issue on the qc-usb QuickCam Express Driver.
The new driver will be installed at this location (kernel 2.6 +): /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
The new driver will be installed at this location (kernel 2.4): /lib/modules/`uname -r`/kernel/drivers/usb/
Please use one of the following 3 options:
Automated Installation Script
Manual Installation
Patch
Automated Installation Script
Download the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) and save it on your desktop.
Download the script (http://ubuntuforums.org/attachment.php?attachmentid=15348&stc=1&d=1157486121) or copy and paste it in a new file and save it on your desktop.
If you downloaded the script (http://ubuntuforums.org/attachment.php?attachmentid=15348&stc=1&d=1157486121) extract it from the archive using:
tar xfvz spca5xxvodunvibeFixScript.tar.gz
Execute the script on your desktop or in the same directory as the archive spca5xx-20060501vodunvibeFix.tar.gz
./spca5xxvodunvibeFix
#!/bin/sh
#spca5xxvodunvibeFix
#
# This Script to automatically installs spca5xxvodunvibeFix
#
## Exit if any command does not complete successfully.
#set -o errexit
#trap 'echo "The previous command did not complete successfully. "' ERR
echo "This script will extract and install spca5xx-20060501vodunvibeFix.tar.gz"
echo -e "\nThe following will also be downloaded and installed:"
echo "linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc"
echo "This script has been tested on Ubuntu Breezy Badger (5.10) and Dapper Drake (6.06)."
echo -e "\nPress enter to continue. CTRL-C to abort"
read
if grep -q "5.10" /etc/issue ; then
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc-3.4
export CC=gcc-3.4
else
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc
fi
KERNEL_VERSION=`uname -r`
MODULE_INSTALLDIR=/lib/modules/$KERNEL_VERSION/kernel/drivers/media/video/spca5xx
if [ -d /lib/modules/`uname -r`/build ]
then
echo "The link Exists"
else
echo "Creating link"
ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
fi
#Move the modified spca5xx source code from your home directory to /usr/src
cd /usr/src
sudo mv ~/Desktop/spca5xx-20060501vodunvibeFix.tar.gz .
#Extract it from the archive:
sudo tar xfvz spca5xx-20060501vodunvibeFix.tar.gz
cd spca5xx-20060501vodunvibeFix
#Compile the spca5xx source code
sudo make clean
sudo make
#Remove the old driver from memory
sudo modprobe -r spca5xx
echo -e "\nBacking up current spca5xx.ko kernel module\n"
#Backup the current spca5xx.ko kernel module
sudo cp -p $MODULE_INSTALLDIR/spca5xx.ko $MODULE_INSTALLDIR/spca5xx.ko.`date -Iseconds`
#Install the new driver at this location /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
sudo make install
#Load the new driver
sudo modprobe spca5xx
#Check dmesg and the system logs for errors
dmesg
echo spca5xxvodunvibeFix Finished!
read
Manual Installation
Download the necessary packages.
To compile the drivers we need to make sure that the following packages are installed from the Ubuntu repositories:
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc
If you are using Ubuntu Breezy Badger (5.10) you need gcc 3.4:
sudo apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc-3.4
export CC=gcc-3.4
Create a link to the kernel source if it does not exist.
sudo ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
Download the modified spca5xx source code (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) and save it on your desktop.
Move the modified spca5xx-20060501vodunvibeFix.tar.gz (http://ubuntuforums.org/attachment.php?attachmentid=15350&stc=1&d=1157487906) from your home directory to /usr/src
cd /usr/src
sudo mv ~/Desktop/spca5xx-20060501vodunvibeFix.tar.gz .
Extract the files from the archive.
sudo tar xfvz spca5xx-20060501vodunvibeFix.tar.gz
Enter the directory.
cd spca5xx-20060501vodunvibeFix
Compile the spca5xx source code.
sudo make clean
sudo make
Remove the old driver from memory.
sudo modprobe -r spca5xx
Backup the current spca5xx.ko kernel module.
sudo cp -p /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/spca5xx.ko /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/spca5xx.ko.`date -Iseconds`
Install the new driver at this location: /lib/modules/`uname -r`/kernel/drivers/media/video/spca5xx/
sudo make install
Load the new driver.
sudo modprobe spca5xx
Check dmesg and the system logs for errors.
dmesg
tail -f /var/log/syslog
Enjoy your webcam.
Patch
The more experienced users can use the following patch (http://ubuntuforums.org/attachment.php?attachmentid=15349&stc=1&d=1157486121) and perform a manual installation.
To apply the patch from your current working directory, with a subdirectory called spca5xx-20060501 use:
patch -p0 < spca5xx-20060501-vodunvibe-Nospaceleftondevice.patch
To apply the patch, in the spca5xx-20060501 directory use:
patch -p1 < spca5xx-20060501-vodunvibe-Nospaceleftondevice.patch
This patch is currently against the spca5xx-20060501 (http://mxhaard.free.fr/spca50x/Download/spca5xx-20060501.tar.gz) source.
diff -urN spca5xx-20060501.orig/drivers/usb/spca5xx.c spca5xx-20060501/drivers/usb/spca5xx.c
--- spca5xx-20060501.orig/drivers/usb/spca5xx.c 2006-04-29 11:38:07.000000000 -0400
+++ spca5xx-20060501/drivers/usb/spca5xx.c 2006-09-05 13:19:04.000000000 -0400
@@ -1574,6 +1574,66 @@
spca50x->funct.stopN(spca50x);
}
+
+/************************************************** ********************
+* spcaReducePacketSize
+* Function Fixes the bandwidth problem that occurs
+* when other USB devices are on the same host controller bus as the
+* camera by gradually lowering the bandwidth requirements of the driver.
+* It works even when other USB devices are present on the same
+* host controller bus as the camera.
+*
+* Problem
+* When other USB devices are present on the same host controller
+* bus as the camera, the bandwidth requirements of the spca5xx driver
+* are not being met. The spca5xx driver is asking for more bandwidth
+* than is available which results in the following error messages:
+*
+* No space left on device
+* can't open /dev/video0: No space left on device.
+* usb_submit_urb(0) ret -28
+*
+*
+* Many thanks to all the wonderful people contributing to this project.
+*
+* Great work!
+* vodunvibe [AT] NO@SPAM.PLEASE yahoo DOT com
+* 2006-08-27
+*
+************************************************* **********************/
+static int spcaReducePacketSize(struct usb_spca50x *spca50x, int n, int err)
+{
+ int size=896, fx, i;
+ err("spcaReducePacketSize: vodunvibe - The usb_submit_urb(%d) transfer request submission failed - You probably have another device sharing the same USB Host Controller Bus as your camera. Try using another USB port, on a different host controller bus.", n);
+ while (err == -ENOSPC && size >= 0) {
+ err("spcaReducePacketSize: vodunvibe - Lowering the bandwidth requirements - New packet size (%d) ", size);
+ spca50x_set_packet_size(spca50x, size);
+ spca50x->sbuf[n].urb->transfer_buffer_length = spca50x->packet_size * FRAMES_PER_DESC;
+ for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
+ spca50x->sbuf[n].urb->iso_frame_desc[fx].offset = spca50x->packet_size * fx;
+ spca50x->sbuf[n].urb->iso_frame_desc[fx].length = spca50x->packet_size;
+ }
+ size-=128;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
+ err = usb_submit_urb(spca50x->sbuf[n].urb, GFP_KERNEL);
+#else
+ err = usb_submit_urb(spca50x->sbuf[n].urb);
+#endif
+ }
+
+ if (!err) {
+ for (i = 0; i < SPCA50X_NUMSBUF; i++) {
+ spca50x->sbuf[i].urb->transfer_buffer_length = spca50x->packet_size * FRAMES_PER_DESC;
+ for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
+ spca50x->sbuf[i].urb->iso_frame_desc[fx].offset = spca50x->packet_size * fx;
+ spca50x->sbuf[i].urb->iso_frame_desc[fx].length = spca50x->packet_size;
+ }
+ }
+ }
+ return err;
+}
+
+
static int spca50x_init_isoc(struct usb_spca50x *spca50x)
{
@@ -1649,7 +1709,15 @@
#endif
if (err) {
err("init isoc: usb_submit_urb(%d) ret %d", n, err);
- return err;
+ if (err == -ENOSPC) {
+ err = spcaReducePacketSize(spca50x, n, err);
+ if (err) {
+ err("init isoc: After spcaReducePacketSize - usb_submit_urb(%d) ret %d", n, err);
+ return err;
+ }
+ }else{
+ return err;
+ }
}
}
Many thanks to all the wonderful people contributing to this project.