Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate outputting cue voice and main voice to two separate audio devices #100

Open
willwade opened this issue Oct 2, 2018 · 8 comments

Comments

@willwade
Copy link
Collaborator

willwade commented Oct 2, 2018

Output

Questions to answer:

  • Can we do this in software?
  • What kind of hardware would we need

Output:

  • Explanation of whats going on
  • Issues to make it happen

Original issues

Having discussed with @hosseinamin the not such small task in porting pasco to Droid in Windows its made me think again about this issue. I think we need to focus on this.

Scenarios

Its worth thinking about this in the way of a user scenario.

Scenario 1. Wired & Bluetooth

  • Person has an iPod Touch. Running 14.4
  • For a cue voice they have a wired headphone (these bone conduction ones
  • For the main voice they are using a Bluetooth speaker (this)

Scenario 2. Bluetooth & On-device

  • Person has an iPad mini. Running 14.4
  • For a cue voice they have a Bluetooth headphone - only using one side (e.g. this
  • For the main voice they are using the in-built speaker as the device is always front and centre on their chair

Scenario 2. Bluetooth & Bluetooth

  • Person has an iPad mini. Running 14.4
  • For a cue voice they have a Bluetooth headphone - only using one side (e.g. this
  • For the main voice they are using a Bluetooth speaker (this)

Problem

So in each of these setups:

  • Bluetooth needs to be paired and connected. Wired headphones need to be connected
  • But
  1. The buttons in pasco selecting on device speaker or headphone only work if there is something connected. Even then it feels like its not reliable.
  2. If you use Bluetooth - I think the way to do it is set Output to None and then "Open Output audio manager". But this is odd. I feel like we need that output audio manager twice. Once for Main and once for cue. Then get rid of the Toggle radio buttons for none/in built/headphone.. would that work?
  3. The problems really happen when something is disconnected. It loses this setup and you need to start again. Is there a way of caching/saving the state so on re-connecting a device it tries to access that route?

What if we had named devices for Bluetooth devices? Would that help?

Just wondering if this needs a good look at again - both for usability and reliability.

Maybe useful https://developer.apple.com/documentation/avfaudio/avaudiosession/1616443-overrideoutputaudioport

Will need to support Bluetooth as an output for speakers. I imagine this won't be as easy as the detection of a wired headphone being plugged in (there can be numerous bluetooth audio devices attached).

Might need to rethink the settings menu. Maybe a sub-section for Audio management?

This is going to be more and more needed now that Apple has removed the headphone jack :(

@willwade
Copy link
Collaborator Author

I’m thinking this maybe useful : https://www.npmjs.com/package/cordova-plugin-headsetdetection

@hosseinzoda
Copy link
Collaborator

I need to do some testing to figure it out...

@willwade willwade added this to the 0.9 milestone Nov 12, 2018
@willwade
Copy link
Collaborator Author

NB: Main priority is bluetooth for Main Voice. That is the one that needs amplification more than the cue.

@hosseinzoda
Copy link
Collaborator

Found a useful thread. Related to this issue, I will leave it here for reference.

https://forums.developer.apple.com/thread/4340

hosseinzoda pushed a commit to hosseinzoda/pasco that referenced this issue Dec 18, 2018
…#100

1. separate override_to_speaker from speak_utterance
2. reduce call to override_to_speaker (only when its needed). The reason is chaning AVSession is not very efficient for bluetooth connected device. So we minimize call to it.
3. change name of audscan-cordova-plugin to pasco-cordova-plugin
hosseinzoda pushed a commit to hosseinzoda/pasco that referenced this issue Dec 18, 2018
…#100

1. separate override_to_speaker from speak_utterance
2. reduce call to override_to_speaker (only when its needed). The reason is chaning AVSession is not very efficient for bluetooth connected device. So we minimize call to it.
3. change name of audscan-cordova-plugin to pasco-cordova-plugin
willwade added a commit that referenced this issue Jan 16, 2019
override_to_speaker fix for bluetooth and reduce call to it #100 & update dyn at root & #130 & #118 & #107 & #133.

These all look ok. Lets do some more testing on TestFlight now
hosseinzoda pushed a commit to hosseinzoda/pasco that referenced this issue Jan 18, 2019
…tinspeaker or default), +enhancement

edit-config.js contains a new button in cordova-ios for opening audio output volume + route control.

Three option for overriding output audio. Each does what it says. None will not override and listen to what user did ask at audio manager...
@willwade
Copy link
Collaborator Author

willwade commented Feb 7, 2019

This is buggy - but I'm not sure its anything we can fix.. Basically in testing this sometimes its losing the bluetooth speaker. It just drops from the audio manager. This may be our bluetooth unit or something on pasco. Needs more testing to clarify

willwade added a commit that referenced this issue Feb 7, 2019
fix #134 & #100, override output to (headphone,builtinspeaker or default), +enhancement
@willwade willwade removed the next-up label Jul 30, 2019
@willwade willwade removed this from the 0.9 milestone Feb 17, 2020
@willwade
Copy link
Collaborator Author

willwade commented Mar 1, 2021

Wonder if fixed better on android. Hence #84

@willwade
Copy link
Collaborator Author

willwade commented Mar 5, 2021

Having discussed with @hosseinamin the not such small task in porting pasco to Droid in Windows its made me think again about this issue. I think we need to focus on this.

Scenarios

Its worth thinking about this in the way of a user scenario.

Scenario 1. Wired & Bluetooth

  • Person has an iPod Touch. Running 14.4
  • For a cue voice they have a wired headphone (these bone conduction ones
  • For the main voice they are using a Bluetooth speaker (this)

Scenario 2. Bluetooth & On-device

  • Person has an iPad mini. Running 14.4
  • For a cue voice they have a Bluetooth headphone - only using one side (e.g. this
  • For the main voice they are using the in-built speaker as the device is always front and centre on their chair

Scenario 2. Bluetooth & Bluetooth

  • Person has an iPad mini. Running 14.4
  • For a cue voice they have a Bluetooth headphone - only using one side (e.g. this
  • For the main voice they are using a Bluetooth speaker (this)

Problem

So in each of these setups:

  • Bluetooth needs to be paired and connected. Wired headphones need to be connected
  • But
  1. The buttons in pasco selecting on device speaker or headphone only work if there is something connected. Even then it feels like its not reliable.
  2. If you use Bluetooth - I think the way to do it is set Output to None and then "Open Output audio manager". But this is odd. I feel like we need that output audio manager twice. Once for Main and once for cue. Then get rid of the Toggle radio buttons for none/in built/headphone.. would that work?
  3. The problems really happen when something is disconnected. It loses this setup and you need to start again. Is there a way of caching/saving the state so on re-connecting a device it tries to access that route?

What if we had named devices for Bluetooth devices? Would that help?

Just wondering if this needs a good look at again - both for usability and reliability.

Maybe useful https://developer.apple.com/documentation/avfaudio/avaudiosession/1616443-overrideoutputaudioport

@willwade willwade added this to the 1.3 milestone Mar 5, 2021
@willwade
Copy link
Collaborator Author

willwade commented Mar 21, 2021

We could solve this problem another way. We could make use of the headphone Jack and split audio between left and right channels. Then we use a splitter and if the user wanted Bluetooth for one channel they could use something like a bluetooth transmitter. Messy though - and would need power for that transmitter as their own battery won't last long.

We could make some of our own electronics and housing to deal with it I guess. @paulhewett

@gavinhenderson gavinhenderson removed this from the 1.3 bug & feature fix milestone Mar 9, 2022
@gavinhenderson gavinhenderson changed the title Audio management - Bluetooth support Allow to output cue voice and main voice to two separate audio devices Mar 9, 2022
@gavinhenderson gavinhenderson changed the title Allow to output cue voice and main voice to two separate audio devices Investigate outputting cue voice and main voice to two separate audio devices Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants