Not working on Pixel 6
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.
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
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.
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!
I have the same problem with v1.0.6, but with v1.0.5 the screen works great.
Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.
Any changes in the latest release? https://github.com/v3rm0n/m8c-android/releases/tag/v1.0.17
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.
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.
Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.
Just a heads up: I don't have a Pixel so it would be great if somebody else can look into it.
This is something I had wanted to look into, but I haven't had a lot of free time lately.
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
Not seeing any change with 6a and the new release. Fiddled with Idle ms and didn't notice much.
Issue is marked as stale since there has been no activity for two weeks. It will be automatically closed in 5 days.
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?
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! :)
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!
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.
(i have an actual m8 and so i don't use headless much anymore, but I feel for folks who only have headless available!)
(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!
If you need any help debugging, I have a Pixel 7 Pro where I can test the app!
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.
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
https://github.com/laamaa/m8c/blob/9d70859ec2d75be67e2e80b04fb1f5b85b371737/src/usb_audio.c#L24 - here's the underflow bit I'm referring to, for reference.
The return code of libusb_submit_transfer is -1 = LIBUSB_ERROR_IO - "Input/output error."
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
This might be related? https://github.com/libusb/libusb/pull/1164
@viviicat Thanks for diving into this. Looks like the issue lies in libusb compatibility with the Pixel?
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.
@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.