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

USB DAC crashes when phone is locked #1631

Closed
F1VWdk opened this issue Nov 4, 2022 · 38 comments
Closed

USB DAC crashes when phone is locked #1631

F1VWdk opened this issue Nov 4, 2022 · 38 comments
Assignees

Comments

@F1VWdk
Copy link

F1VWdk commented Nov 4, 2022

Observed on Pixel 7 Pro and 6
Pixel 7 Pro Version: [TD1A.220804.031.2022102800]
No additional drivers/software installed for the DAC
Spotify plays Ok while phone is unlock or locked when output to Bluetooth headset
with USB DAC:
while phone is unlocked, connect USB DAC (BTR5 by FiiO)
start Spotify, it plays ok to USB DAC while phone is unlocked
the second phone is locked, sound stops. Unlocking phone causes Spotify to crash without restoring sound. Once started again, Spotify plays fine to the DAC while phone is unlocked, locking phone repeats the cycle.
Observed similar behavior using Amazon Music but unlike Spotify, AM did not crash after unlocking the phone but instead reported "exception 800" and needed to be forced closed and restarted to resume play.

This playback configuration was working on the the same phone with Android 13 (and 12)

@bigswag420
Copy link

try setting usb accessories to "allow new USB peripherals" in settings > security > usb accessories

@F1VWdk
Copy link
Author

F1VWdk commented Nov 4, 2022

Actually tried before creating this ticket, the behavior is the same

@F1VWdk
Copy link
Author

F1VWdk commented Nov 6, 2022

I can provide a DAC or fund a purchase of one for whoever will be working on this issue

@wonder75
Copy link

wonder75 commented Nov 8, 2022

Maybe try the ANKER DAC. It works without problems for me on Pixel 6a.
Had problems with another DAC too (iMagoo).

@thestinger
Copy link
Member

Need to know if anyone can replicate the issue on a Pixel 4 or Pixel 5.

@GrapheneOS GrapheneOS deleted a comment from psz1234 Nov 17, 2022
@b3K1ndRw1nd
Copy link

Need to know if anyone can replicate the issue on a Pixel 4 or Pixel 5.

@thestinger I can confirm that the issue does not happen (at least the music stopping when phone is locked) on my Pixel 4 that is also running grapheneOS.

Is there anything I can do to help resolve this issue?

@empratyush empratyush self-assigned this Nov 18, 2022
@maade93791
Copy link
Member

it seems like I can't replicate this issue on Pixel 7 with Apple Type-C to 3.5 dongle

@GrapheneOS GrapheneOS deleted a comment from psz1234 Nov 18, 2022
@thestinger
Copy link
Member

The initial post says that it's occurring for them with a Pixel 7 Pro. Maybe it only happens with certain kinds of DACs.

@b3K1ndRw1nd
Copy link

@maade69 will respond to this comment here to centralize all discussion about this issue

these are the earphones I have. Nothing special.

@SHA-NDY
Copy link

SHA-NDY commented Nov 20, 2022

Same for me with Pixel 6. I used my USB-C audio converter (https://www.jsaux.com/products/jsaux-usb-c-to-3-5mm-cable-adapter) successfully back in September, that's all I can say on when it worked the last time for me (don't really use it often). Maybe I was still on Android 12 back then.

@empratyush
Copy link
Member

@F1VWdk i am unable to reproduce the issue with BTR5 on pixel 7.

@shape-err
Copy link

Experiencing the same issue on a Pixel 6 Pro. Was working just fine a week or so ago. USB accessories is set to Allow new USB peripherals. I have two Google USB C to 3.5 adapters. One I had never used before but the issue is the same on both.

@empratyush
Copy link
Member

empratyush commented Nov 21, 2022

@shape-err I am unable to reproduce this bug with Google USB-C to 3.5 mm Adaptor and Pixel 6 pro.

How i can reproduce this bug (step by step) and on what build number (settings > about > build number)?

@shape-err
Copy link

@empratyush
Build Number: TP1A.221105.002.2022111800
Steps to Reproduce:

  1. Plug in USB/3.5 Adapter (Phone can either be locked or unlocked)
  2. Connect Headphones/Audio device to adapter
  3. Open app to play audio (Spotify, Soundcloud, YouTube, etc)
  4. Play audio (While phone is unlocked audio will play)
  5. Lock device by power button
  6. Audio will immediately stop, fingerprint reader freezes for a few seconds
  7. Unlock device, the app that was playing audio and any app that can play audio will crash/freeze upon opening until adapter is unplugged

@empratyush
Copy link
Member

@empratyush Build Number: TP1A.221105.002.2022111800 Steps to Reproduce:

  1. Plug in USB/3.5 Adapter (Phone can either be locked or unlocked)
  2. Connect Headphones/Audio device to adapter
  3. Open app to play audio (Spotify, Soundcloud, YouTube, etc)
  4. Play audio (While phone is unlocked audio will play)
  5. Lock device by power button
  6. Audio will immediately stop, fingerprint reader freezes for a few seconds
  7. Unlock device, the app that was playing audio and any app that can play audio will crash/freeze upon opening until adapter is unplugged

I am sorry but still unable to reproduce this issue .

@b3K1ndRw1nd
Copy link

@empratyush

for me, I have a Google Pixel 6 with Build Number 221105.002.2022111800 and my steps to reproduce is:

  1. install https://github.com/AdrienPoupa/VinylMusicPlayer
  2. connect https://www.amazon.ca/gp/product/B081294BZB/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
  3. start playing song
  4. lock Phone
  5. after a second or so, the music will stop playing

To get the song to start playing again, I have to

  1. Unlock
  2. disconnect earphones
  3. press pause
  4. connect earphones
  5. press play

@shape-err
Copy link

I found the problem, default USB settings were set to File Transfer.
Settings > Developer Options > Default USB Configuration > No data transfer.
Audio will now play with screen locked and adapter plugged in.

@b3K1ndRw1nd
Copy link

I can confirm that @shape-err 's "fix" does work on my Pixel 6 too.

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

Confirmed. Works for me too, Pixel 6.
Thanks guys for investigating.

@psz1234
Copy link

psz1234 commented Nov 21, 2022 via email

@b3K1ndRw1nd
Copy link

@empratyush wait, is this expected behavior? cause this was not how the phones used to work.

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

@empratyush I always had "Data transfer" as default setting for USB. It used to work before as mentioned by @b3K1ndRw1nd

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

@psz1234 Yes, Pixel 6 (not Pro)

@empratyush
Copy link
Member

@empratyush wait, is this expected behavior? cause this was not how the phones used to work.

yes, by default "Default USB Configuration " is set to "No data transfer" for privacy/security reasons.

@GrapheneOS GrapheneOS deleted a comment from psz1234 Nov 21, 2022
@thestinger
Copy link
Member

You shouldn't need to change anything in developer options. The developer options USB transfer mode is a different thing than the user facing one. Does this work for you with developer options disabled completely?

@thestinger thestinger reopened this Nov 21, 2022
@thestinger
Copy link
Member

I don't think this issue is resolved. I think people are messing with developer options in a way that they shouldn't be. OS level file transfer enabling is not the same as that.

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

You shouldn't need to change anything in developer options. The developer options USB transfer mode is a different thing than the user facing one. Does this work for you with developer options disabled completely?

For me it works as expected with developer options disabled completely (Pixel 6). That means music playback doesn't stop when the screen is turned off.

@b3K1ndRw1nd
Copy link

I don't think this issue is resolved. I think people are messing with developer options in a way that they shouldn't be. OS level file transfer enabling is not the same as that.

@thestinger Not sure if I am misunderstanding you or you are legit saying that users should not be enabling USB file sharing on their pixels?

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

I don't think this issue is resolved. I think people are messing with developer options in a way that they shouldn't be. OS level file transfer enabling is not the same as that.

@thestinger Not sure if I am misunderstanding you or you are legit saying that users should not be enabling USB file sharing on their pixels?

I think changing the default behaviour of USB by setting developer options is messing this up.
But I always had developer options enabled like that and it wasn't a problem regarding music playback.

@thestinger thestinger closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2022
@thestinger
Copy link
Member

If everyone here previously changed the developer options setting for this, then that's the issue. Developer options are for testing and aren't intended to be used this way.

@SHA-NDY
Copy link

SHA-NDY commented Nov 21, 2022

If everyone here previously changed the developer options setting for this, then that's the issue. Developer options are for testing and aren't intended to be used this way.

Accepted

@b3K1ndRw1nd
Copy link

If everyone here previously changed the developer options setting for this, then that's the issue. Developer options are for testing and aren't intended to be used this way.

@thestinger is there another option for doing a USB file transfer to and from a Pixel phone?

@thestinger
Copy link
Member

It's in the standard USB menu in Settings -> Connected devices. There's no reason to use developer options for this and it's broken. When you connect a USB device, a notification is shown with a shortcut to the USB settings menu in Settings.

@b3K1ndRw1nd
Copy link

I see. well I weekly use the adb command so its gonna suck to keep having to toggle it on and off so that the earphones can work now 😞 but thanks I guess

@thestinger
Copy link
Member

You don't have to do that. ADB doesn't cause any issues with this.

@F1VWdk
Copy link
Author

F1VWdk commented Nov 23, 2022

Thank you everyone for troubleshooting this and finding a .... I wouldnt call it a solution but a workaround.
I'm, similar to some posters, always change "Default USB Configuration" in the Developer options - I've done it for years because it was convenient as I frequently use USB to move files to and from computers and my phone. Without changing Developer options, every time you connect a phone to a computer, you have to slide down and select the operation mode.

Never in the past me changing "Default USB Configuration" in Developer options caused any issues - not with USB operations, not with external DAC and music - and that is way I always changed USB to "File Transfer".

Developer options are for testing and aren't intended to be used this way.

I disagree with @thestinger about the use of this and other developer options: on stock android it does not cause any issues and makes my use of the device more convenient - I dont see any reason why I shouldnt use it.
Similarly, I ALWAYS change animation speed in Developer options - it causes no issues, makes my use of the device more pleasant so I use it - am I not suppose to use it because it's in "Developer options"? What about "Disable absolute volume" - should it not be used too because it's in "Developer options"?

There is definitely something different on GraphoneOS from stock as selecting "File transfer" in "Default USB Configuration" of Developer options causes an issue that is not present on stock - it's a fact. Whether devs decide if it's worth or not to look into this - that's another matter.

I'll change "Default USB Configuration" to "No file transfer" but it's a workaround, not a solution.

@thestinger
Copy link
Member

You're wrong. It works the same way on the stock OS based on the same version of AOSP. It's also not an opinion that developer options are intended for developers and not production use. There are a whole bunch of broken ones, ones with major unexplained caveats and ones that don't do anything. Features are in developer options because they're only useful for developers, extremely dangerous (ADB) or too half baked / broken to be exposed as regular options for users. Please don't unnecessarily bump issues and do research before trying to contradict things stated by the GrapheneOS team. You could confirm for yourself this occurs on stock OS.

@GrapheneOS GrapheneOS locked and limited conversation to collaborators Nov 23, 2022
@thestinger
Copy link
Member

Without changing Developer options, every time you connect a phone to a computer, you have to slide down and select the operation mode.

Aside from not being implemented properly in a way that doesn't break things, I think the reason they haven't done that and added it as a normal option is fairly obvious: even using the regular approach that needs to be enabled each time is a quite insecure approach to file transfer where the attached computer gets access to the user's whole home directory. Having that happen automatically without the user unlocking and enabling it is a pretty big issue...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants