But if I once start a MP3 decoder "StartTask(TASK_DECODER, MP3Thread); Yield();" And Stop it to restart the LineThread. The output from the line Thread is very distorted.
Do you have any idea where the problem might be?

Tasks and Libs are closed correctyl (checked this with TASKS and LIBLIST2)

Your question is a very good one, and I think the code snippets you provided makes it possible to solve your issue.

I think your issue is that you don't set the sample rate. The default sample rate for stdaudioin and stdaudioout is 48 kHz so initially your line in/out task works well. However, when you decode an MP3 file, the output sample rate gets set by the MP3 file, typically to 44.1 kHz. After that, your line in/out task won't work as you expect anymore.

To fix this, add the following code to the startup of your line in/out task: