DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-06-05 00:48:14

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

USB Audio on CH3SNAS/DNS-323

Today I've spent some time getting USB Audio working on the CH3SNAS. As I'm quite new to hacking the NAS, and to Linux in general, I'd like to have some feedback on how I've done it, to maybe streamline the process.

The USB Audio device is the 'Conceptronic USB Sound Adapter', which is probably the same as all cheap USB audio adapters on the market. This is what I posted in the wiki (http://dns323.kood.org/hardware:sound):

Installing Drivers

You will need to install the following kernel modules:

Code:

insmod kernel/sound/soundcore.ko;
insmod kernel/sound/core/snd-page-alloc.ko;
insmod kernel/sound/core/snd.ko;
insmod kernel/sound/core/snd-hwdep.ko;
insmod kernel/sound/core/snd-timer.ko;
insmod kernel/sound/core/snd-pcm.ko;
insmod kernel/sound/core/oss/snd-mixer-oss.ko;
insmod kernel/sound/core/oss/snd-pcm-oss.ko;
insmod kernel/drivers/usb/class/audio.ko;
insmod kernel/sound/core/seq/snd-seq-device.ko;
insmod kernel/sound/core/snd-rawmidi.ko;
insmod kernel/sound/usb/snd-usb-lib.ko;
insmod kernel/sound/usb/snd-usb-audio.ko;

Precompiled modules for firmware v1.03 can be found here: http://dev.skcserver.de/dns323/modules_v1.03/ (except for audio.ko).

Load the modules using insmod in the order listed above. You can cd into the modules-directory and copy/paste the lines above in your terminal. Plug in your sound card. Typing dmesg in the command line should show you something like this: 'usbcore: registered new driver snd-usb-audio', and some entries for usbaudio.

Now create the devices in /dev like so:

Code:

cd /dev
mknod -m 660 mixer c 14 0; chgrp audio mixer
mknod -m 660 mixer1 c 14 16; chgrp audio mixer1
mknod -m 660 dsp c 14 3; chgrp audio dsp
mknod -m 660 dsp1 c 14 19; chgrp audio dsp1

(taken from http://buffalo.nas-central.org/index.ph … sound_card)

At the end I was able to play back an mp3 using sox in a chrooted Debian. I'm going to try and install MPD and MPC to turn my NAS into the replacement for my dying cd-player in the living room.

Offline

 

#2 2008-06-05 10:44:21

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

Re: USB Audio on CH3SNAS/DNS-323

I've got MPD working now, and can access it through the command line using MPC and via the web using phpMp2. However, the sound is garbled at times and MPD tends to freeze. Apparently, there is still some work to be done.

Offline

 

#3 2008-06-05 11:37:34

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: USB Audio on CH3SNAS/DNS-323

I appreciate your effort in developing new things, but why not buy a simple upnp mediaplayer like the Philips SLA 5520, they are cheap and perform quite well. This way you can keep your NAS somewhere out of sight and hearing.

Offline

 

#4 2008-06-05 11:46:01

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: USB Audio on CH3SNAS/DNS-323

Is it possible to play music without a debian?

Offline

 

#5 2008-06-05 12:01:57

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

Re: USB Audio on CH3SNAS/DNS-323

knireis wrote:

I appreciate your effort in developing new things, but why not buy a simple upnp mediaplayer like the Philips SLA 5520, they are cheap and perform quite well. This way you can keep your NAS somewhere out of sight and hearing.

You are probably right, but I had the NAS already. The sound card was a €10 upgrade, and I like getting the most out of my stuff.

@DeLaCroix: it is probably possible, but I haven't been able to cross compile anything yet. Installing Debian is quite simple. Just follow the instructions: http://dns323.kood.org/howto:chroot_debian
After that, chroot into debian, type "apt-get install mpd", edit /etc/mpd.conf to match the location of your mp3's and start mpd (just type "mpd").

Offline

 

#6 2008-06-05 12:12:52

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: USB Audio on CH3SNAS/DNS-323

hmmm the Problem is, that i have mysql, lighttpd and php running. So there is not much RAM free. If i start debian, there will be even less ram, i think.

Perhaps someone can try to crosscompile it?

Offline

 

#7 2008-06-05 12:35:18

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

Re: USB Audio on CH3SNAS/DNS-323

Someone please correct me if I am wrong, but to me it appears Debian itself doesn't use up any extra memory. It's just the processes you run from within that use up memory.

I have set up a cross compile toolchain, and I am able to compile the required kernel modules. Is there a nice explanation on how to set up other programs (like mpd and its dependencies) for cross compiling?

Offline

 

#8 2008-06-05 14:20:25

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: USB Audio on CH3SNAS/DNS-323

Did you have a look into the ipkg thingy? (http://dns323.kood.org/forum/t1797-%5Ba … k%27s.html) Perhaps they already have or can build the programs?
Would be perfect if you could get this running!

Offline

 

#9 2008-06-05 15:30:11

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

Re: USB Audio on CH3SNAS/DNS-323

I haven't looked at that, but as I already have Debian running, it's no priority for me.

The crashes appear to be caused by the usb sound adapter hardware itself. Plugged into my mac it crashes after several minutes as well. Maybe I destroyed it in the process (which I can't imagine) so I'm getting a replacement asap.

Offline

 

#10 2008-07-28 23:09:21

tromorow
New member
Registered: 2008-05-18
Posts: 2

Re: USB Audio on CH3SNAS/DNS-323

could somebody tell me, where I can get the audio.ko?
I can't find it anywhere compiled for the DNS323!

Offline

 

#11 2008-07-29 01:19:34

DiMension
Member
From: Ehv, NL
Registered: 2008-04-28
Posts: 16

Re: USB Audio on CH3SNAS/DNS-323

You can get mine here. Let me know how it works for you.

Last edited by DiMension (2008-07-29 01:19:45)

Offline

 

#12 2008-07-29 13:29:16

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: USB Audio on CH3SNAS/DNS-323

DiMension wrote:

Someone please correct me if I am wrong, but to me it appears Debian itself doesn't use up any extra memory. It's just the processes you run from within that use up memory.

No and Yes. Processes that are started inside your chroot enviroment will load other libarys than outside. You will end up having two libc etc in RAM. That is defintely extra memory. You can look at the VSZ collumn on ps aux. That will output the (virtual) memory usage of the process and all its libarys. If you started just a few apps inside debian it's a great overhead.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB