[SOLVED] - USB Audio for Broadcom DD-WRT devices

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Author Message
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Mon Sep 06, 2010 21:49    Post subject: [SOLVED] - USB Audio for Broadcom DD-WRT devices Reply with quote
USB Audio device support for Broadcom devices running the 2.6 kernel builds.

[SOLUTION]


Step 1) Install DD-WRT

1.Load up the router with a current mega build of dd-wrt.

Step 2) Modify the default configuration after a 30/30/30 reset.

1.From the DD-WRT web interface select the Services tab and then the USB service tab
◦Enable all the USB options, and select /opt in the drop down list for the Disk Mount Point. Click [Apply]
2.Plug in your USB 2.0 powered hub to the router USB port.
3.Plug in your USB audio device into the hub. ***Remember to also connect a set of speakers/headphones at some point as well.


Step 3) Partition Setup for OTRW

Take special care to setup your storage device correctly prior to installing OTRW;

1.Follow the guide in this article to setup the USB HDD with the correct partitioning, correct order and file-system formats

http://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

I use Paragon Partition Manager on my windows PC to prepare my 2GB USB FLASH drive. Into four separate partitions;

1 – Optware (512MB) – ext3
2 – SWAP (64MB) - swap
3 – JFFS (256MB) – ext3
4 – Data (1.2GB) – ext3

2.Once you USB drive is ready plug that into the USB hub as well. The port you select on the USB hub should be the same one used for the Optware install from that point on.


Step 4) Install OTRW

1.Login to the router console and run the following commands to begin the download and install of OTRW.

#1 Downloads the OTRW install script
#2 Starts the install script


1. wget -O /tmp/prep_optware http://wd.mirmana.com/prep_optware
2. sh /tmp/prep_optware
3. 20 or so minutes later the install will complete. Wait 3 minutes more then type reboot.

4. This time when the router boots it will load the OTRW from the USB drive after its normal startup. Optware like an addon needs 2-3minutes to load completely after the routers network comes back online. Be patient


Step 5) Turn on the sound service


1. Login to the router console and Turn on the OTRW sound service by using the commands

Code:
service soundmodules on
service soundmodules start



[VERIFY IT WORKED]

after reboot if all went well the dmesg command will show;

usbcore: registered new interface driver snd-usb-audio

also you can tell its working due to the /dev/sound/dsp item being created.



[ADDITIONAL STEPS]

4 - Seems you have to create a symbolic link as well. This is so the default config for audio players will work. They most seem to look for /dev/dsp; (This has to be repeated after every reboot) So I put it in the start up script in the Commands section of the webinternface and it seems to work after a reboot every time.

Code:
ln -s /dev/sound/dsp /dev/dsp


5 - A very import step is to install an audio player that can use the newly install usb audio device.Also equally important as the player is to install any audio library packages needed for the various audio formats and features in your personal collection.

The console based audio player I used is called moc and one called mpg123 and it seems to work with some success. ( It plays at least)

These are some supporting packages.
Code:
ipkg-opt install flac
ipkg-opt install libid3tag
ipkg-opt install libmad
ipkg-opt install libsndfile
ipkg-opt install libvorbis
ipkg-opt install speex


The ALSA is an alternate sound system vs. OSS.
Code:
ipkg-opt install alsa-lib
ipkg-opt install alsa-utils


These packages are for audio playback.
Code:
ipkg-opt install moc
ipkg-opt install mpg123
ipkg-opt install sox
ipkg-opt install mpd


[PLAY SOME MUSIC]

Then from the console change directory to the location where your mp3's/audio files are. To play a file try this command..

mocp <filename>

mpg123 <filename>

example code

Code:
mocp BobMarley.mp3


You should get a blue screen (see screen shot attached) with the file displayed on the right on side (think of that right side as your live playlist). The left side is the file-system navigation so you can browse to files and queue them up etc..

[NOTES]

you can test that ALSA is working by running the commands;

amixer
aplay



@Frater

Is there anyway that you can include some or all of these adjustments to your soundmodules service?





_________________



MOC in Play Mode.JPG
 Description:
 Filesize:  65.63 KB
 Viewed:  34054 Time(s)

MOC in Play Mode.JPG



snd-hwdep.zip
 Description:

Download
 Filename:  snd-hwdep.zip
 Filesize:  4.73 KB
 Downloaded:  1108 Time(s)


_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink


Last edited by stephensuley on Tue Mar 01, 2011 1:11; edited 23 times in total
Sponsor
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Mon Sep 06, 2010 21:59    Post subject: Reply with quote
just to get the ball rolling I found this one...

