[问题] 请教播放音效权限的问题

楼主: yanganto (双剑‧日光灯)   2015-05-05 00:09:36
自己兴趣写了一些自己在家里玩的服务,碰到了关于音乐播放的问题
(我是觉得跟权限有关系)
想请教一下,
利用自己架设的web App执行mpg123播放音乐时都会出现下面所附错误讯息
但是如果是root或是normal_user执行mpg123时却可以正确播放。
错误讯息如下:
Directory: /srv/http/Mysite/static/mp3/
Playing MPEG stream 1 of 1: XXXX.mp3 ...
Home directory not accessible: Permission denied
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4260:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4260:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4260:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4739:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM default
[sdl.c:76] error: Couldn't open SDL audio: No available audio device
[audio.c:643] error: failed to open audio device
[mpg123.c:547] error: failed to reset audio device: No such file or directory
/etc/group档案中,已有如下设定
audio:x:92:normal_user,daemon
OS是ArchLinux,希望有经验的高手能指点一下。
谢谢
作者: Bencrie   2015-05-05 00:22:00
web service 的 user 没加 group ?
楼主: yanganto (双剑‧日光灯)   2015-05-05 20:39:00
没错,加user以后便可以了,谢谢

Links booklink

Contact Us: admin [ a t ] ucptt.com