The_newGuy
Posts: 3
Joined: Sat Apr 12, 2014 8:15 pm

Internet Radio

Sat Apr 12, 2014 8:24 pm

Hey guys,
i want to build an internet radio and change the stations via a php skript.
But the user www-data is not able to even start a radio:

Code: Select all

pi@raspberrypi ~ $ ./bash/play_technobase.sh
play WARN alsa: can't encode 0-bit Unknown or not applicable

http://listen.technobase.fm/tunein-mp3-asx:

  Encoding: MPEG audio
  Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
  Duration: unknown

In:0.00% 00:00:03.25 [00:00:00.00] Out:143k  [-=====|=====-] Hd:0.6 Clip:0
Aborted.
vs.

Code: Select all

pi@raspberrypi ~ $ sudo -u www-data ./bash/play_technobase.sh
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_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:4241:(_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:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
Segmentation fault
same with playing a video:

Code: Select all

pi@raspberrypi ~ $ omxplayer media/test.h264
Video codec omx-h264 width 1920 height 1080 profile 77 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0
V:PortSettingsChanged: 1920x1080@25.00 interlace:0 deinterlace:0 par:1.00 layer:0
have a nice day ;)
vs.

Code: Select all

 sudo -u www-data omxplayer media/test.h264
* failed to open vchiq instance
(than it crashes)
while

Code: Select all

pi@raspberrypi ~ $ sudo -u www-data ls
works.

how can i fix this problem?

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Internet Radio

Sat Apr 12, 2014 11:17 pm

I'm guessing: add the www-data user to the 'audio' group?

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Internet Radio

Sun Apr 13, 2014 5:24 am

You could avoid the hassle and just go with mpd/mpc

Once you have mpd running, you can control it from your own web page, android phone, iphone, windows, a linux desktop, etc. Load up as many radio stations as you want and go nuts. All of the mpc (clients) programs can control station selection, volume, etc.

apt-get install mpd mpc
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

The_newGuy
Posts: 3
Joined: Sat Apr 12, 2014 8:15 pm

Re: Internet Radio

Sun Apr 13, 2014 4:09 pm

Douglas6 wrote:I'm guessing: add the www-data user to the 'audio' group?
yes and to the 'video' group.
Thanks Alot

Return to “Troubleshooting”