LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-24-2021, 09:51 AM   #1
Chryseus
LQ Newbie
 
Registered: Aug 2021
Distribution: Arch Linux
Posts: 6

Rep: Reputation: Disabled
Akaso V50X - Mass storage doesn't work


I recently got an Akaso V50X action cam, reading the micro sd card with a card reader works fine, however when trying to access it via usb mass storage it doesn't work, it works fine in Windows.
lsusb shows the mass storage as: 0525:a4a5 Netchip Technology, Inc. Linux-USB File-backed Storage Gadget

Here is the output of dmesg: https://paste.debian.net/hidden/2036778d/
It appears to detect that there is an sd card there but is unable to read it at all.
 
Old 08-26-2021, 08:51 PM   #2
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Rep: Reputation: 66
i don't have this device but i did some research and it looks like the driver you need might be under the kernel option CONFIG_USB_NET2280. in menuconfig you can turn that on by following this:

Code:
Device Drivers --->
    [*] USB Support --->
        [*/M] USB Gadget Support --->
            USB Peripheral Controller --->
                [*/M] NetChip NET228x / PLX USB3x8x
then rebuild, of course, and modprobe net2280 if it doesn't automatically detect it on startup.

can you try that and see if it fixes it?
 
Old 08-27-2021, 11:21 AM   #3
Chryseus
LQ Newbie
 
Registered: Aug 2021
Distribution: Arch Linux
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andigena View Post
i don't have this device but i did some research and it looks like the driver you need might be under the kernel option CONFIG_USB_NET2280. in menuconfig you can turn that on by following this:

Code:
Device Drivers --->
    [*] USB Support --->
        [*/M] USB Gadget Support --->
            USB Peripheral Controller --->
                [*/M] NetChip NET228x / PLX USB3x8x
then rebuild, of course, and modprobe net2280 if it doesn't automatically detect it on startup.

can you try that and see if it fixes it?
It seems net2280 is already present in the arch linux kernel however it was not loading, I manually loaded it but it doesn't appear to have made any changes.
https://paste.debian.net/hidden/1dd3ff34/
 
Old 08-27-2021, 03:15 PM   #4
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Rep: Reputation: 66
1. do you have standard non-free firmware installed? if not, install it. i'm not sure what the package name for that is on arch, but it's firmware-linux-nonfree on debian/ubuntu and sys-kernel/linux-firmware on gentoo, so look for something to that effect. if that doesn't work:
2. also try enabling CONFIG_USB_UAS and make sure basic SCSI disk support is enabled (CONFIG_SCSI and CONFIG_BLK_DEV_SD). if that doesn't work:
3. this could be a disk problem that windows is dumb enough to ignore, or which is non-fatal but treated as such by the linux driver. faulty sd cards are super common and can even end up in manufacturer supply chains sometimes. if you try a different sd card in the same device, does the same issue occur?
 
Old 08-27-2021, 04:06 PM   #5
Chryseus
LQ Newbie
 
Registered: Aug 2021
Distribution: Arch Linux
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andigena View Post
1. do you have standard non-free firmware installed? if not, install it. i'm not sure what the package name for that is on arch, but it's firmware-linux-nonfree on debian/ubuntu and sys-kernel/linux-firmware on gentoo, so look for something to that effect. if that doesn't work:
2. also try enabling CONFIG_USB_UAS and make sure basic SCSI disk support is enabled (CONFIG_SCSI and CONFIG_BLK_DEV_SD). if that doesn't work:
3. this could be a disk problem that windows is dumb enough to ignore, or which is non-fatal but treated as such by the linux driver. faulty sd cards are super common and can even end up in manufacturer supply chains sometimes. if you try a different sd card in the same device, does the same issue occur?
I don't believe arch splits out non-free firmware, it's just a single package https://archlinux.org/packages/core/any/linux-firmware/
CONFIG_USB_UAS is set to module and is loaded.
CONFIG_SCSI and CONFIG_BLK_DEV_SD are enabled.
I did consider it being a card problem however I don't think this is the case, it's a brand new SanDisk ultra 64GB, it reads fine with a usb card reader and there is nothing unusual in dmesg, fdisk -l gives:
Code:
Disk /dev/sdg: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdg1       32768 124735487 124702720 59.5G  b W95 FAT32
I'll try dig up another one anyway and give that a go, it is formatted by the device.
 
