[ltp] mplayer & sound

Gustavo Halperin linux-thinkpad@linux-thinkpad.org
Wed, 31 Dec 2003 21:05:22 +0200


André Wyrwa wrote:

>>>What output plugin does XMMS use?
>>>      
>>>
>>/dev/dsp.  and work OK for root and common users.
>>    
>>
>
>Thats the device, not the plugin, but ok, it's obvious that you're using
>the OSS plugin.
>  
>
Yess

>>>What's returned by ls -al /dev/dsp?
>>>      
>>>
>>lrwxrwxrwx    1 root     audio           9 Dec 24 20:15 /dev/dsp -> 
>>/dev/dsp0
>>and also I added my user in audio users, see a line from a file /etc/group:
>>     audio:x:29:someuser
>>    
>>
>
>Ok, what's the output of "ls -al /dev/dsp0" and "ls -al /dev/audio0"?
>  
>
c---------    1 root     audio     14,   4 Dec 24 20:15 /dev/audio

>What permissions has xmms?
>
>(Although i don't believe that's your problem.)
>  
>
xmms work OK. you mean the permission of the '/usr/bin/xmms'
  ls -l /usr/bin/xmms
  -rwxr-xr-x    1 root     root       970328 Mar  7  2002 /usr/bin/xmms

>>>Did you try mplayer -ao nas <file_you_wanna_play>? (Works great for me.)
>>>      
>>>
>>This doesn't work, even like root. But I think that it is doesn't needed 
>>because 'nas' is
>>transparent to the users. I define two variable in the file 
>>'.bash_profile':
>>        AUDIOSERVER=tcp/localhost:8000
>>        LD_PRELOAD=/usr/lib/audiooss/libaudiooss.so
>>(obvious export theme from the file: export AUDIOSERVER LD_PRELOAD)
>>and then use the /dev/dsp like always without take care any more about 
>>'nas'.
>>  You agree ??.
>>    
>>
>
>No. ;-)
>You mentioned this several times now, but afaik your understanding of
>this "transparency" is wrong. NAS is "network transparent to the user",
>yes, but this means only that once your system is configured correctly
>you can hear the sound that's given by nasd from any computer in your
>network without bothering about on which computer you are at the moment.
>Thats all, there's nothing more about it.
>
>If you want to make applications use nas then they must be programmed
>for using it. They must talk to nasd directly, not to some /dev/***.
>
>So, if mplayer refuses to play with nas, then either it is built without
>nas support or something about your audio server is wrong.
>
>Give us the exact (error) output of mplayer (best both cases, trying to
>use nas and not trying to use it).
>  
>
when I run mplayer like root is OK. when I do it like user this is the 
(error) output:
   gusti@r40:~$ mplayer sound.mp3
   MPlayer 1.0pre2-2.95.4 (C) 2000-2003 MPlayer Team

   CPU: Intel Pentium 4/Xeon/Celeron Northwood 1795 MHz (Family: 8, 
Stepping: 7)
   Detected cache-line size is 64 bytes
   CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
   Compiled with Runtime CPU Detection - WARNING - this is not optimal!
   To get best performance, recompile MPlayer with 
--disable-runtime-cpudetection
   Reading config file /etc/mplayer/mplayer.conf
   Reading config file /home/gusti/.mplayer/config
   Reading /home/gusti/.mplayer/codecs.conf: Can't open 
'/home/gusti/.mplayer/codecs.conf': No such file or  directory
   Reading /etc/mplayer/codecs.conf: Can't open 
'/etc/mplayer/codecs.conf': No such file or directory
   Using built-in default codecs.conf
   Font /home/gusti/.mplayer/font/font.desc loaded successfully! (206 chars)
   Failed to open /dev/rtc: Permission denied (mplayer should be setuid 
root or /dev/rtc should be readable by the user.)
   Using usleep() timing
   Can't open input config file /home/gusti/.mplayer/input.conf: No such 
file or directory
   Can't open input config file /etc/mplayer/input.conf: No such file or 
directory
   Falling back on default (hardcoded) input config

   Playing sound.mp3
   Audio file detected.
   Clip info:
    Title: Going Under                  
    Artist: Evanescence                  
    Album: Fallen (Retail)              
    Year: 2003
    Comment: www.nimbusmp3.com          
   Track: 1
    Genre: Rock
   
==========================================================================
   Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
   MP3lib: init layer2&3 finished, tables done
   AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 24000->176400 (192.0 kbit)
   Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
   
==========================================================================
   Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
   AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
   AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
   audio_setup: Can't open audio device /dev/dsp: Permission denied
   AO: [null] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
   Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
   Video: no video
   Starting playback...
   A:         7.4  3.3% 0%  

   MPlayer interrupted by signal 2 in module: key_events
   gusti@r40:~$

>And check the following:
>
>"mplayer -ao help" should give a list of output plugins for mplayer,
>look if there is a nas entry among them.
>
>  
>
 Noup .

>Check if nasd is running.
>  
>
yes it is. The proof is that I can run many xmms in the same time.

>If nasd is running, check if you can play a wav file by using
>"auplay <wav_file>" or try generating some noise with auwave.
>  
>
Is work, like root and even like user

>If that doesn't work, you might try starting nasd with the -aa
>parameter.
>
>To make xmms use nas you'll need the xmms-nas output plugin from
>ftp://ftp.stack.nl/pub/users/willem/xmms-nas-0.2.tar.gz .
>  
>
Are you sure? I'm using xmms with the OSS plugin and the Varibles
that wrote before (AUDIOSERVER LD_PRELOAD) without any problem.

>Andre.
>
>
>  
>
  And really thank you for the time.
-- 
Regards.
gustavo halperin
_________________________________________
Laboratory for Computer Graphics and CAD
Faculty of Mechanical Engineering
Technion - Israel Institute of Technology
Haifa, Israel 32000

Tel:      972-4-829-2334
Fax:    972-4-829-5711
e-mail: gustavoh@tx.technion.ac.il <mailto:gustavoh@tx.technion.ac.il>
_________________________________________