New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 746876 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Prioritize headphones for audio output

Project Member Reported by conradlo@chromium.org, Jul 20 2017

Issue description

When headphones are plugged in, let's always prioritize that for audio playback.

For context, here's Jenny's summary of how we arrived at today's design:

The logic about how to select and persist the active audio device has a very long evolving history. Originally, it was implemented as by giving different type of the device a priority, for example, external device like headphone always has a higher priority than the internal device such as internal speaker. Within all the plugged in device, we will always select a device with higher priority first, which means headphone will win over internal speaker; if there are multiple devices with the same priority, then the one which is last plugged in win. User can manually change the active device, but we won't remember their choice across different user session and rebooting. This works for quite a while, and there were some user feedback with cases that user want to persist their manual selection across the session and rebooting, the USB docking and HDMI cases are  among the most typical ones. Then we made a different design to persist user's manual choice in the preference and restore the state across session and rebooting, the logic becoming more complicated with different scenario, but over the time, it seems satisfied the majority of different user cases. As dylan pointed out, in many cases, it is difficult to figure out user's intention. Putting all together, I prefer to not have major change for the current logic, but probably cherry pick the headphone case out and handle it properly. If we agree with this approach, we can open a separate bug and define the use case clearly, and I can make the code change.


The current proposal is to proceed with the existing design where we remember the user's prior manual selections, but still prioritize headphones when we detect that they've been plugged in.


cc: Kalin because this will have implications to audio testing
cc: Jimmy because this may also affect Chameleon audio as well
 
Note that if I switch to a different output after plugging my headphones in, we should retain my selection on the next suspend/resume or reboot. We should only switch to headphones again upon the next insertion event.
At some point in the future, Chromebooks won't ship with 3.5mm audiojacks so we'll need to handle USB-C headphones as well.
Cc: puneetster@chromium.org
Jenny, have you had a chance to look into these changes?
Just discussed with Jenny, we should apply this change to 3.5mm audiojacks as well as USB headsets.

Also, we should fix the bug mentioned in this doc: https://docs.google.com/document/d/1BTTl_9yL6c9DQVLvA-Btuwms07xK6jHh33w4XHIlWAw/edit

Thanks Jenny!

Comment 6 by dgreid@chromium.org, Sep 14 2017

How are you going to differentiate between USB headsets and USB speakers or a USB dock that doesn't have a headset plugged in currently?
Ok, confirmed with Jenny - since we can't differentiate USB headsets from speakers or docks, we won't special-case USB audio. Thanks!

Comment 8 by ka...@chromium.org, Sep 14 2017

Maybe I am mixing the terminology here, I am unable to understand the USB case.

I thought we differentiate among different USB audio headsets/speakers/docks. That's why we show these different USB IDs in the output/input node in uber tray, and also apply the persistent per device(id) for audio node selection among them.

I imagine if this was not the case(we can't differentiate USB devices), we could do the special case for USB too, which will be the old model(persistent per port type) with exception of HDMI audio.

I think we can differentiate USB device A versus USB device B via the audio identifiers.

However, we don't know if the USB device plugged in is a USB headset, or a USB speaker, or a USB dock. We only want to prioritize USB headsets, but not the other device types. But if we can't differentiate between device types, then we can't go that route.

Comment 10 by ka...@chromium.org, Sep 15 2017

Ahh, yes. I missed the obvious. Thanks Conrad for the clarification.
Status: Started (was: Assigned)
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71d8fbfc1abe129bc8041cd6c037f3a495da0541

commit 71d8fbfc1abe129bc8041cd6c037f3a495da0541
Author: Jenny Zhang <jennyz@chromium.org>
Date: Fri Sep 22 22:37:16 2017

Set 35mm Headphone as active output device whenever it is hotplugged.

Bug:  746876 
Change-Id: I812fe40121305ea0541ec9b5b313c63a3f501231
Reviewed-on: https://chromium-review.googlesource.com/671542
Reviewed-by: Jenny Zhang <jennyz@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503880}
[modify] https://crrev.com/71d8fbfc1abe129bc8041cd6c037f3a495da0541/chromeos/audio/cras_audio_handler.cc
[modify] https://crrev.com/71d8fbfc1abe129bc8041cd6c037f3a495da0541/chromeos/audio/cras_audio_handler_unittest.cc

Status: Fixed (was: Started)

Comment 14 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 15 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment