Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Oxnas 810 based
Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Tue Aug 27, 2013 5:20 pm

Hi,
It's my first post here, and i like your work, FFp stick is very Nice!!!!
Im trying to connect a soundcard to NAs221 trought USB, im meaning a Creative Xmod.
Now if use lsusb, the soundcard appear in list, but i would like to test it.
I think its necessary to install Alsa, alsa-mixer and derivate on FFp..But i dont know how..
Can you help me for instal allsa or a soundcard manager ?
Thanks, and sorry for my bad English ;)

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Tue Aug 27, 2013 6:46 pm

Actually you need only the driver, which is called a 'module' in Linux speak. I *think* it's included in package zyxel_modules-2.6.24.4. Install that, and install module_utils. Then execute (as root)

Code: Select all

modprobe snd-usb-audio
If you now plugin the soundcard, you should see in dmesg that the card is recognized.

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Tue Aug 27, 2013 10:05 pm

Thanks for the reply Mijzelf, i've installed zyxel-utils and module-utils, but whith modprobe, there is an error:

Code: Select all

root@NSA221:~# modprobe snd-usb-audio
modprobe: chdir(2.6.24.4): No such file or directory
I've used dmesg after modprobe and the soundcard seem recognized:

Code: Select all

In usb_disconnect, and number is 2 .....
usb 1-1.3: USB disconnect, address 6
usb 1-1.3: new full speed USB device using oxnas-ehci and address 7
In hub_port_init, and number is 3, retry 0, port 3 .....
usb 1-1.3: configuration #1 chosen from 1 choice
input: Creative Technology Ltd Creative Xmod Wireless as /class/input/input4
input: USB HID v1.11 Device [Creative Technology Ltd Creative Xmod Wireless] on usb-usb-1.3
input: Creative Technology Ltd Creative Xmod Wireless as /class/input/input5
input: USB HID v1.11 Keyboard [Creative Technology Ltd Creative Xmod Wireless] on usb-usb-1.3
How i can test a sound with command line?

Thanks a lot! :)

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Wed Aug 28, 2013 8:27 am

i've installed zyxel-utils
that *should* be zyxel_modules-2.6.24.4. You can (manually) download it here.

zyxel_modules-2.6.24.4 installs kernel modules in /ffp/lib/modules/2.6.24.4/. The modprobe message suggests that directory doesn't exist.
How i can test a sound with command line?
First you need to create the device nodes (see here), and AFAIK then you can just echo some raw sound file in a dsp device. Something like

Code: Select all

cat some_file >/dev/adsp0
Make sure you don't amplify too strong, it can sound horrible.

Or you could use something like mpd or madplay. Don't know if they are available yet for FFP 0.7.

/Edit: They were not available. Compiled them, and put them here. Both are dependent on libmad and libid3tag from Uli.

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Wed Aug 28, 2013 5:13 pm

I've tried all afternoon :roll:
I've uninstall zyxel module 2.6.31.8 and installed zyxel module 2.6.24.4 with funpkg, and now with, "modprobe snd-usb-audio", there is no error.
With "dmesg" i can see:

Code: Select all

usbcore: registered new interface driver snd-usb-audio
With command "cat some_file >/dev/adsp0" , i send a wav file, but i dont hear nothing...with amplifier on ;) .
After cat command i can see a device in /dev/adsp0 and the filesize is exactly the same of file.wav...
I've jumped the guide to made a device nodes, because it dont work for me:

Code: Select all

root@NSA221:/home# mknod -m 660 /dev/adsp0 c 14 0; chgrp audio /dev/adsp0
mknod: `/dev/adsp0': File exists
chgrp: invalid group: `audio'
At this point i've Installed madplay (Thanks for compile Job ) but it need "libmad.so.0 ; libid3tag" and i dont know where find it.
You think i need alsa, alsa-mixer ecc for stream audio to soundcard from tablet?
My idea is to use Nsa221 as an airplay/dlna receiver..
Thanks a lot!

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Wed Aug 28, 2013 6:21 pm

After cat command i can see a device in /dev/adsp0 and the filesize is exactly the same of file.wav...
I've jumped the guide to made a device nodes, because it dont work for me:
Did you create the device node before catting the wav file? If not, you just copied the wav file. And then you can't create the device node anymore, because the filename is already used.
So delete the file, and try to recreate the device node.
You can just skip the chgrp command. The owner/group of the device node is not very exiting, at this stage.
it need "libmad.so.0 ; libid3tag" and i dont know where find it.
It's in Uli's repository. Install uwsiteloader, and use it to add Uli's repository, and then you can use slacker to install libmad and libid3tag.
You think i need alsa, alsa-mixer ecc for stream audio to soundcard from tablet?
My idea is to use Nsa221 as an airplay/dlna receiver..
Really? Most people use their nas as dlna server. I don't know what is needed for an airplay target.

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Thu Aug 29, 2013 2:14 pm

Hi Mz,
Yes, i've first created the node and then catted the file, this is the sequence:

Code: Select all

mknod -m 660 /dev/dsp0 c 14 0

Code: Select all

cat Soldier.mp3 >/dev/dsp0
Only with device dsp0, cat command dont give any error, then in /dev/dsp0 have the same filesize of audio file, and i dont hear nothing..boh.
Thanks for the uli's reporitories, now madplay is installed, but when:

Code: Select all

root@NSA221:/home# madplay Soldier.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
audio: /dev/dsp: No such file or directory
I've used:

Code: Select all

root@NSA221:/home# cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 24: [ 0- 0]: digital audio capture
 33:        : timer
I hope its useful for resolve this issue..
Thanks Mijzelz!!

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Thu Aug 29, 2013 6:02 pm

cat /proc/asound/devices
This lists all available alsa devices. If you insert a 2nd soundcard, you'll get more devices. The numbers are the minors of the devices, the majors are all 116.
So your alsa interface is fully populated with

Code: Select all

mkdir -p /dev/snd/
mknod /dev/snd/controlC0 c 116 0
mknod /dev/snd/pcmC0D0p c 116 16
mknod /dev/snd/pcmC0D0c c 116 24
mknod /dev/snd/timer c 116 33
audio: /dev/dsp: No such file or directory
Did you create it?

Code: Select all

mknod /dev/mixer c 14 0
mknod /dev/dsp c 14 3
If you created it, it's possible OSS is not available yet. Try

Code: Select all

modprobe snd-pcm-oss
modprobe snd-mixer-oss
(madplay (and mpd) is compiled without alsa support, so it needs an oss interface)
Only with device dsp0, cat command dont give any error, then in /dev/dsp0 have the same filesize of audio file, and i dont hear nothing..boh.
Hm. Now I see dsp0 has the same major/minor as /dev/mixer. I don't know what a mixer is supposed to do with that kind of data. Maybe just buffer it for later use?
BTW, no way that mp3 could be played that way. You are streaming the file into the kernel, and the kernel cannot decode mp3. The best you could get is the file interpreted as raw sound.

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Fri Aug 30, 2013 10:17 am

After a reboot of nas i try this sequence:

Code: Select all

modprobe snd-usb-audio
mkdir -p /dev/snd/mknod /dev/mixer c 14 0
mknod -m 660 /dev/dsp0 c 14 0
mknod /dev/snd/controlC0 c 116 0
mknod /dev/snd/pcmC0D0p c 116 16
mknod /dev/snd/pcmC0D0c c 116 24
mknod /dev/snd/timer c 116 33
mknod /dev/dsp c 14 3
modprobe snd-pcm-oss
modprobe snd-mixer-oss
after dmesg:

Code: Select all

usbcore: registered new interface driver snd-usb-audio

I finded some true raw file and when i use madplay now there is no error with dsp..but:

Code: Select all

root@NSA221:/home# madplay sample.raw
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
error: frame 0: lost synchronization
0 frames decoded (0:00:00.0), -inf dB peak amplitude, 0 clipped samples
or with other file:

Code: Select all

root@NSA221:/home# madplay test.raw
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
error: frame 0: lost synchronization
output: ioctl(SNDCTL_DSP_SYNC): Broken pipe
mh, from soundcard dont out any sound in the boh case...boh
But if i now see dmesg:

Code: Select all

usbcore: registered new interface driver snd-usb-audio
cannot submit datapipe for urb 0, error -28: not enough bandwidth
cannot submit datapipe for urb 0, error -28: not enough bandwidth
cannot submit datapipe for urb 0, error -28: not enough bandwidth
thank

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Fri Aug 30, 2013 10:47 am

While you could be able to input a raw sound file into /dev/dsp, Madplay is designed to decode mp3's. So reboot, and retry with an mp3.
cannot submit datapipe for urb 0, error -28: not enough bandwidth
Who knows what you get when decompressing raw sound as if it was mp3 compressed?

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Fri Aug 30, 2013 1:00 pm

Ok, sorry, i've tried with mp3:
root@NSA221:/home# madplay Bells.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: Hells Bells
Composer: Angus Young/Brian Johnson/Malcolm Young
Artist: ACDC
Orchestra: AC/DC
Album: Back in Black
Track: 1
Year: 1980
Publisher: EPC
Genre: Other
output: ioctl(SNDCTL_DSP_SYNC): Broken pipe
in dmesg same error:
cannot submit datapipe for urb 0, error -28: not enough bandwidt
Im searching for a solution,,, thank Mz

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Fri Aug 30, 2013 2:48 pm

That error is spawned by the function start_urbs() in usbaudio.c, and as far as I can see it has nothing to do with the type of data you are trying to send. It just tries to establish a connection to the soundcard, and then a bandwidth error (ENOSPC) is strange.

Are you using an USB hub? Try without.

Does your nas support UPS? If yes, should it be connected to a specific port? In that case you have at least 2 different types of ports. A UPS normally only 'talks' USB 1.1, while the Oxnas chip in your box has 2 USB 2.0 only ports. Try another port, in that case.

Aureliax
Posts: 11
Joined: Tue Aug 27, 2013 5:09 pm

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Aureliax » Fri Aug 30, 2013 4:07 pm

Hi, i dont have a usb hub in the middle, sound card it's connected directly to nas.
I've tried all 3 available port of the nas, with the same result..
Yes nas221 have a Ups support, but this feature its non activable without a real nas plugged..
Thank Mz

Effectly, dmesg speak of an 1.1 usb device . . . :o

Code: Select all

input: Creative Technology Ltd Creative Xmod Wireless as /class/input/input4
input: USB HID v1.11 Device [Creative Technology Ltd Creative Xmod Wireless] on usb-usb-1.1
input: Creative Technology Ltd Creative Xmod Wireless as /class/input/input5
input: USB HID v1.11 Keyboard [Creative Technology Ltd Creative Xmod Wireless] on usb-usb-1.1
cannot submit datapipe for urb 0, error -28: not enough bandwidth
cannot submit datapipe for urb 0, error -28: not enough bandwidth

kaoz3000
Posts: 1
Joined: Tue Dec 31, 2013 11:50 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by kaoz3000 » Tue Dec 31, 2013 12:04 pm

I am also interested in using my new NSA-325 as an Airplay Receiver. Aureliax did you have any success with the USB Card? I yes what was the solution?
I'm not that much into Linux so it would be great to have a how to that works at least for someone.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Nsa221 FFP 0.7 and soundcard USB (Creative Xmod) Airplay

Post by Mijzelf » Thu Jan 02, 2014 8:52 am

For the 325 it's basically the same, you'll only have to use zyxel_modules 2.6.31.8, instead of 2.6.24.4.

Post Reply