http://www.amazon.com/Syba-SD-CM-UAUD-Adapter-C-Media-Chipset/dp/B001MSS6CS

EDIT: Better question can someone tell me how I can verify if they wil work in the k26 dd-wrt?

_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink
EDHahn
DD-WRT Novice


Joined: 08 Sep 2010
Posts: 1

PostPosted: Wed Sep 08, 2010 15:28    Post subject: try this Reply with quote
Start here. It is possible on OpenWRT so there is a way to make it work on DD-Wrt.

http://www.dd-wrt.com/wiki/index.php/USB

there are links to usb audio drivers.
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Fri Oct 01, 2010 21:56    Post subject: Reply with quote
that didn't help much...

does anyone have some ideas?

_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink
Mattblack
DD-WRT Novice


Joined: 23 Apr 2009
Posts: 31

PostPosted: Sat Oct 23, 2010 17:48    Post subject: Reply with quote
I am looking to also use my USB port (610N v1) to get audio streamed from my PC.

Can you please tell me if you managed this and if so - how exactly?

Many thanks
Matt
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Sun Oct 24, 2010 20:34    Post subject: Reply with quote
Mattblack wrote:
I am looking to also use my USB port (610N v1) to get audio streamed from my PC.

Can you please tell me if you managed this and if so - how exactly?

Many thanks
Matt


I'm still working on it. I've found a USB audio device that I'm goign to try and use.

Step one is to get Optware the Right way up and running on your router/ USB hub and flash drive ( partitioned and formatted) and then you will be on your way....

install vlc...

"ipkg-opt install vlc "

then come back and let me know how you did and I hope by then to have the usb audio dongle and see if I can get it to play locally first using some wired speakers.

_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink
Mattblack
DD-WRT Novice


Joined: 23 Apr 2009
Posts: 31

PostPosted: Mon Oct 25, 2010 11:50    Post subject: Reply with quote
Thanks Stephen.

But why do I need a USB hub and flash drive? Or is that an alternative solution to an actual router?

This is exactly what I want, and the router is only 25 euros...
http://www.youtube.com/watch?v=Bp26xFBwrJs

But I already have the 610N in the same place so don't see any point buying more hardware if I don't have to.

I'll see how I get on with the Optware and let you know. Please let me know about the USB hub and if I need it

Thanks
Matt
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Mon Oct 25, 2010 13:47    Post subject: Reply with quote
Mattblack wrote:
Thanks Stephen.

But why do I need a USB hub and flash drive? Or is that an alternative solution to an actual router?

This is exactly what I want, and the router is only 25 euros...
http://www.youtube.com/watch?v=Bp26xFBwrJs

But I already have the 610N in the same place so don't see any point buying more hardware if I don't have to.

I'll see how I get on with the Optware and let you know. Please let me know about the USB hub and if I need it

Thanks
Matt


The 610n has a single USB port.

To stream Audio to a set of BT speakers you will need the following connected to your router;

1x USB FLASH Drive to run Optware and the apps
1x USB Audio dongle (for a sound card for the router)
1x USB Bluetooth dongle ( To stream the music to the BT speakers)
1x USB External HDD to host all the media files.


A 4 port powered USB 2.0 HUB is needed and the devices listed above.

_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink
Mattblack
DD-WRT Novice


Joined: 23 Apr 2009
Posts: 31

PostPosted: Mon Oct 25, 2010 18:40    Post subject: Reply with quote
ah ok. I don't want to stream over bluetooth, just straight into my HIFI next to the router.

It's cheaper for my to just by that crappy Asus router and follow the guide on youtube. 25eur here, which is less than it will cost for all the other kit to get the 610N working
stephensuley
DD-WRT Guru


Joined: 09 Feb 2008
Posts: 641
Location: Canada

PostPosted: Mon Oct 25, 2010 19:31    Post subject: Reply with quote
Mattblack wrote:
ah ok. I don't want to stream over bluetooth, just straight into my HIFI next to the router.

It's cheaper for my to just by that crappy Asus router and follow the guide on youtube. 25eur here, which is less than it will cost for all the other kit to get the 610N working


No Bluetooth streaming, no problem. Just remove the Bluetooth USB dongle from the setup.

The guide on youtube is building a solution based device with much different limitations then the setup listed above.

I'm trying to use my router as my central device for Hosting the following services and deviecs over the WAN/LAN without the need for any additional computers;

-shared usb printer/scanner over the LAN
-my media (Mov's/Pics/Songs)
-NAS/Samba for a small file server (samba 3.5HDD)
-FTP Server (proFTPd)
-HTTP Server (lighttpd)
-Audio server (Wired and nonWired aka BlueTooth)

_________________
Location (urban) - 1x Linksys EA8500 (AP wlan0 & wlan1 enabled)
1x Asus 68u (Repeater Bridge w/VAP) - wl0 disabled
1x Asus 87u (Client Bridge) - wl1 disabled


Latest and greatest builds Wink
yutoon
DD-WRT User


Joined: 15 Jul 2010
Posts: 60

PostPosted: Sun Dec 05, 2010 4:16    Post subject: Reply with quote
@stephensuley,

How are you doing with this?

The missing key, from the research I've done, is the sound drivers (soundcore.ko, and about ten snd-*.ko files). Some indicate that these should be included with the ALSA Optware packages, but none (unless I'm doing something wrong) are installed with the two at www.dd-wrt.com/wiki/index.php/Quick_list_of_Optware_packages. Many support files are written, but none of the needed .ko files.

I'm a newcomer to Linux, not sure about 'cross-compiling your own'. Trying to find functional binaries. (Will post here if/when successful.)

Seems like more people would be interested in getting sound operational.
yutoon
DD-WRT User


Joined: 15 Jul 2010
Posts: 60

PostPosted: Wed Dec 08, 2010 18:54    Post subject: Sound with DD-WRT Reply with quote
A little more information, the progression of searching for a solution to Sound with DD-WRT:

1. Get Optware. Install both ALSA packages referenced above. No drivers (soundcore.ko, etc.) are present. Sound cards are not recognized.

2. Go to the USB drivers | Audio section of the DD-WRT USB page, www.dd-wrt.com/wiki/index.php/USB#Multimedia. One date mentioned is "1997." (Some of the material seems to be woefully outdated.) All links given there lead to dead ends (some included below).

3. Search Internet for existing usb_sound modules. Some are found, both 2.4 and 2.6 versions. None work.
    A. All attempts to get the (current) 2.6 kernel to use the older 2.4 drivers (which apparently DO work on 2.4 builds) fail with "No module found in object" error. (Though a good command of Polish could lead to better results. :^)

    B. The latest sound modules available are 2.6.22.xx, which do not run on the 2.6.23.xx and higher versions. Notes:

      Oleg (the famous -- only needs one name, like 'Sade' or 'Elvis' or 'Brainslayer') posts the most up-to-date pre-compiled kernel modules for the wl500g here: http://code.google.com/p/wl500g/downloads/list. Attempts to use these first causes a vermagic error, then when one edits the '2.6.22.19' directly in the binary to '2.6.23.17' so that it might load (This method sometimes works!), the error messages are, for example:

      Code:
      soundcore: Unknown symbol request_module
      soundcore: Unknown symbol kmalloc_caches

      Chasing these, reference to kmalloc_caches is found only here: http://svn.dd-wrt.com:8000/dd-wrt/browser/src/linux/xscale/linux-2.6.24/mm/slub.c?rev=9148, and request_module is used extensively in the source code. Apparently no easy fix possible.

Conclusion:
If a Linux guru would be willing to build and post the needed sound modules, an abundance of testers could assist in the debug. Failing this, there won't be sound with DD-WRT: no Jingle Bells, no O-Tanenbaum, just silence. Crying or Very sad
    gregd72002
    DD-WRT User


    Joined: 06 Jan 2010
    Posts: 81

    PostPosted: Wed Jan 19, 2011 19:19    Post subject: Reply with quote
    Lets play...

    it requires some fiddling to figure out the correct order of 'insmoding'... but it works ;)

    I can't believe that nobody could compile it... it took 15 minutes to get the modules done!

    Enjoy!

    UPDATE:
    - created ipkg

    install and reboot

    you might want to get mpg123 and some music to test it...

    UPDATE 2:
    - modified startup script to add ALSA dev creation

    Thus: ALSA is now working what means BETTER QUALITY!
    Also, AMIXER is working! (did not manage to get ALSAMIXER to work) anyway both the programs are essentially the same.

    [/b]



    kmod-usbsound_2.6.24.111_mipsel.ipk.zip
     Description:
    soudncore (2.6.24.111)
    alsa modules (1.0.14)

    Download
     Filename:  kmod-usbsound_2.6.24.111_mipsel.ipk.zip
     Filesize:  241.64 KB
     Downloaded:  1253 Time(s)



    Last edited by gregd72002 on Sun Jan 23, 2011 11:36; edited 2 times in total
    gregd72002
    DD-WRT User


    Joined: 06 Jan 2010
    Posts: 81

    PostPosted: Wed Jan 19, 2011 20:05    Post subject: Reply with quote
    It looks like this is the right order:
    insmod soundcore.ko
    insmod snd.ko
    insmod snd-seq-device.ko
    insmod snd-page-alloc.ko
    insmod snd-rawmidi.ko
    insmod snd-timer.ko
    insmod snd-pcm.ko
    insmod snd-usb-lib.ko
    insmod snd-hwdep.ko
    insmod snd-usb-audio.ko
    insmod snd-mixer-oss.ko
    insmod snd-pcm-oss.ko


    If anyone could work out alsa to work on a router I'd appreciate it! Wink
    frater
    DD-WRT Guru


    Joined: 07 Jun 2006
    Posts: 2777

    PostPosted: Wed Jan 19, 2011 20:43    Post subject: Reply with quote
    I have no use for it, but just finished some simple supporting scripts.
    OTRW will download the modules and place them in /opt/lib/modules/2.6.24.111
    They can be started with 'service soundmodules start' and made autostart with 'service soundmodules on'

    # service soundmodules start
    Code:
    Start service "soundmodules" (/opt/etc/init.d/S45soundmodules)
    service: Start service: "soundmodules" (/opt/etc/init.d/S45soundmodules)
    S45soundmodules: inserting soundmodules

    # service soundmodules
    Code:
    snd_pcm_oss 40960 0 - Live 0x824b0000
    snd_mixer_oss 16384 1 snd_pcm_oss, Live 0x84ad0000
    snd_usb_lib 12288 0 - Live 0x81f5c000
    snd_pcm 53248 1 snd_pcm_oss, Live 0x86730000
    snd_timer 20480 1 snd_pcm, Live 0x80ca0000
    snd_rawmidi 20480 1 snd_usb_lib, Live 0x83c58000
    snd_page_alloc 8192 1 snd_pcm, Live 0x85f70000
    snd_seq_device 4096 1 snd_rawmidi, Live 0x8220c000
    snd 36864 6 snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_rawmidi,snd_seq_device, Live 0x81c10000
    soundcore 4096 1 snd, Live 0x8718e000
    usbcore 106496 6 snd_usb_lib,usb_storage,ohci_hcd,uhci_hcd,ehci_hcd, Live 0x812c0000


    # cat /opt/etc/init.d/S45soundmodules
    Code:
    #!/bin/sh
    prefix=/opt
    export PATH=${prefix}/bin:${prefix}/sbin:${prefix}/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin

    NAME=soundmodules
    SCRIPT=`basename ${0}`

    if [ -z "$1" ] ; then
        case `echo "$0" | sed 's:^.*/\(.*\):\1:g'` in
            S??*) rc="start" ;;
            K??*) rc="stop" ;;
            *) rc="usage" ;;
        esac
    else
        rc="$1"
    fi

    # Start/Stop/Status samba
    case "$rc" in
        status)
            lsmod | grep -e snd -e sound
            ;;
        start)
            KERNEL=`uname -r`
            if cd /opt/lib/modules/$KERNEL ; then
              optlog "${SCRIPT}" "inserting soundmodules"
              /sbin/insmod soundcore.ko
              /sbin/insmod snd.ko
              /sbin/insmod snd-seq-device.ko
              /sbin/insmod snd-page-alloc.ko
              /sbin/insmod snd-rawmidi.ko
              /sbin/insmod snd-timer.ko
              /sbin/insmod snd-pcm.ko
              /sbin/insmod snd-usb-lib.ko
              /sbin/insmod snd-hwdep.ko
              /sbin/insmod snd-usb-audio.ko
              /sbin/insmod snd-mixer-oss.ko
              /sbin/insmod snd-pcm-oss.ko
              cd - 2>&1 >/dev/null
            fi
            ;;
        *)
            echo "Usage: $0 (start|status|usage)"
            ;;
    esac

    exit 0

    _________________
    Asus RT16N + OTRW
    Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
    Copperjet 1616 modem in ZipB-config
    Asterisk, pixelserv & Pound running on router
    Another Asus RT16N as WDS-bridge

    DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
    Release: 12/16/10 (SVN revision: 15758M)
    Goto page 1, 2, 3, 4, 5, 6, 7  Next Display posts from previous:    Page 1 of 7
    Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

    Navigation

     
    Jump to:  
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    You can attach files in this forum
    You can download files in this forum