General NAS-Central Forums

Welcome to the NAS community
It is currently Wed Oct 18, 2017 5:35 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Feb 20, 2017 9:32 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
Greetings to the Zyxel community

After following this http://forum.nas-central.org/viewtopic.php?f=249&t=18447 thread by MrDini I decided to try setting up my USB DAC with my NAS 325v2 running Entware (MrDini uses ffp).

My dac utilizes the Sabre chip same as the HiFimeDIY Sabre.

lsusb
Code:
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 262a:9027  <--
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


lsusb -t
Code:
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, unknowxhci_hcdM
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_marvell/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 3, If 1, Class=Audio, Driver=, 12M
        |__ Port 2: Dev 3, If 2, Class=Audio, Driver=, 12M
        |__ Port 2: Dev 3, If 3, Class=Audio, Driver=, 12M


I have installed the alsa-lib and alsa-utils packages but as you can see no driver is being loaded for my device.

Also
Code:
modprobe snd-usb-audio

Doesn't work for me. Also I cannot run alsamixer as to be expected.

I have found this tutorial https://wiki.openwrt.org/doc/howto/usb.audio for OpenWrt but I cannot see the kmod packages in our repo.

Does anyone have any experience or ideas on how I could make this work or is it not possible on Entware? I also found this tutorial https://www.snbforums.com/threads/asus- ... yer.18879/ but I can see that these modules are model specific? Trying the RT-N66U modules gave me

insmod snd-usb-audio.ko
Code:
insmod: can't insert 'snd-usb-audio.ko': invalid module format


I Would appreciate any guidance for this problem of mine, thank you! :P

EDIT: My plan is to finally install MPD and control it with an android device.


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 6:04 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
http://downloads.zyxel.nas-central.org/Users/Mijzelf/Entware-ng/binaries/armv5/zyxel-modules-2.6.31.8_1_armv5soft.ipk


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 10:54 am 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
Thanks barmalej, I didn't knew the modules were in the repo :x

I have managed to load the modules using a init.d script as the tutorial instructions, I tried to load the modules on /lib/modules but I failed.

Anyway, now...

lsusb -t
Code:
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, unknowxhci_hcdM
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_marvell/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 3, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 3, If 3, Class=Audio, Driver=snd-usb-audio, 12M


and my sound card is recognized (I think)

cat /proc/asound/cards
Code:
 0 [XDA2           ]: USB-Audio - X-DA2
                      SAVIAUDIO X-DA2 at usb-ehci_marvell.70059-1.2, full speed


But unfortunately Alsa cannot see my sound card

aplay -l
Code:
aplay: device_list:268: no soundcards found...


alsactl init also returns "no soundcards found"

Do you think I also need to find the alsa-base package?
Do I miss "Alsa kernel support"?


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 12:51 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
You might be surprised, but I am not familiar neither with entware-ng nor with usb audio setup on linux. No doubts, that MrDini has more experience in this. Try to PM him. One additional proposal-please continue discussion on forum, because others also might be interested in solution.
BTW. Do all required drivers are loaded? Can you paste output of:
Code:
lsmod
and
Code:
modinfo snd-usb-audio


P.S. Examine this and following posts:
http://forum.nas-central.org/viewtopic.php?f=249&t=18447&start=45#p102625


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 4:18 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
Thanks for the suggestions, the thing that I noticed is that when I opkg install zyxel-modules-2.6.31.8 these get isntalled in /opt/lib/* and not /lib. But when I try to modprobe, modprobe is configured to work on /lib (system based) which is Read-Only so I manually use the command "insmod" this is the script I'm using:

S02load_sound_modules
Code:
#!/bin/sh
PATHTO="/i-data/66941eee/tmp/"
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 index=0
fi


This seem to work on first glance

lsmod
Code:
snd_usb_audio          62920  0
snd_usb_lib            15844  1 snd_usb_audio
snd_pcm_oss            25012  0
snd_mixer_oss          14436  1 snd_pcm_oss
snd_seq_midi            5764  0
snd_rawmidi            18816  2 snd_usb_lib,snd_seq_midi
snd_seq_midi_event      5736  1 snd_seq_midi
snd_seq                49928  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device          5824  3 snd_seq_midi,snd_rawmidi,snd_seq
snd_pcm                62448  2 snd_usb_audio,snd_pcm_oss
snd_hwdep               6860  1 snd_usb_audio
snd_page_alloc          7040  1 snd_pcm
snd_timer              18436  2 snd_seq,snd_pcm
snd                    42160  9 snd_usb_audio,snd_pcm_oss,snd_mixer_oss,snd_rawmidi,snd_seq,snd_seq_device,snd_pcm,snd_hwdep,snd_timer
soundcore               5052  1 snd
xhci                   38140  0
bsd_comp                6424  0
pppoe                  12444  0
pppox                   3104  1 pppoe
ppp_deflate             5604  0
ppp_async               9532  0
ppp_synctty             8156  0
ppp_mppe                7400  0
ppp_generic            25452  7 bsd_comp,pppoe,pppox,ppp_deflate,ppp_async,ppp_synctty,ppp_mppe
slhc                    5992  1 ppp_generic
tntfs                 394012  0
ntfs                   99920  0


But I don't get modinfo

modinfo snd_usb_audio (or snd-usb-audio)
Code:
filename:       snd_usb_audio


I will take a closer look at Mr.Dini's thread and pm him in case he has any ideas, thanks again!


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 4:47 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Hi,

I haven't disappeared, just became a Kodi dev, and it's fullfil my free time.. So I just now seen Your post... :oops:

Well, I haven't got So much experience in the Entware's beautiful world, So I Can only describe my FFp experiments...

I also have a Denon sound card, but I had to forgot the alsa, because I Couldn't use the software decoder with it and the hw based play was so loud... I used the OSS drivers either.

Here are the modules which are actually loaded on my system for the card:

Code:
snd_usb_audio          62920  0
snd_hwdep               6860  1 snd_usb_audio
snd_usb_lib            15844  1 snd_usb_audio
snd_rawmidi            18816  1 snd_usb_lib
snd_seq_device          5824  1 snd_rawmidi
snd_pcm                62448  1 snd_usb_audio
snd_page_alloc          7040  1 snd_pcm
snd_timer              18436  1 snd_pcm
snd                    42160  6 snd_timer,snd_pcm,snd_seq_device,snd_rawmidi,snd_hwdep,snd_usb_audio
soundcore               5052  1 snd


Load theese and create the required device nodes:

Code:
mknod /dev/mixer c 14 0
mknod /dev/dsp c 14 3


Now, see if the device is acessible. I figured out a little trick for that :). Try to cat the /dev/dsp. If it says No such device, the modules, or something is wrong. Else, if You see some other message, the card is ready.

And You are finished with the setup. Now configure the mpd config and add the output!

PS: if the mpd not works, I recommend the madplay (the package and it's dependencies are available at my repo :)) package first, because it is a really cool, ligtweight mp3 player with CLI. Try to start a music, and when You Can hear it check the mpd config.

PS2: I just be notified about the PM's, when I visit the forum. So feel free to send a mail (in case, when You don't got a response) me at <my nick with small letters>[ at ]atw[ dot ]hu and link the topic.

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 5:31 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
Hello MrDini! I was about to send you a msg thanks for the comment!!

Using
Code:
mknod /dev/mixer c 14 0
mknod /dev/dsp c 14 3


Works with madplay :P :P

Alsa still can't find the soundcard, does this mean madpaly bypasses alsa? And I think I need to create the required device nodes with every boot. I rebooted my nas and madplay wasn't working after, I think I need to create a startup script, gonna see if I can try with mpd


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 6:39 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
For alsa support you need to create appropriate devices nodes as well. On older kernel's like ours NSA3** 2.6.31.8 snddevices helper script was used.
You can find it in this archive:
ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.25.tar.bz2
Simply extract snddevices script from archive and run it.

Some additional useful links:
http://alsa.opensrc.org/Proc_asound_documentation
https://www.alsa-project.org/main/index ... ibrary_API
http://www.alsa-project.org/~valentyn/A ... WTO-7.html

https://wiki.debian.org/SoundFAQ
https://wiki.archlinux.org/index.php/Ad ... chitecture
https://wiki.gentoo.org/wiki/ALSA
http://www.linuxfromscratch.org/hints/d ... D/alsa.txt
https://www.alsa-project.org/main/index.php/Download

P.S. Remove your manually previous created devices nodes first before running snddevices.
Code:
rm /dev/mixer
rm /dev/dsp

Script will create them as symlinks to:
Code:
ls -la /dev/mixer /dev/dsp
Quote:
lrwxrwxrwx 1 root root 4 Feb 21 20:26 /dev/dsp -> dsp0
lrwxrwxrwx 1 root root 6 Feb 21 20:26 /dev/mixer -> mixer0


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 6:57 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Why Do You want to use alsa? The OSS also works fine with mpd. I am using it very happily! :D

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 7:32 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
I though that alsa was the only way to achieve this... :oops:

I'm using OSS on mpd atm following the instructions from your thread!! Sooo does this mean I can delete alsa-lib and alsa-utils?

MrDini, have you had any hiccups on playback at the start of the songs? Is it a buffer setting? It only happens when I skip a song. There is a small pause about 1sec (I think I saw something like this in your thread or maybe on another forum) EDIT There is also a small spike in cpu usage on MPD ~6-8% (I don't know if that's related though)

Quote:
For alsa support you need to create appropriate devices nodes as well

I don't think I will be going that road since it is not needed, gonna check those links for some more info though!

atm I'm very happy with how it works, mpd ~1% cpu load :mrgreen:


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 8:04 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Quote:
Sooo does this mean I can delete alsa-lib and alsa-utils?


Yes, You Can delete theese packages.

Quote:
MrDini, have you had any hiccups on playback at the start of the songs?


Yep, I also experienced a bit lagg at the beginning of the music, but fortunately somehow I Could solve that. But I don't remember how did I do that, and I am far away from home now, So I Cannot tell now the details...

Edit: You also have to load the modules and create device nodes for the mpd also. So I recommend to write a script which called by the mpd start script on every boot. Or look for an udev package on entware-ng... :roll:

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Wed Feb 22, 2017 12:00 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
And like that, it stopped working :lol:

Everything seems to be fine, madplay and mpd are showing no errors (cat on /dev/dsp works) but there is no sound coming out, like it's muted or something, tried different ffmpeg packages, reinstalled, changed usb ports..

EDIT: The plot thickens... The dac doesn't work on my linux laptop with alsa either, but it perfectly workds on my Win 7 desktop.... Looks like a driver or a setting problem... but why did it work the first time.


Top
 Profile  
 
PostPosted: Wed Feb 22, 2017 2:13 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Do You have modprobe binary?

Try to restart the NAS and set everything again.

PS: the madplay doesn't use ffmpeg.

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Wed Feb 22, 2017 3:40 pm 
Offline

Joined: Mon Mar 31, 2014 9:35 am
Posts: 51
So, I left the house for about an hour, came back and it now works :twisted: I'm not making this up.

I'm beginning to think that I may have a faulty unit or there's a short circuit somewhere or something.... I'm too afraid to reboot now... :lol:

MrDini, I use insmod commands that I write above to load the modules, I cannot modprobe I think because Entware doesn't use its own modules like ffp? but the system-based meaning that /lib is Read-Only I cannot change permisions even as root and so is /lib/modules.dep (I could be wrong though, I don't really know much about this.) There is a /opt/lib/modules directory but I think it's useless.

EDIT: Rebooted and now it's same as before, both madplay and mpd seem to work but not audio. ps I removed and reinstalled alsa-lib cause mpd needs it.


Top
 Profile  
 
PostPosted: Wed Feb 22, 2017 7:23 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Well, AFAIK the /lib folder is read-only, because it is a part of the system img (but ask @Mijzelf for sure).

If the modprobe only loads the /lib/modules/*, I think this is some fw binary... Try to modify @barmalej2's kmod build script for Entware and compile one with Your NAS's kernel headers. The insmod also okay, but a bit more complicated way to load the modules...

If You disconnect the sound card, You have to reboot and load again the modules, and after that create the device nodes. If You Can install udev, it will automatically attach and remove the devices, but it needs kmod. :D

And regarding the mpd, sorry, I was wrong! However You don't use the alsa in production, the alsa libs are dependencies, So the mpd will not start up if theese aren't installed on Your system...

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 43 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group