Commit c744dff2 authored by Robert Krakora's avatar Robert Krakora Committed by Mauro Carvalho Chehab

V4L/DVB (10519): em28xx: Fix for em28xx audio startup

Essentially if a snd_em28xx_capture_trigger() stop followed by a snd_em28xx_capture_trigger() start would not yield any
data because there was some logic put in with an adev->shutdown variable which did not seem warranted in my humble opinion.
It would cause snd_em28xx_capture_trigger start never to start up the audio stream until the device was closed and
reopened again. Upon re-opening the device adev->shutdown is reset and audio data would again flow.
Signed-off-by: default avatarRobert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent aa5a1821
...@@ -152,9 +152,6 @@ static void em28xx_audio_isocirq(struct urb *urb) ...@@ -152,9 +152,6 @@ static void em28xx_audio_isocirq(struct urb *urb)
} }
urb->status = 0; urb->status = 0;
if (dev->adev.shutdown)
return;
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) { if (status < 0) {
em28xx_errdev("resubmit of audio urb failed (error=%i)\n", em28xx_errdev("resubmit of audio urb failed (error=%i)\n",
...@@ -340,13 +337,6 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) ...@@ -340,13 +337,6 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream)
em28xx_audio_analog_set(dev); em28xx_audio_analog_set(dev);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
dprintk("audio users: %d\n", dev->adev.users);
dprintk("disabling audio stream!\n");
dev->adev.shutdown = 0;
dprintk("released lock\n");
em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
}
return 0; return 0;
} }
...@@ -399,7 +389,7 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, ...@@ -399,7 +389,7 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1);
return 0; return 0;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
dev->adev.shutdown = 1; em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
return 0; return 0;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -423,7 +423,7 @@ struct em28xx_audio { ...@@ -423,7 +423,7 @@ struct em28xx_audio {
unsigned int hwptr_done_capture; unsigned int hwptr_done_capture;
struct snd_card *sndcard; struct snd_card *sndcard;
int users, shutdown; int users;
enum em28xx_stream_state capture_stream; enum em28xx_stream_state capture_stream;
spinlock_t slock; spinlock_t slock;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment