teddycloud
teddycloud copied to clipboard
TAP feature not working properly
I've just experimenting with TAPs...and experiencing some strange behaviour...one of those is, when TAP starts encoding into its corresponding *.taf.tmp file, the box blinks red and shutdown emidently. It seems that the content of *taf.tmp is not sent to the box while encoding? Since the conversion will abort when I just restart the box and try to play the TAP again, I just let the box shutdown (waiting for finishing conversion). Which is fine for short content. But When it is a longer content, the converions aborts either, caused by time out...since nobdy is consuming the stream? So it seems that I cant consume the stream befor its conversion is done, but I cant complete the conversion due to not consuming it.
This is the corresponding docker log when aborting conversion by time out while box was / is shutted down:
ERROR|handler_cloud.c:0667:handleCloudContent| >> file /teddycloud/data/library/by/tapID/musikvideos.taf.tmp not available or not send, error=Timeout [220]... 2024-11-06T17:52:27.508849322Z INFO |toniefile.c:0778:ffmpeg_stream| Encoding aborted, active flag set to false 2024-11-06T17:52:27.508884544Z [aost#0:0/pcm_s16le @ 0x55563df0cc60] Error submitting a packet to the muxer: Broken pipe 2024-11-06T17:52:27.508889285Z [out#0/s16le @ 0x55563dc68320] Error muxing a packet 2024-11-06T17:52:27.508997821Z [out#0/s16le @ 0x55563dc68320] Error writing trailer: Broken pipe 2024-11-06T17:52:27.509003209Z [out#0/s16le @ 0x55563dc68320] Error closing file: Broken pipe 2024-11-06T17:52:27.509068838Z [out#0/s16le @ 0x55563dc68320] video:0kB audio:234109kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown 2024-11-06T17:52:27.509074579Z size= 234101kB time=00:20:48.95 bitrate=1535.5kbits/s speed=13.6x 2024-11-06T17:52:27.511752016Z Conversion failed! 2024-11-06T17:52:27.523801214Z INFO |toniefile.c:0622:ffmpeg_decode_audio_end| Stopped ffmpeg with code=57344... 2024-11-06T17:52:27.523820881Z ERROR|toniefile.c:0795:ffmpeg_stream| Could not close FFmpeg pipe error=Operation aborted [15] 2024-11-06T17:52:27.546289533Z ERROR|toniefile.c:0814:ffmpeg_stream| TAF encoding failed, deleting TAF
Another user in telegram had similar if not same experience:
Hello, I have tried to combine several TAFs via a TAP (playlist). As soon as I assign this TAP to a TAG, a *.taf.tmp is created when the TAG is set up. I can play this via the browser. However, the Toniebox flashes red several times and then switches off.
Is there anything I can do / adjust to make conversion not abort / timed out ?
If there is anything I can provide you with, just tell me.
Edit: Toniebox is cc3200 TeddyCloud version is 0.6.2 (203f12d) ubuntu linux aarch64 docker host is raspi5-8gb
Please provide an example TAP
This is my TAP content:
{
"type": "tap",
"audio_id": 0,
"filepath": "lib://by/tapID/Deep Focus Mix.taf",
"name": "Deep Focus Mix",
"files": [
{
"filepath": "lib://by/mp3/Deep Focus Mix.mp3",
"name": "Deep Focus Mix"
}
]
}
The mp3 has 82MB size and a playtime of 1h 29m 34sec VLC Codec info is:
Codec: MPEG AAC Audio (mp4a)
Stereo
44100Hz
Bits per Sample: 32
When placing the tag on the box, no error-sound occurs, just blinking red LED ... then the box switches off (after ~15sec).
I can confirm exactly the same behaviour. Tried it with different input files, mp3 and m4a (aac).
Toniebox: CC3235 Teddycloud: develop (vX.X.X 9930675) OS: Raspberry Pi OS (bookworm)
The strange thing is that Teddycloud itself seems to work without problems. It transcodes the src file, first to *.taf.tmp and then renames it to taf when ready. So when I turn on the Toniebox again and put the same tag on it again, it starts playing without a problem (incl. downloading of the converted taf). But I have to wait until the transcoding is finished (by checking the logs). If I turn the box on again too quickly, the tmp file will be deleted and it starts from the beginning (incl. turning off/crashing)
Sometimes there is an error at the end saying file /teddycloud/data/library/by/tapID/Modjo.taf.tmp not available or not send, error=End of file reached [304].... I guess this happens with small files where the transcoding finishes quite fast. But I also tried it with longer files. Only one file. Nothing special.
{
"type": "tap",
"filepath": "lib://by/tapID/audiobook.taf",
"name": "TestMP3",
"files": [
{
"filepath": "lib://TestFormat.mp3",
"name": "TestFormat.mp3"
}
]
}
Teddycloud Log:
INFO |server.c:0432:httpServerRequestCallback| UA=TB/1640950635 SP/67829760 HW/1114660, FW=1640950635, SP=67829760, HW=1114660
INFO |handler_cloud.c:0448:handleCloudContent| >> client requested content for rUID 80f0f40e500304e0, auth 00000000...
INFO |handler_cloud.c:0640:handleCloudContent| Serve streaming TAP /teddycloud/data/library/by/tapID/Modjo.taf.tmp from /teddycloud/data/library/by/tapID/Modjo.taf
INFO |toniefile.c:0673:ffmpeg_stream| Encode 1 sources:
INFO |toniefile.c:0676:ffmpeg_stream| /teddycloud/data/library/Modjo-Chic.m4a
INFO |toniefile.c:0678:ffmpeg_stream| as TAF to /teddycloud/data/library/by/tapID/Modjo.taf.tmp
INFO |toniefile.c:0555:ffmpeg_decode_audio_start_skip| Start ffmpeg for decoding...
INFO |toniefile.c:0568:ffmpeg_decode_audio_start_skip| FFmpeg command: ffmpeg -i "/teddycloud/data/library/Modjo-Chic.m4a" -f s16le -acodec pcm_s16le -ar 48000 -ac 2 -ss 0 -
INFO |toniefile.c:0139:toniefile_create| Create TAF: /teddycloud/data/library/by/tapID/Modjo.taf.tmp
INFO |toniefile.c:0389:toniefile_new_chapter| new chapter at 0x00000000
ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557d3acbd0] Referenced QT chapter track not found
Last message repeated 2 times
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/teddycloud/data/library/Modjo-Chic.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2024-11-13T15:28:39.000000Z
title : Soup for one
artist : Chic
genre : Pop
encoder : Fission
date : 1982
track : 0
disc : 0
Duration: 00:00:17.00, start: 0.000000, bitrate: 64 kb/s
Stream #0:0[0x1](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 63 kb/s (default)
Metadata:
creation_time : 2024-11-13T15:28:39.000000Z
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, s16le, to 'pipe:':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
disc : 0
title : Soup for one
artist : Chic
genre : Pop
track : 0
date : 1982
encoder : Lavf60.16.100
Stream #0:0(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2024-11-13T15:28:39.000000Z
vendor_id : [0][0][0][0]
encoder : Lavc60.31.102 pcm_s16le
[out#0/s16le @ 0x557d3aea60] video:0kB audio:3187kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
size= 3187kB time=00:00:16.99 bitrate=1536.0kbits/s speed=11.8x
INFO |toniefile.c:0762:ffmpeg_stream| Encoded all sources
INFO |toniefile.c:0622:ffmpeg_decode_audio_end| Stopped ffmpeg with code=0...
INFO |toniefile.c:0806:ffmpeg_stream| TAF encoding successful
ERROR|handler_cloud.c:0667:handleCloudContent| >> file /teddycloud/data/library/by/tapID/Modjo.taf.tmp not available or not send, error=End of file reached [304]...
As long as the converting TAF.tmp file is not bigger than 25 MB. In my case (1,5h audio) the TAF encoding aborts on ~25 MB. Encoding same mp3 (from above) with teddycloud-cli all went well. Target TAF size is ~80 MB.
I try to make a TAP File of 3 TAF files with approx. 50MB per file.
{
"type": "tap",
"audio_id": 0,
"filepath": "lib://taf/Kinder/Sammler/DiedreiKids-Folge1Bis3.taf",
"name": "Die drei ??? Kids - Panik im Paradies (001)",
"files": [
{
"filepath": "lib://taf/Kinder/DiedreiKids-PanikimParadies(001).taf",
"name": "Die drei ??? Kids - Panik im Paradies (001)"
},
{
"filepath": "lib://taf/Kinder/DiedreiKids-RadioRockBeach(002).taf",
"name": "Die drei ??? Kids - Radio Rock Beach (002)"
},
{
"filepath": "lib://taf/Kinder/DiedreiKids-InvasionderFliegen(003).taf",
"name": "Die drei ??? Kids - Invasion der Fliegen (003)"
}
]
}
Same problem - cancellation at just under 25 MB - so it's not just with mp3.
And unfortunately I can't use the workaround of using the audio encoder function in the web interface of the TeddyCloud server. It can only handle mp3 files.
And unfortunately I can't use the workaround of using the audio encoder function in the web interface of the TeddyCloud server. It can only handle mp3 files.
This is not true. It can handle all different kinds of audio formats, basically everything ffmpeg can read.
I can confirm the mentioned Error at the beginning with an ESP32 Box, logs documented here: https://forum.revvox.de/t/tap-playlist-taf-tmp-not-available-or-not-send-error-timeout-220/1576
Got the same Problem on a CC3200 Box