probonopd / minikrebs

OpenWrt-based webradio firmware generator for A5-V11, D-Link DIR-505, TP-LINK TL-WR710N and TP-LINK TL-WR703N and USB sound card
13 stars 5 forks source link

Lirc alsa audio scripts #14

Open jekkos opened 8 years ago

jekkos commented 8 years ago

Nice work here! I'm preparing a wr703n for use with shairport-sync and was looking to add some extra packages to have a webradio (mp3 streams) as well. I've found quite some reusable stuff here eg use madplay with some shell scripting to play a set of predefined radio stations.

I'm wondering whether you ever tried the lirc alsa audio input setup to receive IR commands? As my soundcard adds this by default I'd like to hook it up to my IR receiver. I haven't found any code in your repo that does that (prolly just a matter to bind the input keys with some shell script commands you already have?)

Also this project is built with it's own image generator but I wonder whether there's a Makefile to import / modify inclusions as an OpenWrt package? I've already have my build box setup and like to take it from there (as I won't be using a lcd or reuse the serial port so I'd like to strip those things)

probonopd commented 8 years ago

Nice work here! I'm preparing a wr703n for use with shairport-sync and was looking to add some extra packages to have a webradio (mp3 streams) as well.

Thanks. That's exactly what I'm doing too, see radio.md Since memory on the 703 is very scarce I am downloading shairport-sync only when I want to use it, there is a button for it in the web interface of the radio player :-)

I'm wondering whether you ever tried the lirc alsa audio input setup to receive IR commands?

Tried: yes. Succeeded: No. I could not get lirc to recognize any commands. Probably I soldered the wrong way or I didn't try hard enough. Can you get lirc alsa to recognize anything useful comming from the remote?

So ended up using an ATmega 328 chip with Arduino IR receiver code to receive IR signals. But the lirc alsa audio input would be so much nicer.

Btw, did you see how you can play station IDs? I really find that useful when operating the radio with an IR remote.

Also this project is built with it's own image generator but I wonder whether there's a Makefile to import / modify inclusions as an OpenWrt package?

No, I haven't done that and I won't find the time to do so but I can see that it might be useful. Pull requests welcome!

jekkos commented 8 years ago

Yes currently I'm just trying to get shairport-sync working on my network. I've built an openwrt image with all needed dependencies and have the usb sound stick recognized with alsa. Also the shairport speaker is detected on my network but currently I can't play any audio on the router. First I'll try to see whether the alsa config in shairport is ok. Also I see no additional logging from shairport once i start it in the foreground and playing a song from a remote device.

The next step would be to try and integrate it with lirc alsa. I already have a tsop receiver in my bathroom wall that works now with a regular radio (which is neatly hidden inside) and would like to replace the whole with wr703n, wifi shairport and internet radio.

Does shairport work well on the wifi client? I'll consider to upgrade the internal flash if I find that there's not enough space on the router (bought some of these spi's some time ago) but then I'll need to program them first with buspirate and webfailsafe bootloader at first (a little risky tho)

I like the idea of station ids and would like to map it with my exsiting remote that's used for my normal radio now. So quite some bits and bobs here that I can use in my project which is nice, will save me quite some time.

probonopd commented 8 years ago

Yes, shairport-sync works well on the wifi client. Does the shairport button in my HTML UI work for you?

You can load binaries into /tmp which has more space than flash, but these do not survive a reboot. D-Link DIR-505 is very similar hardware but with 8 MB flash built in.

jekkos commented 8 years ago

Ok good to know. Do you perhaps have a working shairport config for this setup? I tried to play the startup chime from your scripts using aplay but only got som enoise output. Probably aplay doesn't support mp3 by default?

probonopd commented 8 years ago

I would recommend you to build a sysupgrade image using my scripts with

# Get ready
./prepare radio
# Build the firmware image
./builder/init

and study that - everything should be working out of the box. Then you can go from there and customize things. Correct, aplay alone does not play mp3. But the following combination does:

wget http://some.mp3 -O - | madplay -o wave:- - | aplay -Dplug:dmix
jekkos commented 8 years ago

ok so even shairport would be good to go? I'll give it a try and report back when I find the time.