FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.35k stars 72 forks source link

Can't play audio dump file #121

Closed LockonS closed 1 year ago

LockonS commented 1 year ago

Is there any way to play the dumped audio file? Try to decode it with ffmpeg and that didn't went well. The audio dump file could be downloaded here. Plus, the content of this file should be a part of 《Weight Of The World》 from game Nier Automata. I was 100% sure that the audio was streamed successfully as I could hear it play from speaker.

The platform is RPi 3B+ running Raspi OS Bullseye,with the gstreamer build from the latest source code.

# the operation trying to decode the dumped aac file
ffmpeg -i /tmp/uxplay-adump.1.aac -vn -ar 44100 -ac 2 -b:a 320k output.mp3

The uxplay command in this case.

uxplay -v4l2 -vs kmssink -as pulsesink -n Uxplay -nh -vdmp /tmp/uxplay-vdump -admp /tmp/uxplay-adump

The complete error info is extremly long and I've extract some of the console output here.

[aac @ 0x557f418ce0] Multiple frames in a packet.
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] invalid band type
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.1 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.1 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (4) exceeds limit (3).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] SBR was found before the first channel element.
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (7) exceeds limit (5).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] ms_present = 3 is reserved.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (61) exceeds limit (43).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] invalid band type
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
[aac @ 0x557f418ce0] channel element 3.7 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x557f418ce0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] channel element 1.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.15 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.3 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] invalid band type
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Number of bands (50) exceeds limit (33).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (27) exceeds limit (12).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x557f418ce0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x557f418ce0] channel element 3.9 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Number of bands (9) exceeds limit (6).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.2 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.4 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] channel element 2.1 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.6 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.6 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (21) exceeds limit (16).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.14 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] SBR was found before the first channel element.
    Last message repeated 1 times
[aac @ 0x557f418ce0] channel element 2.8 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.2 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.11 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (44) exceeds limit (43).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (15) exceeds limit (10).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.5 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (62) exceeds limit (50).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (70) exceeds limit (45).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.3 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.9 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Dependent coupling is not supported together with LTP
    Last message repeated 15 times
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Number of bands (14) exceeds limit (13).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] TNS filter order 16 is greater than maximum 12.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Number of bands (16) exceeds limit (12).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] decode_pce: Input buffer exhausted before END element found
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.1 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Number of scalefactor bands in group (55) exceeds limit (51).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] invalid band type
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.4 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (12) exceeds limit (11).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.15 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.13 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.10 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.3 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.13 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Pulse data corrupt or invalid.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] SBR was found before the first channel element.
[aac @ 0x557f418ce0] channel element 2.15 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.4 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 2.13 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (47) exceeds limit (45).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Dependent coupling is not supported together with LTP
    Last message repeated 21 times
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] invalid band type
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x557f418ce0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Number of scalefactor bands in group (57) exceeds limit (40).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Number of bands (30) exceeds limit (20).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x557f418ce0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x557f418ce0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x557f418ce0] channel element 1.15 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 3.14 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.5 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (4) exceeds limit (1).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] channel element 1.8 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of bands (50) exceeds limit (30).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of scalefactor bands in group (53) exceeds limit (41).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] skip_data_stream_element: Input buffer exhausted before END element found
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Reserved bit set.
[aac @ 0x557f418ce0] Number of scalefactor bands in group (44) exceeds limit (43).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Error decoding AAC frame header.
Error while decoding stream #0:0: Error number -50531338 occurred
[aac @ 0x557f418ce0] Number of bands (32) exceeds limit (16).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x557f418ce0] Sample rate index in program config element does not match the sample rate index configured by the container.
[auto_aresample_0 @ 0x557f420a60] [SWR @ 0x557f4a86b0] Rematrix is needed between 37 channels and stereo but there is not enough information to do it
[auto_aresample_0 @ 0x557f420a60] Failed to configure output pad on auto_aresample_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
fduncanh commented 1 year ago

I've never actually played the dumped audio (though I have setup pipelines to play the dumped video), just examined its initial bit content for some debugging.

One ought to be able to get it to play through a standalone gstreamer pipeline modeled on the one used in renderers/audio_renderer_gstreamer.c, but I just made a quick try and its not working.

The problem is that it is a raw audio output not in a standard container with headers that the various players use to identify the type of audio. In principle it should be not too difficult to work out what to do, once playback through a standalone gstreamer pipeline is achieved.

LockonS commented 1 year ago

Thanks for the detailed reply. Before start this issue, I've already tried multiple media players, VOX, Movist, IINA, Elmedia, and none of those could identify the audio type, just like you have explained. Yet I haven't got the skillset myself to look into the problem about the audio file headers. But I've got a working 3B+ which could be tinkered around if needed. Would you please post the updates in the thread if any breakthrough was reached?

fduncanh commented 1 year ago

Yes, I should make the audio dump more useful by adding some some option to provide a header or container that allows the dumped audio to be recognized and played by one of the standard tools.

This would be the "alac magic cookie" or its aac equivalent, that are send to gstreamer in the "caps" (Capabilities) entry when the audio pipeline is created in lib/audio_renderer_gstreamer.c

But I don't know how to do this correctly, and don't have time right now to research it.

Best would be if someone knowledgable shows up to provide guidance .....