What's new

Asus RT-n66u as music player

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

monosoul

New Around Here
Hi!

Today I made a music player out of my Asus RT-n66u and that's how I did it:
1) Compiled Merlin's firmware to get appropriate kernel modules for sound support;
2) Loaded those modules;
3) Connected USB speakers (with integrated sound card of course);
4) Installed and configured MPD;
5) Profit!

ATTENTION: You would need entware to do this!
But, I guess if you have some linux experience, then you could do it with optware too. :)

And that's how you could do it:
1) Download extra modules which I compiled for Merlin's FW here:
- For RT-N66U
- For RT-AC68U
2) Place this archive to the root of your USB/HDD/MMC where entware is installed (let's assume it's /tmp/mnt/sda1) and unpack it.
Code:
cd /tmp/mnt/sda1
tar -xzf ./extras.tar.gz
3) Then you need to create script, which would load sound modules on routers startup:
Code:
touch /opt/etc/init.d/S80load_sound_modules
chmod +x /opt/etc/init.d/S80load_sound_modules
4) Paste next content into this file:
Code:
#!/bin/sh
SCRIPTPATH="`dirname \"$0\"`"
DRIVENAME=`readlink -f $SCRIPTPATH | sed "s/\/tmp\/mnt\///g" | sed "s/\/.*//g"`
PATHTO="/tmp/mnt/$DRIVENAME/extras"
if [ -e $PATHTO ]; then
  insmod $PATHTO/soundcore.ko
  insmod $PATHTO/snd.ko
  insmod $PATHTO/snd-timer.ko
  insmod $PATHTO/snd-page-alloc.ko
  insmod $PATHTO/snd-hwdep.ko
  insmod $PATHTO/snd-pcm.ko
  insmod $PATHTO/snd-seq-device.ko
  insmod $PATHTO/snd-seq.ko
  insmod $PATHTO/snd-seq-midi-event.ko
  insmod $PATHTO/snd-rawmidi.ko
  insmod $PATHTO/snd-seq-midi.ko
  insmod $PATHTO/snd-mixer-oss.ko
  insmod $PATHTO/snd-pcm-oss.ko
  insmod $PATHTO/snd-usb-lib.ko
  insmod $PATHTO/snd-usb-audio.ko
fi
starttime=`date +%s`
diffr=0
while [ ! -e /dev/dsp ] && [ $diffr -le "600" ]; do
  sleep 15
  curtime=`date +%s`
  let "diffr = curtime - starttime"
done
if [ -e /dev/dsp ]; then
  chmod +w /dev/dsp
fi
5) Plug in your USB sound card or USB speakers.
6) Now run this script to load modules:
Code:
/opt/etc/init.d/S80load_sound_modules
7) Install mpd and mpc:
Code:
opkg install mpd mpc
8) Now open /opt/etc/mpd.conf and uncomment next lines:
Code:
audio_output {
        type            "oss"
        name            "My OSS Device"
        device          "/dev/dsp"      # optional
        mixer_type      "hardware"      # optional
        mixer_device    "/dev/mixer"    # optional
        mixer_control   "PCM"           # optional
}
9) Also you could change some other settings, for example - location of your music folder:
Code:
music_directory         "/tmp/mnt/RouterHDD/Media/Music"
playlist directory:
Code:
playlist_directory              "/tmp/mnt/RouterHDD/Media/.mpd/playlists"
and mpd database:
Code:
db_file                 "/tmp/mnt/RouterHDD/Media/.mpd/database"
10) Now you could run it:
Code:
/opt/etc/init.d/S89mpd start
11) and find mpd client for yourself. You could take a look at list of clients here: http://mpd.wikia.com/wiki/Clients
I'm using auremo for Windows.

Hope that guide would be useful for someone. If anyone could make it more user-friendly - I'll appreciate that.
 
Last edited:
awesome use of a router lol. it's been years since i used mpd
 
If mpd is working, does shairport (airplay) works too?
I tried in past but I failed to make it running. As I am noob I can not debug properly and fix all issues. If you look into sharport it would be great.


Sent from my iPhone using Tapatalk
 
This worked really well with my only addition being using fuse and djmount to enable easy access to remote media servers on my pcs and NAS. I can now use my tablet to control streaming from my NAS to the USB speaker attached to the router. Hopefully these modules continue to work as Merlin rolls out new firmware updates...
 
Hi!

Today I made a music player out of my Asus RT-n66u and that's how I did it:
1) Compiled Merlin's firmware to get appropriate kernel modules for sound support;
2) Loaded those modules;
3) Connected USB speakers (with integrated sound card of course);
4) Installed and configured MPD;
5) Profit!
.....

hello monosoul, i want to do same thing on my rt-ac68u. i compiled the modules but fail to insmod them, could you advice what i did wrong? my steps

1. build the firmware
2. enter linux folder under "src-rt-6.x.4708" folder, and execute make menuconfig
3. in device driver config i select sound card support, then advancedlinux sound architecture, then the usb sound devices. i'm not sure if that's all modules i need, but with this configuration, after make i cannot get some .ko files in your post.
4. return to "src-rt-6.x.4708" and execute make kernel
5. copy the sound related .ko files to the router, and insmod them.


i can insmod soundcore.ko, but the snd*.ko cannot, it return "insmod: can't insert 'snd.ko': unknown symbol in module, or unknown parameter"


could you advice did i configure and build the software correctly?
thank you!
 
Compatible with latest Merlin?

Hi,

This sounds really cool. Was wondering about these sound modules do we need to compile them ourselves prior use or are they ready already? If so how to compile? Second what kind of usb sound adapter do you recommend? Lastly anyone get AirPlay working on Merlin? I would like to use Merlin over Tomatoe to retain Asus app functionality. I found a guide that uses TomatoeUsb which has sound modules already and Optware but as I understand Optware is not compatible with arm CPUs so you have to use Entware?

Thanks!
 
Hi,

This sounds really cool. Was wondering about these sound modules do we need to compile them ourselves prior use or are they ready already? If so how to compile? Second what kind of usb sound adapter do you recommend? Lastly anyone get AirPlay working on Merlin? I would like to use Merlin over Tomatoe to retain Asus app functionality. I found a guide that uses TomatoeUsb which has sound modules already and Optware but as I understand Optware is not compatible with arm CPUs so you have to use Entware?

Thanks!

modules are already compiled to use and he provides a link to them in his first post.
 
Ok great. Do you know if they'll work with the latest merlin 3.0.0.4_348.50?

Thanks

The kernel hasn't changed so I guess they will
 
I figured it out. Just had to merge this into config_base.6a. Sound output works fine with a cheap Syba USB sound adapter. Unfortunately MPD stutters ~10s into any song I play, even on a local file. Madplay works fine. So I'm still on the hunt for a DLNA renderer that will work.

Code:
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PCI is not set
# CONFIG_SND_ARM is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set
 
Hi guys!

Sorry for not answering - somehow I didn't recieved any notices about new messages in this thread.

The kernel hasn't changed so I guess they will
microchip is right, there were no changes to kernel since 376.44 so you could easily use modules compiled by me earlier.

As for compilation instructions - there is a nice guide over here: https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu .

If modules would stop working with recent firmware - I'll update this thread, don't worry. :)
 
Interesting. How much CPU time does it use?
It depends on file format. For example: playing mp3 would consume a lot less CPU time than playing flac. Couldn't provide numbers right now, but mpd is really pretty light in terms of CPU usage.
 
Last edited:
Hey - can I make this work with my Merlin/Entware Asus N16 router?

Result: The N16 works fine with the same N66 modules! I am very pleased. I want to think of some cool uses for this...
 
Last edited:
If modules would stop working with recent firmware - I'll update this thread, don't worry. :)

The provided RT-AC68U drivers are not loaded with kernel version 2.6.36.4brcmarm (invalid module format). Does anyone have some newer builds?

Thanks!
 
The provided RT-AC68U drivers are not loaded with kernel version 2.6.36.4brcmarm (invalid module format). Does anyone have some newer builds?

Thanks!

Sorry for such a late post, might as well keep this long time thread running.
I just noticed the same thing as soon as upgrading to 380.63, so I went ahead and did so for the RT-AC68P. Download here.

It's unfortunate that there's no real definitive guide for doing so.

Here's what worked for me:

I followed the guide @ https://github.com/RMerl/asuswrt-me...ource-using-a-Debian-based-Linux-Distribution, I am using Debian 8.
I ran into a couple snags at the beginning, nothing of which wasn't solvable with a couple google searches.

Clone the repository using instructions in the guide, and make sure you checkout the 380.63, or whichever version you like with "git checkout tags/380.63"

Using Polar Nettles suggestion, head to the linux source that pertains to the build you are making. "/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36" in the case of my RT-AC68P.
Then insert the build flags posted previously into config_base.6a that will add in the sound drivers to the build.

Code:
REPLACE
----------------------
# CONFIG_SOUND is not set

WITH
----------------------
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PCI is not set
# CONFIG_SND_ARM is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set

Then follow the compile instructions to compile the image.

Afterwards, the extras were located at: /asuswrt-merlin/release/src/router/arm-uclibc/extras
 
Sorry for such a late post, might as well keep this long time thread running.
I just noticed the same thing as soon as upgrading to 380.63, so I went ahead and did so for the RT-AC68P. Download here.

It's unfortunate that there's no real definitive guide for doing so.

Here's what worked for me:

I followed the guide @ https://github.com/RMerl/asuswrt-me...ource-using-a-Debian-based-Linux-Distribution, I am using Debian 8.
I ran into a couple snags at the beginning, nothing of which wasn't solvable with a couple google searches.

Clone the repository using instructions in the guide, and make sure you checkout the 380.63, or whichever version you like with "git checkout tags/380.63"

Using Polar Nettles suggestion, head to the linux source that pertains to the build you are making. "/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36" in the case of my RT-AC68P.
Then insert the build flags posted previously into config_base.6a that will add in the sound drivers to the build.

Code:
REPLACE
----------------------
# CONFIG_SOUND is not set

WITH
----------------------
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_HRTIMER is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PCI is not set
# CONFIG_SND_ARM is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set

Then follow the compile instructions to compile the image.

Afterwards, the extras were located at: /asuswrt-merlin/release/src/router/arm-uclibc/extras

I don't see that link in the git, arm-uclibc isn't there
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top