Skip to main content

Thread: How do I get a daemon process to play sound under Lucid?


hey there,

need one: got sound working alright on headless lucid server installation. 'root' regular users can play sound using pure alsa (no pulseaudio). use 'mplayer' playing wav files , 'espeak' speech synthesis.

besides other things use server home automation purposes, , accoustically signal events, e.g. house alarm's been activated.

problem starts: perl-based home automation server (fhem) run daemon dedicated user 'fhem' , supposed play sounds through shell script calling 'mplayer', example.

following commands placed in shell script debugging purposes

code:
lspci -v | grep audio cat /proc/asound/cards getfacl -e /dev/snd/* ck-list-sessions aplay -l aplay -l amixer info   /usr/bin/mplayer -volume $1 $2
produce output:

code:
00:1b.0 audio device: intel corporation 82801ji (ich10 family) hd audio controller 02:00.1 audio device: nvidia corporation high definition audio controller (rev a1)      0 [intel          ]: hda-intel - hda intel                       hda intel @ 0xf9ff8000 irq 22  1 [nvidia         ]: hda-intel - hda nvidia                       hda nvidia @ 0xfbafc000 irq 34     getfacl: removing leading '/' absolute path names # file: dev/snd/by-path # owner: root # group: root user::rwx group::r-x other::r-x # file: dev/snd/controlc0 # owner: root # group: audio user::rw- group::rw- other::--- # file: dev/snd/controlc1 # owner: root # group: audio user::rw- group::rw- other::--- # file: dev/snd/pcmc0d0c # owner: root # group: audio user::rw- group::rw- other::--- # file: dev/snd/pcmc0d0p # owner: root # group: audio user::rw- group::rw- other::--- # file: dev/snd/pcmc0d1p # owner: root # group: audio user::rw- group::rw- other::--- # file: dev/snd/timer # owner: root # group: audio user::rw- group::rw- other::---     session46:         unix-user = '999'         realname = '(null)'         seat = 'seat23'         session-type = ''         active = false         x11-display = ''         x11-display-device = ''         display-device = ''         remote-host-name = ''         is-local = true         on-since = '2011-12-30t21:59:27.846181z'         login-session-id = '4294967295'     aplay: device_list:223: no soundcards found... null     discard samples (playback) or generate 0 samples (capture)     amixer: control device default open error: no such file or directory     mplayer svn-r1.0~rc3+svn20090426-4.4.3 (c) 2000-2009 mplayer team   playing /usr/share/fhem/sounds/gong.wav. audio file format detected. ========================================================================== opening audio decoder: [pcm] uncompressed pcm audio decoder audio: 44100 hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400) selected audio codec: [pcm] afm: pcm (uncompressed pcm) ========================================================================== [ao_alsa] alsa-lib: confmisc.c:768:(parse_card) cannot find card '0' [ao_alsa] alsa-lib: conf.c:4154:(_snd_config_evaluate) function snd_func_card_driver returned error: no such file or directory [ao_alsa] alsa-lib: confmisc.c:392:(snd_func_concat) error evaluating strings [ao_alsa] alsa-lib: conf.c:4154:(_snd_config_evaluate) function snd_func_concat returned error: no such file or directory [ao_alsa] alsa-lib: confmisc.c:1251:(snd_func_refer) error evaluating name [ao_alsa] alsa-lib: conf.c:4154:(_snd_config_evaluate) function snd_func_refer returned error: no such file or directory [ao_alsa] alsa-lib: conf.c:4633:(snd_config_expand) evaluate error: no such file or directory [ao_alsa] alsa-lib: pcm.c:2211:(snd_pcm_open_noupdate) unknown pcm default [ao_alsa] playback open error: no such file or directory failed initialize audio driver 'alsa' not open/initialize audio device -> no sound. audio: no sound video: no video   exiting... (end of file)
so, sound device visible , permissions set correctly. however, 'aplay', 'amixer' 'mplayer' can't access device.

since didn't work wrapped shell script 'ck-launch-session dbus-launch playsound.sh' in order create ck session unfortunately didn't work either. (i figured multiple posts on net necessary 'mplayer' access sound device.) noticed ck session inactive ('active = false'), couldn't find way activate it.

i've been googling consolekit, dbus, alsa, etc. 2 days now, , i'm running out of ideas here.

have hint me?

in advance

lars

forgot mention: user 'fhem' member of group 'audio'.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Multimedia Software [ubuntu] How do I get a daemon process to play sound under Lucid?


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account