[media] em28xx-audio: don't wait for lock in non-block mode
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 12 Jan 2014 12:22:29 +0000 (09:22 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 12 Jan 2014 13:57:05 +0000 (11:57 -0200)
commit34906633faa69d523c032f37036b0bda6232268d
tree9126cc13cc9b954c96ec5ebd8fda8f1cd9ddf1d7
parent49677aef90de7834e7bb4b0adf95c3342c2c8668
[media] em28xx-audio: don't wait for lock in non-block mode

Pulseaudio has the bad habit of stopping a streaming audio if
a device, opened in non-block mode, waits.

It is impossible to avoid em28xx to wait, as it will send commands
via I2C, and other I2C operations may be happening (firmware
transfers, Remote Controller polling, etc). Yet, as each em28xx
subdriver locks em28xx-dev to protect the access to the hardware,
it is possible to minimize the audio glitches by returning -EAGAIN
to pulseaudio, if the lock is already taken by another subdriver.

Reported-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/em28xx/em28xx-audio.c