USB Issues while playing contents from usb device

Hi,

We are currently experiencing a very annoying issue with out Apalis IMX8 Ixora Boards.
We’re trying to play video contents from a USB key.
Some contents in 720p, or 1080p.

Using basic gstreamer command line such as:

gst-launch-1.0 playbin uri=file:////media/usb/truc.mkv

It appears that after 10, 20 or 30 seconds the playback freezes…but in the console I get the following kernel messages:

[ 683.446009] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using cdns-usb3
[ 689.131018] cdns-mhdp-imx 56268000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
[ 689.168828] cdns-mhdp-imx 56268000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
[ 689.206120] cdns-mhdp-imx 56268000.hdmi: 0,ff,ff,ff,ff,ff,ff,0
[ 689.605098] [VPU Decoder] firmware version is 1.7.0
[ 824.759283] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using cdns-usb3

We don’t really understand the messages related to the USB. Is it a hw issue or something that could be adjusted in the Kernel ?
Have you already experienced this issue ?

Cheers,

Karim

Hello @karim ,

Greetings!

Could you tell us if the playback works fine if you play the video from eMMC instead of a USB Stick? Does this also happen with other kinds of video formats such as MP4, MPEG, etc., ?

Could you please also send us the output of /etc/os-release ?

BR,
Janani

Hi @saijanani.tx

  • The problem occurs whatever the video format (mkv, mp4 etc.)

  • It doesn’t occur if the media is played from eMMC.

  • Please find below the os-release:

root@apalis-imx8-06804647:/opt/pga/pgavod/bin# more /etc/os-release
ID=pga-multimedia
NAME="PGA multimedia image based on TDX xwayland"
VERSION="5.4.0-devel-20211007095610+build.0 (dunfell)"
VERSION_ID=5.4.0-devel-20211007095610-build.0
PRETTY_NAME="PGA multimedia image based on TDX xwayland 5.4.0-devel-20211007095610+build.0 (dunfell)"

Cheers,

Karim

Hi @karim!

From your os-release output, I can see that you did some level of customization of the Reference Multimedia Image.

Have you tried to reproduce the same issue on the “default” reference image?

Best regards,

Hi @henrique.tx

We’ve just tested with a TDX default reference image.
We exactly have the same issue:

...
[ 682.340799] [VPU Decoder] firmware version is 1.7.0
[ 771.197650] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using cdns-usb3
[ 873.599345] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using cdns-usb3
...

And the /etc/os-release:

root@apalis-imx8-06980672:~# cat /etc/os-release
ID=tdx-xwayland
NAME="TDX Wayland with XWayland"
VERSION="5.4.0+build.11 (dunfell)"
VERSION_ID=5.4.0-build.11
PRETTY_NAME="TDX Wayland with XWayland 5.4.0+build.11 (dunfell)"

Please not the playback from eMMC is also working fine.

Below the gstreamer pipeline we’ve used:

gst-launch-1.0 -vvv filesrc location=/media/sda1/rev_cut.mkv ! matroskademux name=demux demux. ! h265parse ! queue ! v4l2h265dec ! queue ! imxvideoconvert_g2d ! autovideosink

Cheers,

Karim

hi @karim

The kernel messages are related to usb. Did you try to use the Port X8 (upper) and X7 on Ixora?

Hello,

I am working with Karim and I have done some tests.

If I plug the usb key on X8 USBH4 ( upper ) , it is detected by the kernel as cdns-usb3 (superspeed usb gen 1, aka usb3.0 )
If I plug the usb key on X8 USBO1 ( lower ) , it is detected by the kernel as ci_hdrc ( high-speed usb , aka usb2.0 )
The X7 (USBH3 ) connector is a USB2.0 connector , there is only 4 wires, and the usb key is detected as ci_hdrc as well.

Regards,

1 Like

USBH4 :
[ 442.290518] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using cdns-usb3
[ 442.317056] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 442.324109] scsi host1: usb-storage 2-1:1.0

USB01 :
[ 510.159346] usb 3-1: new high-speed USB device number 3 using ci_hdrc
[ 510.322603] usb-storage 3-1:1.0: USB Mass Storage device detected
[ 510.329609] scsi host1: usb-storage 3-1:1.0

USBH3 :
[ 1272.313177] usb 4-1.3: new high-speed USB device number 5 using ci_hdrc
[ 1272.443961] usb-storage 4-1.3:1.0: USB Mass Storage device detected
[ 1272.450837] scsi host2: usb-storage 4-1.3:1.0

If I perform a rsync ( with and without bandwith limitation ) on the USB key USBH4 , it works well :

root@apalis-imx8-06980672:~# rsync -a --progress --bwlimit=8000 /media/sda1/rev_cut.mkv /home/root
sending incremental file list
rev_cut.mkv
1,635,782,831 100% 7.67MB/s 0:03:23 (xfr#1, to-chk=0/1)
root@apalis-imx8-06980672:~# rm rev_cut.mkv
root@apalis-imx8-06980672:~# rsync -a --progress /media/sda1/rev_cut.mkv /home/root
sending incremental file list
rev_cut.mkv
1,635,782,831 100% 45.39MB/s 0:00:34 (xfr#1, to-chk=0/1)
root@apalis-imx8-06980672:~# rm rev_cut.mkv
root@apalis-imx8-06980672:~# rsync -a --progress --bwlimit=1000 /media/sda1/rev_cut.mkv /home/root
sending incremental file list
rev_cut.mkv
1,635,782,831 100% 1000.28kB/s 0:26:36 (xfr#1, to-chk=0/1)

if I do a playback with gstreamer, it fails in USB3.0 mode ( USBH4 ) and doesn’t fail in USB2.0 mode ( USBO1 and USBH3 )

1 Like

Hi @karim and @f.mazur !

We tried to reproduce your issue, but it worked here for us using a SanDisk USB3.0 stick both on upper USB port of X8 (USB3.0) and on X7 (USB2.0).

Could it be an issue related to the USB stick that you are using? Can you check if your USB is 2.0 or 3.0?

Best regards,

Hello,

I’ve tried 3 different keys. All of them are usb 3.0 ( for example corsaire slider X1 voyager ), and same result.
In the previous message, the bitrate at full speed is too fast to be only USB 2.0 ( 45MB/sec ).

Also, I’ve tried 3 different couples of ixora + apalis.

All of this in order to exclude an hw issue.

I will perform some other tests next week.

Regards,

Hi @f.mazur !

Could you please share the full version of both the modules and carrier boards that you see the issue?

Best regards,

hello,

Sorry to answer very late, I was working on another urgent project. I am working again on this card … how can I find the full version of the modules and carrier board ?

Is it a label on the card or do I have to launch a software to retrieve version ?

For the moment, I have only one board :

  • ixora : V1.2A 10852866 on the label ( there is no other label on the card)
  • apalis IMX8 : Apalis IMX8QM 4GB WB IT V 1.1C 06980672

Regards,

Hi @f.mazur ,

Thanks for the sharing the versions.

First of all, it might be helpful if you could share the output of lsusb -vv when the USB device is plugged in.

Then secondly could you send the output of the strace command. Should look something like this:

strace gst-launch-1.0 playbin uri=file:////media/usb/truc.mkv

If strace is not available, you would need to include that in your image.

We’re looking forward to you answer.

Best Regards
Kevin

Hello,

lsusb : lsusb -vv - Pastebin.com
strace gst-launch-1.0 playbin uri=file:////home/root/rev_cut.mkv flags=83 video_sink=kmssink : strace emmc - Pastebin.com
strace gst-launch-1.0 playbin uri=file:////media/sda1/rev_cut.mkv flags=83 video_sink=kmssink : strace usb - Pastebin.com

You can see on strace usb log :

ppoll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}], 2, NULL, NULL, 0) = ? ERESTARTNOHAND (To be restarted if no handler)
strace: Process 1119 detached
handling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:03:26.797952282

There is a “no handler” message , that’s interrupt the playback. As if the usb key has been unplugged.

It doesn’t happen if I plug the key on the USB2.0 port, only USB3.0.

It doesn’t happen if I do a copy with rsync.

Hi @f.mazur !

Could it be some problem with the video that you are trying to playback?

Could you please share it and/or share the output of the gst-discover

Would be something like this:

 $ gst-discoverer-1.0 xablau.mp4
Analyzing file:///xablau.mp4
Done discovering file:///xablau.mp4

Properties:
  Duration: 3:38:25.084000000
  Seekable: yes
  Live: no
  container: Quicktime
    audio: MPEG-4 AAC
      Stream ID: fe8f7e13a4c40304ee29b2bccb915cc60cca2ba33ae7b7929849fed11fc574f5/002
      Language: <unknown>
      Channels: 2 (front-left, front-right)
      Sample rate: 48000
      Depth: 32
      Bitrate: 192000
      Max bitrate: 192000
    video: H.264 (High Profile)
      Stream ID: fe8f7e13a4c40304ee29b2bccb915cc60cca2ba33ae7b7929849fed11fc574f5/001
      Width: 1920
      Height: 1080
      Depth: 24
      Frame rate: 60/1
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 299087
      Max bitrate: 0

