MoleMan1024 / audiowagon

AudioWagon will play audio files from an attached USB flash drive in cars equipped with Android Automotive OS
https://moleman1024.github.io/audiowagon/
GNU General Public License v3.0
58 stars 17 forks source link

FAT32 USB CD Player doesn't work. #95

Closed christephan1 closed 1 year ago

christephan1 commented 1 year ago

Describe the issue The CD player in question: https://www.amazon.com/BDYING-External-Universal-Machine-Navigation-Plug/dp/B09XZXXB9T

Tested on my Android phone (Pixel 5a) and the CD player is working fine just like the same as a USB flash drive. Audio tracks could be played back in VLC player properly. File browser showed up a list of audio tracks as Track01.WAV/Track02.WAV/... files.

Plugged into Windows. It shown up as an USB mass storage device with FAT32 filesystem. With those WAV files shown up in root directory. (Same as Android phone.) Tired copy (not rip, just drag-and-drop in file Explorer) these WAV files to a "SanDisk Extreme GO 32GB" USB flash drive and the USB stick does work with AudioWagon properly.

The USB CD player looks just like a USB FAT32 device in PC and Android phone. So I think it should work with AudioWagon also.

Any clue? Same issue as the "USB to SD card adaptor" compatible issue? Does AudioWagon support read-only USB sticks? Missing a driver available on normal Android but not on AAOS? And because the CD player is read-only. Is it possible to get a log file in such case?

To Reproduce 1.Plug in the USB CD Player, AAOS will compliant the USB device not supported. (Same behavior as I plugged in a USB flash drive.)

2.AudioWagon will have a pop-up to ask for accessing the USB device. (If plug in a USB flash drive, the pop-up shown up within seconds. While when plugging in the CD player, the pop-up obvious take longer time to be shown up.)

3.Press OK to allow access.

4.Nothing happened. No files shown up. No error messages. In the setting menu, the usb status stay at "Not connected." (If the plugged in device is an USB flash drive, it does work properly.)

Expected behavior Work like a USB flash drive.

AudioWagon version 2.3.1

Car version 2.4 Volvo XC40

Logfiles the CD player is read-only. Is it possible to get a log file in such case?

christephan1 commented 1 year ago

Unplug and plug in a working USB stick could get the log file.

The related messages is:

2022-11-29 10:21:54.916 [DEBUG   ][6995-6995  ][USBDevConn              ] onReceive(de.moleman1024.audiowagon.AudioBrowserService@b1d1100; Intent { act=android.hardware.usb.action.USB_DEVICE_ATTACHED flg=0x11000010 (has extras) })
2022-11-29 10:21:54.917 [DEBUG   ][6995-6995  ][USBMediaDevice          ] isToBeIgnored((1276, 369) / (0x4fc, 0x171))
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ] Not compatible device: USBMediaDevice{USBDeviceProxy(deviceName='/dev/bus/usb/001/025', productId=369, vendorId=1276, serialNumber=, massStorageDevice=0);1636066627}
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ] de.moleman1024.audiowagon.exceptions.DeviceNotCompatible: Not compatible device: USBMediaDevice{USBDeviceProxy(deviceName='/dev/bus/usb/001/025', productId=369, vendorId=1276, serialNumber=, massStorageDevice=0);1636066627}
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at de.moleman1024.audiowagon.filestorage.usb.USBDeviceConnections.checkIsCompatibleUSBMassStorage(USBDeviceConnections.kt:184)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at de.moleman1024.audiowagon.filestorage.usb.USBDeviceConnections.getUSBMassStorageDeviceFromIntent(USBDeviceConnections.kt:202)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at de.moleman1024.audiowagon.filestorage.usb.USBDeviceConnections.access$getUSBMassStorageDeviceFromIntent(USBDeviceConnections.kt:47)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at de.moleman1024.audiowagon.filestorage.usb.USBDeviceConnections$usbBroadcastReceiver$1.onReceive(USBDeviceConnections.kt:91)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1580)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.os.Handler.handleCallback(Handler.java:938)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.os.Handler.dispatchMessage(Handler.java:99)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.os.Looper.loop(Looper.java:223)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at android.app.ActivityThread.main(ActivityThread.java:7664)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at java.lang.reflect.Method.invoke(Native Method)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
2022-11-29 10:21:54.949 [ERROR   ][6995-6995  ][USBDevConn              ]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
christephan1 commented 1 year ago

Full log here audiowagon_2022-11-29_10-25-47.log

MoleMan1024 commented 1 year ago

@christephan1 : the player will need to be FAT32 but will also need to support the SCSI bulk transfer command set. You need to check if your device supports those endpoints (by using appropriate tools, I think on Linux maybe lsscsi could check that). If it doesn't have this, the library I use will not support it. Please check if you can get that info.

MoleMan1024 commented 1 year ago

On Windows I found this tool you could use: USB Device Tree Viewer V3.8.2

This image from that tool shows the endpoints for bulk transfer that are required: image

If the CD player has more endpoints than that it will not work, but maybe could be made to work with the library. If it does not have these two endpoints (Bulk IN/OUT) it can never work with the library.

christephan1 commented 1 year ago

Thanks for the tool. Was trying to get a local Linux PC. Looks the CD player doesn't support SCSI, it only supported interface is SFF-8020i MMC-2.

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x08 (Mass Storage)
bInterfaceSubClass       : 0x02 (SFF-8020i, MMC-2 - ATAPI)
bInterfaceProtocol       : 0x50 (Bulk-Only Transport)
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 00 00 02 08 02 50 00                        .......P.

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 81 02 00 02 00                              .......

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 02 02 00 02 00                              .......
MoleMan1024 commented 1 year ago

@christephan1 : yeah looks like it. Sorry the library does not support this CD player then.