Commit Graph

23 Commits

Author SHA1 Message Date
Hajime Hoshi
12350e2fee Fix build tags for Go 1.17 2021-08-17 12:27:19 +09:00
Hajime Hoshi
5750c48a3b audio/internal/oboe: Remove 'generate' build tag 2021-07-21 21:33:31 +09:00
Hajime Hoshi
e9d0c84803 audio/internal/oboe: Add //go:build 2021-07-21 21:25:30 +09:00
Hajime Hoshi
4276e2964e audio/internal/oboe: Use a bigger buffer for safety
There were sometimes slight noises on a low-end device like Asus
Zenfone (ASUS_X013DB).

Updates #1662
2021-06-07 03:52:30 +09:00
Hajime Hoshi
61682d6d5c audio/internal/oboe: Nil slice should be safe to convert to reflect.SliceHeader 2021-06-07 03:33:09 +09:00
Hajime Hoshi
ea6e2091c5 audio/internal/oboe: Do not call a Go function from onAudioReady
Calling a Go function from C has some overhead. onAudioReady is a
very performance-critical function and should not call Go function.

Updates #1662
2021-06-07 00:01:09 +09:00
Hajime Hoshi
78459953cf audio/internal/readerdriver: Use the common player implementation for Android
Updates #1662
2021-06-06 22:53:56 +09:00
Hajime Hoshi
08dbb41b35 audio/internal/oboe: Implement self-mixing and re-enable Oboe
Updates #1549
Updates #1656
Closes #1660
2021-06-03 00:54:42 +09:00
Hajime Hoshi
0f5aa315d6 audio/internal/oboe: Bug fix: Player must be protected by a mutex
As Close can be invoked by the finalizer, Player must be concurrent
safe. Especially the member player must be synced.

Updates #1549
Updates #1656
2021-06-01 03:01:35 +09:00
Hajime Hoshi
b0a8ecefeb android/internal/oboe: Update Oboe to 1.6.0 2021-05-30 05:07:16 +09:00
Hajime Hoshi
58c1ed0e23 audio/internal/oboe: Bug fix: Opening a stream might fail when too many streams are opened
openStream might fail when too many streams are opened in a short time.
In this case, sleep 1[ms] and retry to open the stream.

Updates #1549
Closes #1645
2021-05-16 19:43:47 +09:00
Hajime Hoshi
bb4a3ce89b audio/internal/oboe: Add prefixes to the C functions 2021-05-16 03:03:34 +09:00
Hajime Hoshi
fc8b3d70fe audio/internal/oboe: clang-format 2021-05-16 03:01:43 +09:00
Hajime Hoshi
2edb286ec4 audio/internal/oboe: Bug fix: Use-after-free of a player
In theory, a closed player was used unexpectedly by these steps:

  1. Suspend is called by switching the application
  2. Player_Close is called
  3. Resume is called by reactivating the application

The set of GetPlayersToResume() had a closed player and the trying to
play it caused the use-after-free problem.

This changes fixes the issue by removing the player from the set of
GetPlayerToResume() when closing it. iOS version already has the logic
to remove the player appropriately.

Updates #1645
Closes #1646
2021-05-16 02:21:00 +09:00
Hajime Hoshi
5f773a3277 audio/internal/readerdriver: Refactoring 2021-05-16 02:08:33 +09:00
Hajime Hoshi
52c609459c audio/internal/readerdriver: Change the returning type of UnplayedBufferSize int64 -> int 2021-05-10 03:22:19 +09:00
Hajime Hoshi
ae9e89b814 audio/internal/oboe: Bug fix: Not all players should not be suspended 2021-05-09 03:07:17 +09:00
Hajime Hoshi
4e0e5c6bbc audio/internal/oboe: Bug fix: Always use OpenSL
AAudio doesn't care about plugging in/out headsets. There is a
workaround [1], but this is not easy to apply. Instead, alwasy use
OpenSL.

[1] https://github.com/google/oboe/blob/master/docs/notes/disconnect.md

Closes #1634
2021-05-05 18:09:44 +09:00
Hajime Hoshi
1fecaa0a90 audio/internal/readdriver: Bug fix: Wait for a while after finishing to write
Closes #1632
2021-05-05 17:05:23 +09:00
Hajime Hoshi
ded3cd1433 audio/internal/readerdriver: Refactoring: Remove player.state 2021-05-05 15:32:53 +09:00
Hajime Hoshi
c954dfa8fb audio/internal/readerderiver: Bug fix: Reduce noises on Android
Closes #1632
2021-05-05 02:14:59 +09:00
Hajime Hoshi
83c9015468 audio/internal/oboe: Bug fix: Guard the players by a mutex
Closes #1631
2021-05-05 00:51:53 +09:00
Hajime Hoshi
ad86c297fb audio/internal/readdriver: Implement a driver for Android with Oboe
Closes #1626
2021-05-04 23:51:36 +09:00