Bug 178722 - FreeBSD 9.1-STABLE r250561 breaks support for webcam Logitech C525
Summary: FreeBSD 9.1-STABLE r250561 breaks support for webcam Logitech C525
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 9.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-17 17:20 UTC by Jože Zobec
Modified: 2018-08-05 05:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jože Zobec 2013-05-17 17:20:00 UTC
Updates introduced in r250561 renedered my webcam unsupported. I use Logitech C525, which isn't listed on the tested devices, but it was working until now.

In this revision, problem is as follows. Upon plugging the camera in my computer, kernel keeps giving me these messages "ad infinitum" or at least until I unplug the camera:

..
 pcm6: detached
 ugen7.2: <vendor 0x046d> at asbus7
 uaudio0: <vendor 0x046d HD Webcam C525, class 239/2, rev 2.00/0.10,
 addr 2> on usbus7
 uaudio0: No playback.
 uaudio0: Record: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
 uaudio0: Record: 32000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
 uaudio0: Record: 24000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
 uaudio0: Record: 16000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
 uaudio: No MIDI squencer.
 pcm6: <USB audio> on uaudio0
 uaudio0: No HID volume keys found.
 ugen7.2: <vendor 0x046d> at usbus7 (disconnected)
 uaudio0: at uhub7, port4, addr 2 (disconnected)
 pcm6: detached
 ...

which then repeats itself.

In the healthy case, e.g. previous healthy revision, kernel message was

..
 ugen7.2: <vendor 0x046d> at usbus7
 uaudio0: <vendor 0x046d HD Webcam C525, class 239/2, rev 2.00/1.00,
 addr2> on usbus7
 uaudio: No playback.
 uaudio: Record: 48000 Hz, 1 ch, 16 bit S-LE PCM format, 2x8ms buffer.
 uaudio: No MIDI sequencer.
 pcm6: <USB audio> on uaudio0
 uaudio0: No HID volume keys found.

And there it stops, and the webcam works in Skype.

This problem persists for recent revisions.

My webcam was automatically identified and added to the devices as /dev/dsp6.0, but now it's not. I tried

# touch /dev/dsp6.0

but it didn't work, since the camera kept reconnecting in a loop. Problem persists for GENERIC kernel and for complete world.

My kernel configuration file:
https://github.com/jozzez1/miscConfig/blob/master/FreeBSD/root/STRIPPED

My /etc/make.conf
https://github.com/jozzez1/miscConfig/blob/master/FreeBSD/etc/make.conf

My /etc/src.conf
https://github.com/jozzez1/miscConfig/blob/master/FreeBSD/etc/src.conf

The changes between revisions 250560 and 250561, given by

# svn up -r 250561 /usr/src
U       /usr/src/sys/dev/sound/usb/uaudio.c
 U      /usr/src/sys/dev
 U      /usr/src/sys

I tried fixing it, thinking it can't be that hard and wanted to write my own patch, but when I checked

# svn diff -r 250560:250561 /usr/src

I realized this is a large file and there were many changes, so I was a bit discouraged.

How-To-Repeat: Updating 9.1-STABLE from r250560 to r250561 or any further revision, and trying to use the same camera (Logitech C525) will produce the same results.
Comment 1 dfilter service freebsd_committer 2013-05-18 08:03:15 UTC
Author: hselasky
Date: Sat May 18 07:03:06 2013
New Revision: 250763
URL: http://svnweb.freebsd.org/changeset/base/250763

Log:
  Fix issue with "Logitech Webcam C525":
  
  Set a valid alternate interface setting
  when enumerating USB audio devices else
  the device mentioned will not work like
  expected.
  
  PR:		usb/178722
  MFC after:	1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==============================================================================
--- head/sys/dev/sound/usb/uaudio.c	Sat May 18 05:48:46 2013	(r250762)
+++ head/sys/dev/sound/usb/uaudio.c	Sat May 18 07:03:06 2013	(r250763)
@@ -868,6 +868,7 @@ uaudio_attach(device_t dev)
 	struct usb_attach_arg *uaa = device_get_ivars(dev);
 	struct uaudio_softc *sc = device_get_softc(dev);
 	struct usb_interface_descriptor *id;
+	usb_error_t err;
 	device_t child;
 
 	sc->sc_play_chan.priv_sc = sc;
@@ -925,6 +926,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_play_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_play_chan.usb_alt[0].iface_index,
+		    sc->sc_play_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_play_chan.num_alt; x++) {
 			device_printf(dev, "Play: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
@@ -938,6 +952,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_rec_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_rec_chan.usb_alt[0].iface_index,
+		    sc->sc_rec_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_rec_chan.num_alt; x++) {
 			device_printf(dev, "Record: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 2 dfilter service freebsd_committer 2013-05-25 18:16:44 UTC
Author: hselasky
Date: Sat May 25 17:16:31 2013
New Revision: 250987
URL: http://svnweb.freebsd.org/changeset/base/250987

Log:
  MFC r250763 and r250765:
  Fix some USB audio device issues.
  
  PR:	usb/178722

Modified:
  stable/9/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/usb/uaudio.c
==============================================================================
--- stable/9/sys/dev/sound/usb/uaudio.c	Sat May 25 17:09:58 2013	(r250986)
+++ stable/9/sys/dev/sound/usb/uaudio.c	Sat May 25 17:16:31 2013	(r250987)
@@ -868,6 +868,7 @@ uaudio_attach(device_t dev)
 	struct usb_attach_arg *uaa = device_get_ivars(dev);
 	struct uaudio_softc *sc = device_get_softc(dev);
 	struct usb_interface_descriptor *id;
+	usb_error_t err;
 	device_t child;
 
 	sc->sc_play_chan.priv_sc = sc;
@@ -925,6 +926,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_play_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_play_chan.usb_alt[0].iface_index,
+		    sc->sc_play_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_play_chan.num_alt; x++) {
 			device_printf(dev, "Play: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
@@ -938,6 +952,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_rec_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_rec_chan.usb_alt[0].iface_index,
+		    sc->sc_rec_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_rec_chan.num_alt; x++) {
 			device_printf(dev, "Record: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
@@ -5565,7 +5592,6 @@ umidi_open(struct usb_fifo *fifo, int ff
 		}
 		/* clear stall first */
 		mtx_lock(&chan->mtx);
-		usbd_xfer_set_stall(chan->xfer[UMIDI_TX_TRANSFER]);
 		chan->write_open_refcount++;
 		sub->write_open = 1;
 
@@ -5664,9 +5690,6 @@ umidi_probe(device_t dev)
 
 	mtx_lock(&chan->mtx);
 
-	/* clear stall first */
-	usbd_xfer_set_stall(chan->xfer[UMIDI_RX_TRANSFER]);
-
 	/*
 	 * NOTE: At least one device will not work properly unless the
 	 * BULK IN pipe is open all the time. This might have to do
@@ -5771,8 +5794,11 @@ tr_setup:
 		break;
 
 	default:			/* Error */
+
+		DPRINTF("error=%s\n", usbd_errstr(error));
+
 		if (error != USB_ERR_CANCELLED) {
-			/* try clear stall first */
+			/* try to clear stall first */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 dfilter service freebsd_committer 2013-05-25 18:19:14 UTC
Author: hselasky
Date: Sat May 25 17:19:06 2013
New Revision: 250988
URL: http://svnweb.freebsd.org/changeset/base/250988

Log:
  MFC r250763 and r250765:
  Fix some USB audio device issues.
  
  PR:	usb/178722

Modified:
  stable/8/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/usb/   (props changed)

Modified: stable/8/sys/dev/sound/usb/uaudio.c
==============================================================================
--- stable/8/sys/dev/sound/usb/uaudio.c	Sat May 25 17:16:31 2013	(r250987)
+++ stable/8/sys/dev/sound/usb/uaudio.c	Sat May 25 17:19:06 2013	(r250988)
@@ -868,6 +868,7 @@ uaudio_attach(device_t dev)
 	struct usb_attach_arg *uaa = device_get_ivars(dev);
 	struct uaudio_softc *sc = device_get_softc(dev);
 	struct usb_interface_descriptor *id;
+	usb_error_t err;
 	device_t child;
 
 	sc->sc_play_chan.priv_sc = sc;
@@ -925,6 +926,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_play_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_play_chan.usb_alt[0].iface_index,
+		    sc->sc_play_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_play_chan.num_alt; x++) {
 			device_printf(dev, "Play: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
@@ -938,6 +952,19 @@ uaudio_attach(device_t dev)
 
 	if (sc->sc_rec_chan.num_alt > 0) {
 		uint8_t x;
+
+		/*
+		 * Need to set a default alternate interface, else
+		 * some USB audio devices might go into an infinte
+		 * re-enumeration loop:
+		 */
+		err = usbd_set_alt_interface_index(sc->sc_udev,
+		    sc->sc_rec_chan.usb_alt[0].iface_index,
+		    sc->sc_rec_chan.usb_alt[0].iface_alt_index);
+		if (err) {
+			DPRINTF("setting of alternate index failed: %s!\n",
+			    usbd_errstr(err));
+		}
 		for (x = 0; x != sc->sc_rec_chan.num_alt; x++) {
 			device_printf(dev, "Record: %d Hz, %d ch, %s format, "
 			    "2x8ms buffer.\n",
@@ -5565,7 +5592,6 @@ umidi_open(struct usb_fifo *fifo, int ff
 		}
 		/* clear stall first */
 		mtx_lock(&chan->mtx);
-		usbd_xfer_set_stall(chan->xfer[UMIDI_TX_TRANSFER]);
 		chan->write_open_refcount++;
 		sub->write_open = 1;
 
@@ -5664,9 +5690,6 @@ umidi_probe(device_t dev)
 
 	mtx_lock(&chan->mtx);
 
-	/* clear stall first */
-	usbd_xfer_set_stall(chan->xfer[UMIDI_RX_TRANSFER]);
-
 	/*
 	 * NOTE: At least one device will not work properly unless the
 	 * BULK IN pipe is open all the time. This might have to do
@@ -5771,8 +5794,11 @@ tr_setup:
 		break;
 
 	default:			/* Error */
+
+		DPRINTF("error=%s\n", usbd_errstr(error));
+
 		if (error != USB_ERR_CANCELLED) {
-			/* try clear stall first */
+			/* try to clear stall first */
 			usbd_xfer_set_stall(xfer);
 			goto tr_setup;
 		}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:59 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped