Project

General

Profile

Adding Line In as a source

Added by Kev S about 8 years ago

I'm trying to add the Line In input as a source, but unfortunately it isn't working - has anyone had this working successfully?

TV Headend 4.1-2204~ged40c4d, running on Ubuntu 12.04LTS

/var/scripts/linein.sh
#!/bin/bash
echo `whoami` > /media/PVR2/info
/usr/local/bin/ffmpeg20160827/ffmpeg -loglevel fatal -f alsa -i hw:0,0 -acodec aac -strict -2 -mbd rd -copyinkf -flags +ilme+ildct -fflags +genpts -metadata service_provider=KevFM -metadata service_name=KevFM -f mpegts -tune zerolatency -mpegts_service_type digital_radio pipe:1

Permissions are 777

In TVHeadend the Multiplex URL is pipe:///var/scripts/linein.sh

Alas when you try to tune to the multiplex TV Headend says the following repeatadly

2016-08-29 09:58:23.248 spawn: Executing "/var/www/scripts/linein.sh" 
2016-08-29 09:58:23.295 spawn: ALSA lib ../../../src/pcm/pcm_hw.c:1700:(_snd_pcm_hw_open) Invalid value for card

So

sudo su -l hts
arecord -l

gave
arecord: device_list:252: no soundcards found...

Oh, permissions issue

xbmc@williams:/var/scripts$ sudo addgroup hts audio
Adding user `hts' to group `audio' ...
Adding user hts to group audio
Done.
sudo su -l hts
hts@williams:~$ arecord -l
hts@williams:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Sorted?

Alas no, TV Headend is still spewing the same messages,
But if, while still as hts, you run

/var/scripts/linein.sh  | cat > /media/PVR2/test.ts

The file is generated happily and VLC plays it fine :s

I've happily got a number of Webradios and Film On working though the same logic (i.e. pipe:// from scripts)