Openwrt seems to be hanging during bootup

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
FTaylor74
Posts: 10
Joined: Tue Oct 01, 2013 10:55 am

Openwrt seems to be hanging during bootup

Post by FTaylor74 »

I've been working on my own wifi streaming radio, and I have most of the elements from the first six chapters of the MightyOhm wifi radio project working. I now seem to be stuck (by a problem that's been there all along). I have created playlists for MPC, and am able to play them from the command line and from Ario (mpc client). But despite my best efforts, i can't seem to get the router to play the playlist on startup.

I've tweeked the /etc/init.d/mpd file as recommended on this forum, but its still not working.

I believe that the boot process is bypassing the mpd script altogether.

During boot, the process seems to hang at this point...
...
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 48000 sra
tehi 48000 attributes 0x00
usbaudio: registered dsp 14,3
usbaudio: registered mixer 14,0
usbaudio: registered mixer 14,0

It then shows a blinking cursor on my telnet screen that will stay like that forever. When I press enter, the router sends the BusyBox message and OPenwrt welcome screen, and enters command line mode. Shouldn't the boot process leave me in command mode without my intervention?

I don't believe this is normal, but i could be wrong. Assuming it is an indication of a problem, where do i look to find a boot log or error log that can tell me what the problem is.

Any help will be appreciated

Thanks
Ftaylor74

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Openwrt seems to be hanging during bootup

Post by gerben »

Could you post your tweaks to mpd.conf?

I don't think a hanging process can cause other startup processes from not being executed. But who knows.

FTaylor74
Posts: 10
Joined: Tue Oct 01, 2013 10:55 am

Re: Openwrt seems to be hanging during bootup

Post by FTaylor74 »

Thx for getting back with me so quickly.


#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=93

start() {
#create mpd directories
md=`grep music_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/r
oot/g"`
if [ ! -d $md ]; then
mkdir -p $md
fii
pld=`grep playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~
/\/root/g"`
if [ ! -d $pld ]; then
mkdir -p $pld
fi
#create mpd db
/usr/bin/mpd --stdout --create-db

#optional export for mpc
#export MPD_HOST=127.0.0.1

#start mpd
/usr/bin/mpd
/usr/bin/mpc repeat on
/usr/bin/mpc volume 90
/usr/bin/mpc load MPL
/usr/bin/mpc play 1


stop() {
killall mpd
}
The only things i've changed are are the lines after /usr/bin/mpd. I added those, and deleted the lines which added streams to a playlist, etc.

As I noted earlier, the playlist MPL works great. I'm able to telnet to the router both wirelessly and via ethernet. It just doesn't feel right that the boot script doesn't complete with the openwrt command line.

Thanks for looking at this.
Regards
Ftaylor74
Attached are the my config files for wireless, network and firewall
Attachments
My wifi config files.txt
(1.78 KiB) Downloaded 845 times

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Openwrt seems to be hanging during bootup

Post by gerben »

It looks like you accidentally removed to closing curly brace; '}'

So:

Code: Select all

  ...
  #start mpd
  /usr/bin/mpd
  /usr/bin/mpc repeat on
  /usr/bin/mpc volume 90
  /usr/bin/mpc load MPL
  /usr/bin/mpc play 1
}

stop() {
  killall mpd
} 

FTaylor74
Posts: 10
Joined: Tue Oct 01, 2013 10:55 am

Re: Openwrt seems to be hanging during bootup

Post by FTaylor74 »

I just double checked. It was a good find on your part, but unfortunately the bracket was dropped when I copied the text from telnet. I just double checked the actual file, and the bracket is there. Its separated by the main body by for or five blank lines, which as a noob, I haven't figured out how to remove.

I rebooted it again, and it still hangs at the same spot.
After I hit enter, i can run mpc from the command line (only after running mpd).

I'm still poking around, so thanks for your help.

FTaylor74
Posts: 10
Joined: Tue Oct 01, 2013 10:55 am

Re: Openwrt seems to be hanging during bootup

Post by FTaylor74 »

Still no luck on stopping the "hanging boot". Maybe it is normal to have to hit enter to get to the OpenWrt command prompt. I am going to find out the hard way. I am going to reflash the router with kamikaze 2.4 and see if it takes me to command prompt automatically.

If it does, I will add packages and update config files one at a time to see if I can see where it's breaking down. Doesn't OpenWrt log error events? I've looked but cant find any. Oh well.

I will keep people posted on progress.

Regards
Ftaylor74

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Openwrt seems to be hanging during bootup

Post by gerben »

Log are located in

Code: Select all

/var/log

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Openwrt seems to be hanging during bootup

Post by gerben »

`dmesg` also gives some nice info for debugging.

This is the output from my router

Code: Select all

...
audio.c: v1.0.0:USB Audio Class driver
hub.c: new USB device 00:03.0-1, assigned address 2
usbaudio: device 2 audiocontrol interface 0 has 1 input and 1 output AudioStreaming interfaces
usbaudio: device 2 interface 2 altsetting 1 channels 1 framesize 2 configured
usbaudio: valid input sample rate 48000
usbaudio: valid input sample rate 44100
usbaudio: device 2 interface 2 altsetting 1: format 0x00000010 sratelo 44100 sratehi 48000 attributes 0x01
usbaudio: device 2 interface 1 altsetting 0 does not have an endpoint
usbaudio: device 2 interface 1 altsetting 1 channels 2 framesize 2 configured
usbaudio: valid output sample rate 48000
usbaudio: valid output sample rate 44100
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 44100 sratehi 48000 attributes 0x01
usbaudio: registered dsp 14,3
usbaudio: constructing mixer for Terminal 6 type 0x0301
usbaudio: warning: found 1 of 2 logical channels.
usbaudio: assuming that a stereo channel connected directly to a mixer is missing in search (got Labtec headset?). Should be fine.
usbaudio: registered mixer 14,0
usbaudio: constructing mixer for Terminal 7 type 0x0101
usbaudio: registered mixer 14,16
usb_audio_parsecontrol: usb_audio_state at 8078db80
device wl0 entered promiscuous mode
...
Perhaps you can tweak your mpd.conf a bit in the ####### MIXER ####### section.

good luck

FTaylor74
Posts: 10
Joined: Tue Oct 01, 2013 10:55 am

Re: Openwrt seems to be hanging during bootup

Post by FTaylor74 »

Thx for your response, Gerben. Great support!

As I wrote, I have started fresh and meticulously followed the steps in the Mightyohm tutorial. I'm now back where I started, but no closer to finding a solution than I was Tuesday.

I have confirmed that what I called "hanging" is just the state of the router after it completes its boot script... its just waiting for the next thing to be done. So I guess the boot script never really hung up.

Still, mpd is not being executed during bootup. I looked at the dmesg results, and they seem normal, although I note that my dmesg results do not finish with the statement "device w10 entered promiscuous mode", while your does.

see below for full dmesg results

Code: Select all

CPU revision is: 00029029
Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 16kB, 2-way, linesize 16 bytes.
Linux version 2.4.35.4 (agb@arrakis) (gcc version 3.4.6 (OpenWrt-2.0)) #12 Tue D
ec 29 15:30:20 UTC 2009
Setting the PFC to its default value
Determined physical RAM map:
 memory: 01000000 @ 00000000 (usable)
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/pre
init noinitrd console=ttyS0,115200
CPU: BCM5354 rev 3 at 240 MHz
Using 120.000 MHz high precision timer.
Calibrating delay loop... 237.56 BogoMIPS
Memory: 14244k/16384k available (1437k kernel code, 2140k reserved, 100k data, 8
4k init, 0k highmem)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: no core
PCI: Fixing up bus 0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en
abled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:01.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 20:cf:30:88:2f:e3
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
 Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x400000 at 0x1c000000
bootloader size: 131072
Physically mapped flash: Filesystem type: squashfs, size=0x1820c3
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00020000 : "cfe"
0x00020000-0x003f0000 : "linux"
0x0009c000-0x00220000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-o
nly
0x003f0000-0x00400000 : "nvram"
0x00220000-0x003f0000 : "rootfs_data"
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 84k freed
Algorithmics/MIPS FPU Emulator v1.5
diag: Detected 'ASUS WL-520gU'
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
roboswitch: Probing device eth0: found!
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs
jffs2.bbc: SIZE compression mode activated.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
PCI: Setting latency timer of device 00:05.0 to 64
PCI/DMA
wl0: wlc_attach: chiprev 3 coreunit 0 corerev 13 cccap 0x104007ea maccap 0x30482
205 band 2.4G, phy_type 5 phy_rev 0 ana_rev 6
wl0: Broadcom BCM4318 802.11 Wireless Controller 4.150.10.5
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 352 bytes per conntrack
SB USB20H init
SB COREREV: 2
SB USB20H resetting
USB20H fcr: 0x64
USB20H shim cr: 0x8f7
PCI: Setting latency timer of device 00:03.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:471a
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver audio
audio.c: v1.0.0:USB Audio Class driver
hub.c: new USB device 00:03.0-1, assigned address 2
usbaudio: device 2 audiocontrol interface 0 has 1 input and 1 output AudioStream
ing interfaces
usbaudio: device 2 interface 2 altsetting 1 channels 1 framesize 2 configured
usbaudio: valid input sample rate 48000
usbaudio: device 2 interface 2 altsetting 1: format 0x00000010 sratelo 48000 sra
tehi 48000 attributes 0x00
usbaudio: device 2 interface 1 altsetting 0 does not have an endpoint
usbaudio: device 2 interface 1 altsetting 1 channels 2 framesize 2 configured
usbaudio: valid output sample rate 48000
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 48000 sra
tehi 48000 attributes 0x00
usbaudio: registered dsp 14,3
usbaudio: constructing mixer for Terminal 17 type 0x0301
usbaudio: registered mixer 14,0
usbaudio: constructing mixer for Terminal 18 type 0x0101
usbaudio: registered mixer 14,16
usb_audio_parsecontrol: usb_audio_state at 80756b20


I checked the /var/log/ folder and saw wtmp and lastlog, but both were empty.

I tweaked the mixer settings in mpd.conf as follows

# An example for controlling an OSS mixer:
#
mixer_type "oss"
mixer_device "/dev/sound/mixer"
mixer_control "PCM"
#


by un-commenting the three lines and changing /dev/mixer to /dev/sound/mixer. (neither way affects autoplay, by the way)

So That's were I am. I have a great internet streaming router that just doesn't want to start-up on boot.
If there's anything else you think i should look at, please advise. My noob brain is at a loss.
Regards
Ftaylor74

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Openwrt seems to be hanging during bootup

Post by gerben »

wl0 is the wireless lan device. So that didn't have anything to do with mpd.

Make sure the mpd init script is enabled. Just run `/etc/init.d/mpd enable`

On my install I created my own init.d script to handle the playing and playlist adding. Look at http://wiki.openwrt.org/doc/techref/initscripts to see how to do that. I added a `sleep 5` at the beginning to make sure mpd had started.

Code: Select all

#!/bin/sh /etc/rc.common

START=99
start() {
sleep 5
mpc repeat on
mpc volume 100
mpc load difm
mpc play
}
Hope that helps. Otherwise we'll have to think of something else.

Post Reply