Commit Graph

7 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
3a48aebfbe [rpi] Fix bcm2835_audio locking and samples starvation
Rework general approach to locking and working with audio worker thread:

- Use flags to signal requested worker action
- Fix submitted buffer calculations to avoid samples starvation
- Protect buffer pointers with locks to fix race condition between callback
  and audio worker thread
- Remove unnecessary vchi_service_use
- Do not use lock to serialize VCHI requests since only one thread issues them now
- Fix unloading signaling per hselasky@ suggestion
- Add output to detect inconsistent callback data caused by possible firmware bug
  https://github.com/raspberrypi/firmware/issues/696
- Add stats/debug sysctls to troubleshoot possible bugs

PR:		213687, 205979, 215194
MFC after:	1 week
2016-12-27 19:08:08 +00:00
Oleksandr Tymoshenko
69cab2d1bf Fix locking in bcm2835_audio driver
- Move all VCHI activity to worker thread: channel methods are called with
    non-sleepable lock held and VCHI uses sleepable lock.

- In worker thread use sx(9) lock instead of mutex(9) for the same reason.

PR:		213801, 205979
2016-11-07 17:38:39 +00:00
Pedro F. Giffuni
255eff3b0d sys/arm: Minor spelling fixes.
Only affects comments: no functional change.
2016-05-04 15:48:59 +00:00
Oleksandr Tymoshenko
2c0b1f4f61 Multiple fixes in VCHI audio driver:
- Pre-buffer audio data to VideoCore so there are no audible glitches when
    driver is too late to provide samples
- Start actual playback when there is some prebuffered audio,
    it fixes audible noisy click in the beginning of playback
- Use #defines instead of hardcoded values where appropriate
- Fix copy-pasted comment

PR:		208678
2016-04-13 05:28:27 +00:00
Oleksandr Tymoshenko
d28956b489 Fix typo in device description
Spotted by: jmcneill
2016-02-28 19:39:00 +00:00
Oleksandr Tymoshenko
ebb62474ab Fix some of WITNESS complaints and bootup lock by removing msg_avail
condvar/mutex. They're basically no-op because error is not propagated
up the call chain. We still report message failures in VC service callback
2015-11-08 04:15:52 +00:00
Oleksandr Tymoshenko
2f99b597e0 Add VideoCore audio driver for Rasperry Pi (BCM2835) 2015-02-08 01:12:40 +00:00