MPD and USB sound card

Re: MPD and USB sound card

Postby lexam » Tue Feb 06, 2018 6:45 am

Hi, thank you for your help so far.

I was able (I think) to insmod the modules and modprobe them. They seem to have been loaded, but aplay -l still says "no soundcards found..." I plugged the usb card into an ubuntu box and it recognizes it as a CM108 card, which is quite common from what I see on the internet and supposed to be compliant with Class 1 audio, so should work out of the box on a standard linux distribution. having said that, maybe the kernel needs to have USB audio enabled somehow? I might be talking nonsense here, as my knowledge is quite limited in this area.

Thanks again for your assistance
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby fvdw » Tue Feb 06, 2018 8:15 am

I see what does
Code: Select all
/usr/bin/usb-devices

gives for info after inserting the modules and after that plugging in your device ?

Also
Code: Select all
dmesg
could give some useful info

to see if all modules are loaded you can use
Code: Select all
lsmod


Anyhow I will compile a kernel with the modules builtin, that will be later today. But i would be interested to see why the modules did not seem to work
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby lexam » Wed Feb 07, 2018 6:13 am

Hi, please see below

lsmod (after loading modules):

Code: Select all
root@fvdwsl-base:/ # lsmod
snd_usb_audio 107436 0 - Live 0xbf0c3000
snd_hwdep 4875 1 snd_usb_audio, Live 0xbf0be000
snd_pcm 67270 1 snd_usb_audio, Live 0xbf0a4000
snd_timer 17771 1 snd_pcm, Live 0xbf09b000
snd_usbmidi_lib 17386 1 snd_usb_audio, Live 0xbf092000
snd_rawmidi 16815 1 snd_usbmidi_lib, Live 0xbf088000
snd_seq_device 3069 1 snd_rawmidi, Live 0xbf084000
snd 40555 7 snd_usb_audio,snd_hwdep,snd_pcm,snd_timer,snd_usbmidi_lib,snd_rawmidi,snd_seq_device, Live 0xbf072000
soundcore 4669 1 snd, Live 0xbf06c000
usbhid 18739 0 - Live 0xbf063000
iscsi_tcp 8140 0 - Live 0xbf05d000
libiscsi_tcp 11554 1 iscsi_tcp, Live 0xbf056000
libiscsi 32535 2 iscsi_tcp,libiscsi_tcp, Live 0xbf048000
scsi_transport_iscsi 57740 2 iscsi_tcp,libiscsi, Live 0xbf02d000
usblp 10010 0 - Live 0xbf026000
usb_storage 39194 0 - Live 0xbf013000
ehci_orion 2698 0 - Live 0xbf00f000
ehci_hcd 39634 1 ehci_orion, Live 0xbf000000


/usr/bin/usb-devices:

Code: Select all
root@fvdwsl-base:/ # usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=04.06
S:  Manufacturer=Linux 4.6.6 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=orion-ehci.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0d8c ProdID=013c Rev=01.00
S:  Manufacturer=C-Media Electronics Inc.
S:  Product=USB PnP Sound Device
C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 3 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid


dmesg:

Code: Select all
[  621.705462] usb 1-1: new full-speed USB device number 3 using orion-ehci
[  621.862484] usb 1-1: New USB device found, idVendor=0d8c, idProduct=013c
[  621.869208] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  621.876349] usb 1-1: Product: USB PnP Sound Device
[  621.881127] usb 1-1: Manufacturer: C-Media Electronics Inc.
[  622.018778] input: C-Media Electronics Inc.       USB PnP Sound Device as /devices/platform/orion-ehci.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0002/input/input2
[  622.105829] hid-generic 0003:0D8C:013C.0002: input: USB HID v1.00 Device [C-Media Electronics Inc.       USB PnP Sound Device] on usb-orion-ehci.0-1/input3


Thanks
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby fvdw » Wed Feb 07, 2018 9:09 am

Seems modules are loaded and also the driver for the usb device. So I would expect that it should work. From kernel side ot is ok now. We need to llok at application that wants to use the device. Maybe your config file of the application using the device is not correctly setup ?? You mentioned you use "aplay". How did you intall that? And what config setup did you use?

For me its also new land. I will order such a device to do some trials, always nice to add a new feature to our firmware
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby lexam » Wed Feb 07, 2018 11:26 am

I can try to help as much as I can. MPD expects to be configured with a sound card that is recognized and working with ALSA. I've installed alsa via ipkg install alsa-utils. I haven't tried to actually use MPD yet, as I'm still trying to get alsa to get to talk to the card. MPD would be the step after that.
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby lexam » Wed Feb 07, 2018 11:27 am

BTW, I believe that although the card is detected by usb-devices, it's not recognized as a sound card. Maybe that's what's missing. I'm pretty sure that it was recognized in exactly the same way before I added the modules you sent me.
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby fvdw » Wed Feb 07, 2018 3:39 pm

No it is different after loading the modules. Without them the drivers were not loaded. Compare this part....new is snd-usb-audio afrer Driver=

Code: Select all
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 3 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby fvdw » Thu Feb 08, 2018 5:19 pm

I got me such a device and this is the result

Seems that modules are loaded by itself on a nwsp2 when inserting the usb sound device
Drivers are loaded

Code: Select all
root@fvdwsl-5big2: # /usr/bin/usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=04.06
S:  Manufacturer=Linux 4.6.6 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=orion-ehci.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 2
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=0424 ProdID=2512 Rev=0b.b3
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I:  If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1b3f ProdID=2008 Rev=01.00
S:  Manufacturer=GeneralPlus
S:  Product=USB Audio Device
C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 3 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

The name of device is different from yours but it has the same chip inside (CM108)

However the command aplay -l or -L (after installing aplay library and utilities) gives "no devices found".
Code: Select all
root@fvdwsl-5big2: # aplay -l
aplay: device_list:272: no soundcards found...

That odd, they are there

Code: Select all
root@fvdwsl-5big2: # cat /proc/asound/cards
 0 [Device         ]: USB-Audio - USB Audio Device
                      GeneralPlus USB Audio Device at usb-orion-ehci.0-1.1, full speed
root@fvdwsl-5big2: # aplay -l
aplay: device_list:272: no soundcards found...
root@fvdwsl-5big2: # cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k4.6.6.
root@fvdwsl-5big2: # cat /proc/asound/cards
 0 [Device         ]: USB-Audio - USB Audio Device
                      GeneralPlus USB Audio Device at usb-orion-ehci.0-1.1, full speed
root@fvdwsl-5big2: # cat /proc/asound/pcm
00-00: USB Audio : USB Audio : playback 1 : capture 1
root@fvdwsl-5big2: # cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 24: [ 0- 0]: digital audio capture
 33:        : timer


Reason we are missing the devices nodes for sound. To solve that create them for the moment manually

Code: Select all
mkdir /dev/snd
mknod -m 666 /dev/snd/controlC0 c 116 0
mknod -m 666 /dev/snd/hwC0D0 c 116 4
mknod -m 666 /dev/snd/hwC0D1 c 116 5
mknod -m 666 /dev/snd/hwC0D2 c 116 6
mknod -m 666 /dev/snd/hwC0D3 c 116 7
mknod -m 666 /dev/snd/midiC0D0 c 116 8
mknod -m 666 /dev/snd/midiC0D1 c 116 9
mknod -m 666 /dev/snd/midiC0D2 c 116 10
mknod -m 666 /dev/snd/midiC0D3 c 116 11
mknod -m 666 /dev/snd/midiC0D4 c 116 12
mknod -m 666 /dev/snd/midiC0D5 c 116 13
mknod -m 666 /dev/snd/midiC0D6 c 116 14
mknod -m 666 /dev/snd/midiC0D7 c 116 15
mknod -m 666 /dev/snd/pcmC0D0c c 116 24
mknod -m 666 /dev/snd/pcmC0D0p c 116 16
mknod -m 666 /dev/snd/pcmC0D1c c 116 25
mknod -m 666 /dev/snd/pcmC0D1p c 116 17
mknod -m 666 /dev/snd/pcmC0D2c c 116 26
mknod -m 666 /dev/snd/pcmC0D2p c 116 18
mknod -m 666 /dev/snd/pcmC0D3p c 116 19
mknod -m 666 /dev/snd/pcmC0D3c c 116 27
mknod -m 666 /dev/snd/pcmC0D4c c 116 28
mknod -m 666 /dev/snd/pcmC0D4p c 116 20
mknod -m 666 /dev/snd/pcmC0D5c c 116 29
mknod -m 666 /dev/snd/pcmC0D5p c 116 21
mknod -m 666 /dev/snd/pcmC0D6c c 116 30
mknod -m 666 /dev/snd/pcmC0D6p c 116 22
mknod -m 666 /dev/snd/pcmC0D7c c 116 31
mknod -m 666 /dev/snd/pcmC0D7p c 116 23
mknod -m 666 /dev/snd/seq c 116 1
mknod -m 666 /dev/snd/timer c 116 33

Now the sound card is found :bananadance
Code: Select all
root@fvdwsl-5big2: # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

root@fvdwsl-5big2: # amixer
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 30
  Mono:
  Front Left: Playback 23 [77%] [-10.50dB] [on]
  Front Right: Playback 23 [77%] [-10.50dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 14 Capture 0 - 30
  Mono: Playback 1 [7%] [-10.50dB] [off] Capture 26 [87%] [27.00dB] [on]
Simple mixer control 'Auto Gain Control',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]

root@fvdwsl-5big2: # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Device
    USB Audio Device, USB Audio
    Default Audio Device
sysdefault:CARD=Device
    USB Audio Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    Front speakers
surround21:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby lexam » Fri Feb 09, 2018 6:52 am

Excellent, we're definitely making progress. I tried "aplay /somewavfile" and it initially complained about a group "audio" not existing. I added it by editing /etc/group (audio:x:503:) and now aplay actually plays an audio file! The sound is not very good yet, as there is some crackling noise in the background, but we're getting there!
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby Jocko » Fri Feb 09, 2018 8:14 am

Hi lexam,

Please to change the gid for your group 'audio'. 503 is already used by another server.

So currently, we have selected the value 508 for this group.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

PreviousNext

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: Bing Bot and 7 guests