The difference is that when you run with xargs, the program you are running does not get connected to the terminal in which you are running it. Consider this example:
Code:
$ cat test.sh
#!/bin/bash
echo "The terminal is: $(tty)"
$ chmod 755 test.sh
$ ./test.sh
The terminal is: /dev/pts/1
$ echo "oh hai" | xargs ./test.sh
The terminal is: not a tty
It seems mplayer behaves differently when connected to a terminal compared to when it's not. I can replicate this. What's weird is that with movie files it is not the case. I suspect that when playing video the key press events are handled by the X-window which is created where as with audio only files there is no X-window, and so keypress events can only work if the process is attached to a tty from which to get input.
One solution if your file names do not have spaces in them, try this:
Code:
mplayer $(ls *mp3 | tail -n2)
By the way the -I{} and {} are not necessary in your original command, and the -1 option to ls is also not necessary (when ls is not connected to a terminal, it always lists in a single column format, assuming that it is part of a pipeline.