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

Not working on Pixel 6 #45

Open
abayliss opened this issue Mar 30, 2023 · 35 comments
Open

Not working on Pixel 6 #45

abayliss opened this issue Mar 30, 2023 · 35 comments
Labels
bug Something isn't working Stale

Comments

@abayliss
Copy link

I'm having several issues getting this working on my Pixel 6 (on Android 13, fully up-to-date).

The app opens, I can connect to the Teensy and the display shows, but it only actually updates while I'm pressing a button. For example, if I press play, the waveform at the top shows, but then freezes. If I scroll around the interface, the waveform updates briefly as the cursor moves but then freezes again.

I've also not been able to get audio working at all, and I'm pretty sure I've tried all the available combinations of device and driver. I get no error messages, just no audio. When choosing the audio device, am I meant to be choosing the input device (the M8), or the output device? I get a list of 3 "Pixel 6" devices and one "USB-Audio - M8", although this last one only appears after I've connected to the M8 once, then closed and reopened the app.

@v3rm0n
Copy link
Owner

v3rm0n commented Mar 31, 2023

For screen issues you can try to press left and right buttons at the same time, it should reset the screen.

For audio issues you can try to disable audio routing and see if that helps https://mysupport.razer.com/app/answers/detail/a_id/1875/~/why-does-the-audio-come-out-from-the-speaker-and-not-routed-to-the-headset%3F

@abayliss
Copy link
Author

Still no joy I'm afraid, although If I disable audio routing, and use the openslES driver I do get a regular clicking noise while the app is connected, but nothing like the audio I should be getting.

Pressing left and right at the same time has the same effect on the screen as any other button, as in, while I'm pressing them the screen refreshes briefly, but it freezes again straight away.

@jasonjamesmoore
Copy link

I am seeing the same issues as @abayliss on Pixel 6 Pro. Even if I never get it working, it's rad that you're doing this. Thanks!

@cgxeiji
Copy link

cgxeiji commented May 15, 2023

I have the same problem with v1.0.6, but with v1.0.5 the screen works great.

@github-actions
Copy link

github-actions bot commented Jul 8, 2023

Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 8, 2023
@v3rm0n
Copy link
Owner

v3rm0n commented Jul 8, 2023

Any changes in the latest release? https://github.com/v3rm0n/m8c-android/releases/tag/v1.0.17

@github-actions github-actions bot removed the Stale label Jul 9, 2023
@viviicat
Copy link

I'm also getting this on 6a. Same exact behavior.

I also cannot get audio to work. I have tried various combinations of audio settings and output devices and don't hear anything.

Also have the same screen refresh issues. No updates unless buttons are pressed which means the visualizer doesn't work.

@cgxeiji
Copy link

cgxeiji commented Jul 23, 2023

I just tried v1.0.17 and have the same problem. I noticed that the number of audio devices has diminished, but I cannot get the audio from M8.

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.

@github-actions github-actions bot added the Stale label Aug 7, 2023
@v3rm0n
Copy link
Owner

v3rm0n commented Aug 10, 2023

Just a heads up: I don't have a Pixel so it would be great if somebody else can look into it.

@viviicat
Copy link

This is something I had wanted to look into, but I haven't had a lot of free time lately.

@github-actions github-actions bot removed the Stale label Aug 11, 2023
@v3rm0n
Copy link
Owner

v3rm0n commented Aug 11, 2023

I actually managed to get into the same situation by putting the app in the background and resuming it so I refactored the code a bit to fix the resume issue, it might do something for the Pixel as well but probably not.

Just in case I also added a new Advanced setting in the preferences for Idle ms. You can try to change this value from the default of 0 to 1 or something else to see if it changes anything. Probably 10 is the highest value to go to.

https://github.com/v3rm0n/m8c-android/releases/tag/v1.0.24

@viviicat
Copy link

Not seeing any change with 6a and the new release. Fiddled with Idle ms and didn't notice much.

@github-actions
Copy link

Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.

@github-actions github-actions bot added the Stale label Aug 26, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
@v3rm0n v3rm0n added the bug Something isn't working label Aug 31, 2023
@v3rm0n v3rm0n reopened this Aug 31, 2023
@TheJoshuaByers
Copy link

I'm on the Pixel 7 (Android 13) and running into the same issues described above. No screen refresh and no audio out.

Is there any way to share some debug logs?

@TheJoshuaByers
Copy link

Still not working with version 1.0.32 unfortunately. If there's anything I can do to help you debug, just send me a message! :)

@KieranReck
Copy link

Hi all, can confirm that im getting the same refresh and audio issues on a pixel 7a with v1.0.45.

Tis a shame, but I definitely can't complain with all the hard work that goes into any of this free community stuff!

@viviicat
Copy link

All right, I'm going to try to debug this this weekend. At least try to collate info. As I mentioned above, I have a phone that reproduces this.

@viviicat
Copy link

(i have an actual m8 and so i don't use headless much anymore, but I feel for folks who only have headless available!)

@KieranReck
Copy link

KieranReck commented Dec 15, 2023

(i have an actual m8 and so i don't use headless much anymore, but I feel for folks who only have headless available!)

To be fair, there are so many options for M8 Headless that it isn't a game changing problem, but the android solution is by far the lowest component count of all the portable headless solutions so it is definitely appealing.

Here's some info on what I have tried so far:

  • when I Installed the app, I used the release APK, not the source (as you would expect)
  • Tried all available Audio Devices within the app (3 instances of pixel 7a, and 1 instance of 'USB-Audio - M8)
  • Tried all available audio drivers (AAudio, android, opensIES)
  • Ensured the app has microphone privileges
  • Ensured that 'Disable USB Audio Routing' is set to 'off' in the android Developer Settings.
  • Tried various 'audio buffer sizes'
  • tried various 'idle ms' between 0 and 10
  • Checked to see if the Teensy can be used as an external audio source in the camera app (it is recognized as connected, but you cannot actually get audio from it)
  • Allowed app to have 'unrestricted battery usage'
  • Tried using M8webdisply instead. For reference, the display refreshes correctly but audio still doesnt work.

So far, no changes.

The issues I see are the same as reported above, there is no audio, and the screen only refreshes upon a button press.

good luck!

@cgxeiji
Copy link

cgxeiji commented Dec 15, 2023

If you need any help debugging, I have a Pixel 7 Pro where I can test the app!

@viviicat
Copy link

Debugging, I'm hitting the "Buffer underflow" debug print in usb_audio.c (so, always -1 being returned from ring_buffer_pop), because the callback cb_xfr is not being hit. Audio driver does not seem to change this.

Here are the devices I have in the list (3 of them share the same name, which is messy):

  • "Pixel 6a": underflow error.
  • "USB-Audio - M8": underflow error.
  • "Pixel 6a": Fails to create the stream -- createTrack_l(0): AudioFlinger could not create track, status: -1 output 0 - so does not hit the underflow error.
  • "Pixel 6a": underflow error.

Then, after a few seconds I hit a repeated breakpoint because it's receiving "SIGBUS" (illegal address). The stack trace for this appears to be inconsistent and also not user code, so I'm not sure how helpful it is (presumably the error is happening elsewhere and only manifesting later).

Maybe something like valgrind would catch the issue better, if that's something that can be done with Android/JNI.

@viviicat
Copy link

The SIGBUS error hits this stack initially:

art::StackVisitor::WalkStack<…>(bool) 0x000000764cdd1084
art::Thread::VisitRoots<…>(art::RootVisitor *) 0x000000764cdd0b00
art::gc::collector::MarkCompact::ThreadFlipVisitor::Run(art::Thread *) 0x000000764cefd2cc
art::Thread::RunFlipFunction(art::Thread *, bool) 0x000000764ccabfe8
art::ThreadList::FlipThreadRoots(art::Closure *, art::Closure *, art::gc::collector::GarbageCollector *, art::gc::GcPauseListener *) 0x000000764ccabcb0
art::gc::collector::MarkCompact::RunPhases() 0x000000764ce5c34c
art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool) 0x000000764cca31ec
art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool, unsigned int) 0x000000764cc9f600
art::gc::Heap::ConcurrentGC(art::Thread *, art::gc::GcCause, bool, unsigned int) 0x000000764ce6f6e0
art::gc::Heap::ConcurrentGCTask::Run(art::Thread *) 0x000000764ce6f564
art::gc::TaskProcessor::RunAllTasks(art::Thread *) 0x000000764cda2b0c
art_quick_generic_jni_trampoline 0x000000764cd55834
art_quick_invoke_stub 0x000000764cd3eda8
art::interpreter::DoCall<…>(art::ArtMethod *, art::Thread *, art::ShadowFrame &, const art::Instruction *, unsigned short, bool, art::JValue *) 0x000000764cf11054
art::interpreter::ExecuteSwitchImplCpp<…>(art::interpreter::SwitchImplContext *) 0x000000764ce973e0
ExecuteSwitchImplAsm 0x000000764cd57fdc
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.420609892041422114) 0x000000764cd74124
art::interpreter::DoCall<…>(art::ArtMethod *, art::Thread *, art::ShadowFrame &, const art::Instruction *, unsigned short, bool, art::JValue *) 0x000000764cf11d20
art::interpreter::ExecuteSwitchImplCpp<…>(art::interpreter::SwitchImplContext *) 0x000000764ce973e0
ExecuteSwitchImplAsm 0x000000764cd57fdc
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.420609892041422114) 0x000000764cd74124
art::interpreter::DoCall<…>(art::ArtMethod *, art::Thread *, art::ShadowFrame &, const art::Instruction *, unsigned short, bool, art::JValue *) 0x000000764cf11d20
art::interpreter::ExecuteSwitchImplCpp<…>(art::interpreter::SwitchImplContext *) 0x000000764ce9828c
ExecuteSwitchImplAsm 0x000000764cd57fdc
art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.420609892041422114) 0x000000764cd74124
artQuickToInterpreterBridge 0x000000764cd73a1c
art_quick_to_interpreter_bridge 0x000000764cd5596c
art_quick_invoke_stub 0x000000764cd3eda8
art::ArtMethod::Invoke(art::Thread *, unsigned int *, unsigned int, art::JValue *, const char *) 0x000000764cc39d58
art::Thread::CreateCallback(void *) 0x000000764cf3a1b4
art::Thread::CreateCallbackWithUffdGc(void *) 0x000000764cf39b64
__pthread_start(void *) 0x00000078ef384cd0
__start_thread 0x00000078ef318b04

If I hit continue it hits this:

art::mirror::Object* art::gc::Heap::AllocObjectWithAllocator<true, true, art::mirror::String::AllocFromModifiedUtf8(art::Thread*, int, char const*, int)::$_0>(art::Thread*, art::ObjPtr<art::mirror::Class>, unsigned long, art::gc::AllocatorType, art::mirror::String::AllocFromModifiedUtf8(art::Thread*, int, char const*, int)::$_0 const&) (.__uniq.300758697700900032661301770954074801573.llvm.15993583663007277616) 0x000000764cc3d204
art::Thread::CreatePeer(const char *, bool, _jobject *) 0x000000764cdc5c50
art::Thread* art::Thread::Attach<art::Thread::Attach(char const*, bool, _jobject*, bool, bool)::$_0>(char const*, bool, art::Thread::Attach(char const*, bool, _jobject*, bool, bool)::$_0, bool) (.__uniq.112444171608964125319761912539055931073.llvm.12707530182260866679) 0x000000764cdc2d00
art::Runtime::AttachCurrentThread(const char *, bool, _jobject *, bool, bool) 0x000000764cdc2528
art::JII::AttachCurrentThreadInternal(_JavaVM *, _JNIEnv **, void *, bool) 0x000000764cef3288
art::(anonymous namespace)::CheckJII::AttachCurrentThread(_JavaVM*, _JNIEnv**, void*) (.__uniq.99033978352804627313491551960229047428.llvm.9379289081322328196) 0x000000764cccd85c
android::AndroidRuntime::javaThreadShell(void *) 0x00000078fbf02170
__pthread_start(void *) 0x00000078ef384cd0
__start_thread 0x00000078ef318b04

@viviicat
Copy link

https://github.com/laamaa/m8c/blob/9d70859ec2d75be67e2e80b04fb1f5b85b371737/src/usb_audio.c#L24 - here's the underflow bit I'm referring to, for reference.

@viviicat
Copy link

The return code of libusb_submit_transfer is -1 = LIBUSB_ERROR_IO - "Input/output error."

@viviicat
Copy link

I've instrumented libusb logging and have received the error message:
libusb: error [submit_iso_transfer] submiturb failed, errno=95
errno 95 is: EOPNOTSUPP - Operation not supported on transport endpoint

@viviicat
Copy link

This might be related? libusb/libusb#1164

@TheJoshuaByers
Copy link

@viviicat Thanks for diving into this. Looks like the issue lies in libusb compatibility with the Pixel?

@v3rm0n
Copy link
Owner

v3rm0n commented Dec 26, 2023

I think this PR will not make a difference since it's only about device discovery, which currently can only be done from JVM code. Just in case though I quickly threw together a version that uses this PR https://github.com/v3rm0n/m8c-android/actions/runs/7330220947

Try the artifact and see if there's any difference.

@TheJoshuaByers
Copy link

@v3rm0n Thanks for the build! The UI now refreshes like it should (v47 still does not refresh). Unfortunately, I'm getting no audio. I've tried all combinations of audio drivers and interfaces. It would be great if someone could confirm this so we know it's not user error.

@viviicat
Copy link

I won't be able to verify this until next week myself, as i am away from my teensy

@KieranReck
Copy link

Tested v48 on my Pixel 7a today, I found that the screen refresh was still a problem. One time when I loaded the app up the screen refreshed very intermittently, but after that time I was never able to recreate this, it simply wouldnt refresh without a button press.

Audio still appears not to be working

@nrichards
Copy link

nrichards commented Jan 2, 2024

Tested v48 on my Pixel 7a today, I found that the screen refresh was still a problem. One time when I loaded the app up the screen refreshed very intermittently, but after that time I was never able to recreate this, it simply wouldnt refresh without a button press.

Audio still appears not to be working

+1 here on Pixel Fold (similar generation to 7a) using v48 - no audio.

Also, I no longer see "m8" USB audio device option (only 2x "Pixel Fold" devices) - I did before (with #45 (comment)), and speculate my phone is the cause since the v48 binary is the same as the artifact from your comment earlier.

I set up wireless debugging in Android Studio and saw a couple messages. I ran main 802c024, managed to attach & debug, watched logcat, and saw the following warnings:

...
2024-01-01 17:44:27.364 17666-18260 hidapi                  io.maido.m8client                    E  hid_init threw an exception: io.maido.m8client: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
...
2024-01-01 17:44:27.668 17666-18260 BLASTBufferQueue        io.maido.m8client                    E  [SurfaceView[io.maido.m8client/io.maido.m8client.M8SDLActivity]#12](f:0,a:0) rejecting buffer:active_size=2208x1656, requested_size=2208x1656 buffer{size=1646x2194 transform=7}
2024-01-01 17:44:27.670 17666-18260 SDL/ERROR               io.maido.m8client                    E  Invalid draw character packet: expected length 12, got 9
...
2024-01-01 17:44:42.464 17666-18260 .maido.m8client         io.maido.m8client                    E  PIXEL: ioctl err: 1

m8c-android_issues_45-pixelfold_logcat.txt

UPDATE: I see Auto Screen Refresh of the headless m8 now, after I 1) manually launch, 2) attach and debug, then 3) detach .. via stop (just the Java side, I believe, not the Native process). Re-attaching keeps the Auto Refresh going. I estimate FPS to be between 0.5 and 4.

@wangel13
Copy link

wangel13 commented Mar 2, 2024

I checked on s23 ultra, everything works fine except audio. [email protected] and M8_V3_2_7_HEADLESS used.

@wangel13
Copy link

Checked again, audio working! Just need to change audio input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

9 participants