1. 14 Jan, 2014 20 commits
  2. 13 Jan, 2014 15 commits
  3. 12 Jan, 2014 5 commits
    • Mauro Carvalho Chehab's avatar
      [media] em28xx-audio: return -ENODEV when the device is disconnected · 8b1fa579
      Mauro Carvalho Chehab authored
      If em28xx is disconnected, return -ENODEV to all PCM callbacks.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      8b1fa579
    • Mauro Carvalho Chehab's avatar
      [media] em28xx-audio: split URB initialization code · 966f4163
      Mauro Carvalho Chehab authored
      The URB calculus code may eventually be moved to some other
      place, like at pcm open, if it ends by needing more setups, like
      working with different bit rates, or different audio latency.
      
      So, move it into a separate routine. That also makes the code
      more readable.
      
      No functional changes.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      966f4163
    • Mauro Carvalho Chehab's avatar
      [media] em28xx-audio: don't wait for lock in non-block mode · 34906633
      Mauro Carvalho Chehab authored
      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: default avatarAntti Palosaari <crope@iki.fi>
      Tested-by: default avatarAntti Palosaari <crope@iki.fi>
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      34906633
    • Mauro Carvalho Chehab's avatar
      [media] em28xx-audio: fix the period size in bytes · 49677aef
      Mauro Carvalho Chehab authored
      If the period size is wrong, userspace will assume a wrong delay
      any may negociate an inadequate value.
      
      The em28xx devices use 8 for URB interval, in microframes,
      and the driver programs it to have 64 packets.
      
      That means that the IRQ sampling period is 125 * 8 * 64,
      with is equal to 64 ms.
      
      So, that's the minimal latency with the current settings. It is
      possible to program a lower latency, by using less than 64 packets,
      but that increases the amount of bandwitdh used, and the number of
      IRQ events per second.
      
      In any case, in order to support it, the driver logic should be
      changed to fill those parameters in realtime.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      49677aef
    • Mauro Carvalho Chehab's avatar
      [media] em28xx-audio: don't hardcode audio URB calculus · 1b3fd2d3
      Mauro Carvalho Chehab authored
      The current code hardcodes the number of audio URBs, the number
      of packets per URB and the maximum URB size.
      
      This is not a good idea, as it:
      
      - wastes more bandwidth than necessary, by using a very
        large number of packets;
      
      - those constants are bound to an specific scenario, with
        a bandwidth of 48 kHz;
      
      - don't take the maximum endpoint size into account;
      
      - with urb->interval = 1 on xHCI, those constraints cause a "funny"
        setup: URBs with 64 packets inside, with only 24 bytes total. E. g.
        a complete waste of space.
      
      Change the code to do dynamic URB audio calculus and allocation.
      
      For now, use the same constraints as used before this patch, to
      avoid regressions.
      
      A good scenario (tested) seems to use those defines, instead:
      
      	#define EM28XX_MAX_AUDIO_BUFS          8
      	#define EM28XX_MIN_AUDIO_PACKETS       2
      
      But let's not do such change here, letting the optimization to
      happen on latter patches, after more tests.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      1b3fd2d3