請教播放音效權限的問題 - Linux

Skylar Davis avatar
By Skylar Davis
at 2015-05-05T00:09

Table of Contents

自己興趣寫了一些自己在家裡玩的服務,碰到了關於音樂播放的問題
(我是覺得跟權限有關係)

想請教一下,

利用自己架設的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,希望有經驗的高手能指點一下。


謝謝

--
Tags: Linux

All Comments

Connor avatar
By Connor
at 2015-05-09T03:31
web service 的 user 沒加 group ?
Emily avatar
By Emily
at 2015-05-12T20:41
沒錯,加user以後便可以了,謝謝

git reset

Hamiltion avatar
By Hamiltion
at 2015-05-03T21:49
在讀一個 document 的時候剛好看到 git reset --hard 的用法,他說這是將你在這個 branch 上所 modified 的一切全部回復成原來的樣子,那請問 git reset --hard andlt;tagandgt; 呢? 我 clone github 某一個 reposita ...

灌完Ubuntu15.04後找不到開機選項

Rebecca avatar
By Rebecca
at 2015-05-03T19:12
問題:Ubuntu安裝在從D槽分割出的空間,但是開機選項卻沒有出現Ubuntu可選, 只能進win7 詳述: 小弟是linux新手 在今天第一次安裝Ubuntu就碰上了很大的問題Orz... 先是以安裝在windows資料夾下的方式安裝 安裝好之後他說沒有定義root檔案系統 請回到磁碟 ...

RPi的負載平衡 bond-mode broadcast 範例

Ula avatar
By Ula
at 2015-05-03T08:13
關於Raspberry Pi 2 我想要用WLAN0~3 做一個bonding mode3 bond-mode broadcast 遍尋Google大神,關於mode 3的範例卻是少之又少(找不到) 可請教一下各位大大是否有相關的 設定範例教學呢? 感謝 andlt;(_ _)andgt; - ...

Linux愛好者對現在微軟的觀感

Elma avatar
By Elma
at 2015-05-03T03:00
以前Linux愛好者對微軟的觀感 應該很差 水火不容 比爾蓋茲被砸派 「微軟前任執行長Steve Ballmer將Linux比喻為癌症 更成了開源社群指責微軟的證據之一」 但現在微軟越來越開放 (雖然也是為了商業利益) 那麼Linux愛好者現在有變的比較喜歡微軟了嗎? thank ...

DD-WRT使用LOG會不會容量爆掉?

Doris avatar
By Doris
at 2015-05-02T20:20
分享器:WHR-HP-G54 版本:DD-WRT v24-sp2 (08/07/10) vpn There are two 8 Megabyte SDRAM chips and a 4 Megabyte flash chip. The device has a total of 16Mb RAM and 4 ...