Best regards,

Hello,

Here is the result of the gst-discover command :

root@apalis-imx8-06980672:~# gst-discoverer-1.0 /media/sda1/rev_cut.mkv
Analyzing file:///media/sda1/rev_cut.mkv
Stream with high frequencies VQ coding
Stream with high frequencies VQ coding
No accelerated IMDCT transform found
Done discovering file:///media/sda1/rev_cut.mkv

Properties:
Duration: 0:05:09.438000001
Seekable: yes
Live: no
container: Matroska
subtitles: PGS subtitles
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/007:2499946052136713349
Language: fr
subtitles: PGS subtitles
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/006:2397864329059573688
Language: fr
subtitles: PGS subtitles
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/005:2329882206411495315
Language: en
audio: DTS
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/004:7771059134918665382
Language: fr
Channels: 6 (front-left, front-right, front-center, lfe1, rear-left, rear-right)
Sample rate: 48000
Depth: 32
Bitrate: 768000
Max bitrate: 0
audio: AC-3 (ATSC A/52)
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/003:11932342381481426314
Language: en
Channels: 6 (front-left, front-right, front-center, lfe1, rear-left, rear-right)
Sample rate: 48000
Depth: 32
Bitrate: 448000
Max bitrate: 0
audio: DTS
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/002:8556768153031864196
Language: en
Channels: 6 (front-left, front-right, front-center, lfe1, rear-left, rear-right)
Sample rate: 48000
Depth: 32
Bitrate: 1536000
Max bitrate: 0
video: H.265 (Main 10 Profile)
Stream ID: 616061833675a933520c6413223af0a40adf529b19b0d30d2097ba52369e375b/001:801476594364175035
Width: 3840
Height: 2160
Depth: 24
Frame rate: 24000/1001
Pixel aspect ratio: 1/1
Interlaced: false
Bitrate: 0
Max bitrate: 0

The playback “works” well if I read from internal emmc , or if I plug the key on a usb2.0 port.

( I put “works” with quotes because we have several playback issues but not related to the usb ).

Hi @f.mazur !

I just tried again using the same BSP version as yours (5.4.0) with some example mp4 video to playback directly from a USB stick and I was able to even reproduce it with audio (via HDMI).

This is all the information from my setup:

gst-launch-1.0 filesrc location=/media/sda1/Gravity\ -\ 2K\ Trailer.mp4 ! \
qtdemux name=demux \
demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! alsasink device=hw:2,0 \
demux.video_0 ! queue ! decodebin ! videoconvert ! videoscale    ! autovideosink

The fact that we are not able to reproduce your problem really makes it hard to help…

Aren´t you able to spot any differences between my setup and yours?

Seems like you tried already several videos (and several formats), USB sticks, Apalis iMX8QM modules, Ixoras…

But we can do other tests:

  • Does the issue happen if you use a USB 2.0 on any of the USB ports on your Ixora?
  • Have you tried a newer BSP?
  • Is it possible that you are using a USB hub? If yes, Could you please try without it?

I was also able to execute the pipeline when connecting the same USB stick to a USB 2 port and also playing the video from eMMC as well.


Linux about USB Stick

When inserted:

[ 6076.454913] scsi 1:0:0:0: Direct-Access     SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
[ 6076.464100] sd 1:0:0:0: [sda] 30031872 512-byte logical blocks: (15.4 GB/14.3 GiB)
[ 6076.472619] sd 1:0:0:0: [sda] Write Protect is off
[ 6076.477464] sd 1:0:0:0: [sda] Mode Sense: 43 00 00 00
[ 6076.477777] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 6076.549163]  sda: sda1
[ 6076.554358] sd 1:0:0:0: [sda] Attached SCSI removable disk
[ 6076.842143] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

lsusb information about it

root@apalis-imx8-06980209:~# lsusb
Bus 002 Device 005: ID 0781:558a SanDisk Corp. Ultra
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 1286:204e Marvell Semiconductor, Inc.
Bus 003 Device 002: ID 0424:3503 Microchip Technology, Inc. (formerly SMSC)
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@apalis-imx8-06980209:~# lsusb -v -s 002:005 | grep -i bcd
can't get debug descriptor: Resource temporarily unavailable
  bcdUSB               3.00
  bcdDevice            1.00

Best regards,