Old 08-27-2021, 06:02 PM   #6
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Rep: Reputation: 66
Quote:
Originally Posted by Chryseus View Post
I don't believe arch splits out non-free firmware, it's just a single package https://archlinux.org/packages/core/any/linux-firmware/
CONFIG_USB_UAS is set to module and is loaded.
CONFIG_SCSI and CONFIG_BLK_DEV_SD are enabled.
I did consider it being a card problem however I don't think this is the case, it's a brand new SanDisk ultra 64GB, it reads fine with a usb card reader and there is nothing unusual in dmesg, fdisk -l gives:
Code:
Disk /dev/sdg: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdg1       32768 124735487 124702720 59.5G  b W95 FAT32
I'll try dig up another one anyway and give that a go, it is formatted by the device.
the fact that it's capable of reading basic data about the drive and the partitions on it indicates to me that the driver probably functions to some extent. the fact that fdisk is saying the disk identifier is 0x00000000 is a dead giveaway to me that there is a severe controller issue in the SD card or maybe the SD to USB interface. i also noticed that in your dmesg log it thinks that the device is 2 TB when it looks like it's actually 64 GB, another thing suggesting one of those problems. compare my results from a regular 32 GB flash drive formatted in the same manner:
Code:
Disk /dev/sdb: 28.9 GiB, 31029460992 bytes, 60604416 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2c3babd2 <---- unique 32-bit integer, not 0 

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1        2048 60604415 60602368 28.9G 83 Linux

[48061.314726] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
[48061.430171] usb 2-1.2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[48061.430189] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[48061.430196] usb 2-1.2: Product: DataTraveler 3.0
[48061.430200] usb 2-1.2: Manufacturer: Kingston
[48061.430204] usb 2-1.2: SerialNumber: D067E5162216E3611605743C
[48061.430542] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[48061.430666] scsi host6: usb-storage 2-1.2:1.0
[48062.451148] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[48062.451317] sd 6:0:0:0: Attached scsi generic sg2 type 0
[48062.451844] sd 6:0:0:0: [sdb] 60604416 512-byte logical blocks: (31.0 GB/28.9 GiB) <--- correct size
[48062.453094] sd 6:0:0:0: [sdb] Write Protect is off
[48062.453099] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 00
[48062.453762] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[48062.658977]  sdb: sdb1
[48062.677748] sd 6:0:0:0: [sdb] Attached SCSI removable disk
so i think it's fairly likely this is the result of a hardware issue in some capacity (or a catastrophic driver/firmware failure, i suppose), though it's unclear exactly why windows is still seeming to work with it. definitely try a new SD card. you could also try manually reformatting the SD card, in case the camera is generating bad partition tables. and if nothing works and your camera is under warranty, you might want to simply exchange the entire camera.
 
Old 08-27-2021, 08:00 PM   #7
Chryseus
LQ Newbie
 
Registered: Aug 2021
Distribution: Arch Linux
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andigena View Post
the fact that it's capable of reading basic data about the drive and the partitions on it indicates to me that the driver probably functions to some extent. the fact that fdisk is saying the disk identifier is 0x00000000 is a dead giveaway to me that there is a severe controller issue in the SD card or maybe the SD to USB interface. i also noticed that in your dmesg log it thinks that the device is 2 TB when it looks like it's actually 64 GB, another thing suggesting one of those problems. compare my results from a regular 32 GB flash drive formatted in the same manner:
Code:
Disk /dev/sdb: 28.9 GiB, 31029460992 bytes, 60604416 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2c3babd2 <---- unique 32-bit integer, not 0 

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1        2048 60604415 60602368 28.9G 83 Linux

[48061.314726] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
[48061.430171] usb 2-1.2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[48061.430189] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[48061.430196] usb 2-1.2: Product: DataTraveler 3.0
[48061.430200] usb 2-1.2: Manufacturer: Kingston
[48061.430204] usb 2-1.2: SerialNumber: D067E5162216E3611605743C
[48061.430542] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[48061.430666] scsi host6: usb-storage 2-1.2:1.0
[48062.451148] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[48062.451317] sd 6:0:0:0: Attached scsi generic sg2 type 0
[48062.451844] sd 6:0:0:0: [sdb] 60604416 512-byte logical blocks: (31.0 GB/28.9 GiB) <--- correct size
[48062.453094] sd 6:0:0:0: [sdb] Write Protect is off
[48062.453099] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 00
[48062.453762] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[48062.658977]  sdb: sdb1
[48062.677748] sd 6:0:0:0: [sdb] Attached SCSI removable disk
so i think it's fairly likely this is the result of a hardware issue in some capacity (or a catastrophic driver/firmware failure, i suppose), though it's unclear exactly why windows is still seeming to work with it. definitely try a new SD card. you could also try manually reformatting the SD card, in case the camera is generating bad partition tables. and if nothing works and your camera is under warranty, you might want to simply exchange the entire camera.
I remade the partition table and formatted it with mkfs.fat -F32, however the action cam does not accept this and requires that it is formatted by the device.
The identifier is now present and reads fine with a card reader, no luck with the usb mass storage still, it's still unable to read the device size.
I made a comparison of my initial format and what the action cam has done: https://paste.debian.net/hidden/dbb76709/
Nothing is jumping out at me but I'm no expert when it comes to partitions, I'm not sure if this is a partition issue or a communication issue since it can read it just fine in a card reader, if there was an issue caused by the formatting I would expect it to be completely broken.
I'm going to contact the manufacturer and see if I can get any help from them.
 
Old 08-27-2021, 08:17 PM   #8
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Rep: Reputation: 66
Quote:
Originally Posted by Chryseus View Post
I remade the partition table and formatted it with mkfs.fat -F32, however the action cam does not accept this and requires that it is formatted by the device.
The identifier is now present and reads fine with a card reader, no luck with the usb mass storage still, it's still unable to read the device size.
I made a comparison of my initial format and what the action cam has done: https://paste.debian.net/hidden/dbb76709/
Nothing is jumping out at me but I'm no expert when it comes to partitions, I'm not sure if this is a partition issue or a communication issue since it can read it just fine in a card reader, if there was an issue caused by the formatting I would expect it to be completely broken.
I'm going to contact the manufacturer and see if I can get any help from them.
oh yes that's right about the card reader, i forgot that part. my guess is that something is wrong with the controller for the usb mass storage, then. it also looks like the action cam is not writing some device information that is expected and written when formatted in linux (serial number, for example), which could cause problems with the driver. contacting the manufacturer seems like a good idea.
 
Old 08-27-2021, 08:29 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,640

Rep: Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279Reputation: 6279
Quote:
Quirks match for vid 0525 pid a4a5: 10000
I do not think your problem has anything to do with the SD card itself. I would guess there is a fault in the camera firmware and some "patch" is / was required that fixes the communication problem. Your kernel could be to old or a firmware upgrade made the quirk no longer required or something like that.
Hopefully contacting the manufacture will help solve the problem.

Last edited by michaelk; 08-27-2021 at 08:30 PM.
 
Old 08-28-2021, 04:47 PM   #10
Chryseus
LQ Newbie
 
Registered: Aug 2021
Distribution: Arch Linux
Posts: 6

Original Poster
Rep: Reputation: Disabled
I have managed to solve the problem, I changed the usb-storage quirks mode to NO_READ_CAPACITY_16 (e), I also tried no quirks mode but this is clearly needed.
For future reference to anyone having this problem you can add options usb-storage quirks=0525:a4a5:e to a .conf file in /etc/modprobe.d, alternatively if usb-storage is not a module add the boot command usb-storage.quirks=0525:a4a5:e

I have reported this problem to the manufacturer so it's possible future firmware versions may not require this fix.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: SUSE Enterprise Storage 3 released for serious storage work LXer Syndicated Linux News 0 06-07-2016 05:11 AM
LXer: SUSE Enterprise Storage 3 released for serious storage work LXer Syndicated Linux News 0 06-06-2016 08:33 PM
USB Mass storage devices don't work in linux 2.6.[9,11.x] _private Debian 9 11-06-2013 06:46 AM
Getting USB Mass Storage device to work... kmcgavran Linux - Hardware 10 09-06-2006 02:37 AM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration