tinycompress icon indicating copy to clipboard operation
tinycompress copied to clipboard

Better documentation with the examples

Open Andres6936 opened this issue 4 years ago • 7 comments

I have compiled the program and when I run the cplay script I get an error:

andres6936@Tierra ~/CLionProjects/tinycompress-master/src/utils $ cplay TestAudio.mp3 
Error: Can't find sync word

I have already checked out different mp3 files and I keep getting the same error. I have also tried different options, but it is always the same error.

Andres6936 avatar Nov 19 '20 15:11 Andres6936

Well the cplay is a simple test app which looks for sync word for MP3 files at default position, lots is files will not have it, hence your experience.

I would recommend trying a better tool like fcplay which utilises libavcodec for parsing for files and supports few other formats like mp3, FLAC etc

Fcplay can be enabled by providing additional flag to gitcompile (not this is licensed as LGPL)

./gitcompile --enable-fcplay

vinodkoul avatar Nov 20 '20 06:11 vinodkoul

I have performed the steps you have mentioned, compiled and when I use it I receive the following message.

andres6936@Tierra ~/CLionProjects/tinycompress-master/src/utils-lgpl $ ./fcplay  TestAudio.mp3 
Unable to open TestAudio.mp3: Invalid data found when processing input

I have tried with several mp3's and the error still persists.

Andres6936 avatar Nov 20 '20 14:11 Andres6936

Sorry somehow this slipped thru..

Can you please tell me:

  1. which hardware device you are using this one
  2. give me steps to reproduce this
  3. attach the mp3 file you tried with

vinodkoul avatar Feb 01 '21 05:02 vinodkoul

andres6936@Tierra ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  1. attach the mp3 file you tried with

With any mp3 file: MPEG-1 Layer 3 - Bitrate 320 kbps - Sample rate: 44100 Hz

Andres6936 avatar Feb 01 '21 13:02 Andres6936

andres6936@Tierra ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Okay can you try cplay with -v option.

Also I feel there is a bit of confusion as well as we need a compress device (with HW support and HW DSP) for this to work. Would you mind sending output of ls /dev/snd/ on your system... though I agree the error should have made it obvious to user that on this system cplay can't work, that is something I intend to fix

vinodkoul avatar Feb 01 '21 14:02 vinodkoul

andres6936@Tierra ~ $ ./fcplay -v TestAudio.mp3 
play_samples: entry
Unable to open TestAudio.mp3: Invalid data found when processing input
andres6936@Tierra ~ $ ls /dev/snd/
by-path  controlC0  hwC0D2  pcmC0D0c  pcmC0D0p  pcmC0D1p  pcmC0D2c  seq  timer
andres6936@Tierra ~ $ 

Andres6936 avatar Feb 01 '21 14:02 Andres6936

andres6936@Tierra ~ $ ./fcplay -v TestAudio.mp3 
play_samples: entry
Unable to open TestAudio.mp3: Invalid data found when processing input
andres6936@Tierra ~ $ ls /dev/snd/
by-path  controlC0  hwC0D2  pcmC0D0c  pcmC0D0p  pcmC0D1p  pcmC0D2c  seq  timer
andres6936@Tierra ~ $ 

Right so no compr device exists here, so you cannot play mp3 files with this. I agree that error should have been clearer, I shall use fix that up..

You would need a system which supports compressed audio offload in order for you to play mp3 files with tinycompress Thanks

vinodkoul avatar Feb 02 '21 15:02 vinodkoul