Re: Configure ALSA to handle a USB sound card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 21/12/11 23:06, Casi wrote:
> Summary: at the moment the patch doesn't work for me :( ...

:) Fortunately, I was wrong !!

Midi playback works! The MOX wasn't configured in the right midi channel.
$ aconnect -iol
client 0: 'System' [type=kernel]
     0 'Timer           '
     1 'Announce        '
client 14: 'Midi Through' [type=kernel]
     0 'Midi Through Port-0'
client 20: 'Yamaha MOX6/MOX8' [type=kernel]
     0 'Yamaha MOX6/MOX8 MIDI 1'
     1 'Yamaha MOX6/MOX8 MIDI 2'
     2 'Yamaha MOX6/MOX8 MIDI 3'
     3 'Yamaha MOX6/MOX8 MIDI 4'
     4 'Yamaha MOX6/MOX8 MIDI 5'

$ aplaymidi -p 20:0 mutopia_sample.mid

sounds fine in the MOX.

Midi recording works!
$ arecordmidi -l
  Port    Client name                      Port name
  14:0    Midi Through                     Midi Through Port-0
  20:0    Yamaha MOX6/MOX8                 Yamaha MOX6/MOX8 MIDI 1
  20:1    Yamaha MOX6/MOX8                 Yamaha MOX6/MOX8 MIDI 2
  20:2    Yamaha MOX6/MOX8                 Yamaha MOX6/MOX8 MIDI 3
  20:3    Yamaha MOX6/MOX8                 Yamaha MOX6/MOX8 MIDI 4
  20:4    Yamaha MOX6/MOX8                 Yamaha MOX6/MOX8 MIDI 5

$ arecordmidi -p 20:0 mox_recording.mid

good!

Audio playback works! I didn't choose the right device.
$ aplay -vv -D plughw:MOX6MOX8 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit 
Little Endian, Rate 48000 Hz, Mono
Plug PCM: Rate conversion PCM (44100, sformat=S16_LE)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
   stream       : PLAYBACK
   access       : RW_INTERLEAVED
   format       : S16_LE
   subformat    : STD
   channels     : 1
   rate         : 48000
   exact rate   : 48000 (48000/1)
   msbits       : 16
   buffer_size  : 24000
   period_size  : 6000
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 6000
   period_event : 0
   start_threshold  : 24000
   stop_threshold   : 24000
   silence_threshold: 0
   silence_size : 0
   boundary     : 6755399441055744000
Slave: Route conversion PCM (sformat=S24_3LE)
   Transformation table:
     0 <- 0
     1 <- 0
Its setup is:
   stream       : PLAYBACK
   access       : MMAP_INTERLEAVED
   format       : S16_LE
   subformat    : STD
   channels     : 1
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 16
   buffer_size  : 22051
   period_size  : 5513
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5513
   period_event : 0
   start_threshold  : 16539
   stop_threshold   : 22051
   silence_threshold: 0
   silence_size : 0
   boundary     : 6206804711446675456
Slave: Hardware PCM card 1 'Yamaha MOX6/MOX8' device 0 subdevice 0
Its setup is:
   stream       : PLAYBACK
   access       : MMAP_INTERLEAVED
   format       : S24_3LE
   subformat    : STD
   channels     : 2
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 24
   buffer_size  : 22051
   period_size  : 5513
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5513
   period_event : 0
   start_threshold  : 16539
   stop_threshold   : 22051
   silence_threshold: 0
   silence_size : 0
   boundary     : 6206804711446675456
   appl_ptr     : 0
   hw_ptr       : 0
#     +                                            | 11%

sounds fine!

Audio recording doesn't work at the moment.
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC272X Analog [ALC272X Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
card 1: MOX6MOX8 [Yamaha MOX6/MOX8], device 0: USB Audio [USB Audio]
   Subdevices: 1/1
   Subdevice #0: subdevice #0

$ arecord -vv -D plughw:MOX6MOX8 mox_recording.wav
Recording WAVE 'mox_recording.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
Plug PCM: Rate conversion PCM (44100, sformat=U8)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
   stream       : CAPTURE
   access       : RW_INTERLEAVED
   format       : U8
   subformat    : STD
   channels     : 1
   rate         : 8000
   exact rate   : 8000 (8000/1)
   msbits       : 8
   buffer_size  : 4000
   period_size  : 1000
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 1000
   period_event : 0
   start_threshold  : 1
   stop_threshold   : 4000
   silence_threshold: 0
   silence_size : 0
   boundary     : 1125899906842624000
Slave: Route conversion PCM (sformat=S24_3LE)
   Transformation table:
     0 <- 0*0.25 + 1*0.25 + 2*0.25 + 3*0.25
Its setup is:
   stream       : CAPTURE
   access       : MMAP_INTERLEAVED
   format       : U8
   subformat    : STD
   channels     : 1
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 8
   buffer_size  : 22056
   period_size  : 5513
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5513
   period_event : 0
   start_threshold  : 6
   stop_threshold   : 22056
   silence_threshold: 0
   silence_size : 0
   boundary     : 6208212086330228736
Slave: Hardware PCM card 1 'Yamaha MOX6/MOX8' device 0 subdevice 0
Its setup is:
   stream       : CAPTURE
   access       : MMAP_INTERLEAVED
   format       : S24_3LE
   subformat    : STD
   channels     : 4
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 24
   buffer_size  : 22056
   period_size  : 5513
   period_time  : 125011
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5513
   period_event : 0
   start_threshold  : 6
   stop_threshold   : 22056
   silence_threshold: 0
   silence_size : 0
   boundary     : 6208212086330228736
   appl_ptr     : 0
   hw_ptr       : 0
Status(R/W):
   state       : PREPARED
   trigger_time: 0.000000
   tstamp      : 14064.731791446
   delay       : 4000
   avail       : 0
   avail_max   : 0
arecord: xrun:1359: read/write error, state = PREPARED

$ dmesg
[14043.238260] cannot submit datapipe for urb 0, error -28: not enough 
bandwidth

I'm reading about this type of error messages but I'm not sure:

1) Do I own a buggy USB controller?
$ lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller 
(rev 02)
00:02.0 VGA compatible controller: Intel Corporation Core Processor 
Integrated Graphics Controller (rev 02)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series 
Chipset HECI Controller (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset 
USB2 Enhanced Host Controller (rev 05)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset 
High Definition Audio (rev 05)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI 
Express Root Port 1 (rev 05)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI 
Express Root Port 2 (rev 05)
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset 
USB2 Enhanced Host Controller (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC 
Interface Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 
4 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus 
Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 
Series Chipset Thermal Subsystem (rev 05)
01:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 
Gigabit Ethernet PCIe (rev 01)
02:00.0 Network controller: Atheros Communications Inc. AR928X Wireless 
Network Adapter (PCI-Express) (rev 01)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath 
Architecture Generic Non-core Registers (rev 02)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath 
Architecture System Address Decoder (rev 02)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 
(rev 02)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)

2) IRQ issue?
$ cat /proc/interrupts
            CPU0       CPU1
   0:         51         45   IO-APIC-edge      timer
   1:         12      33738   IO-APIC-edge      i8042
   8:          0          1   IO-APIC-edge      rtc0
   9:        188        141   IO-APIC-fasteoi   acpi
  12:      16431     832211   IO-APIC-edge      i8042
  16:        214         54   IO-APIC-fasteoi   ehci_hcd:usb1, mei
  17:     194452        336   IO-APIC-fasteoi   ath9k
  23:     153036         29   IO-APIC-fasteoi   ehci_hcd:usb2
  40:      86733       3202   PCI-MSI-edge      ahci
  41:          2          1   PCI-MSI-edge      eth0
  42:    3473069       3979   PCI-MSI-edge      i915
  43:        785        148   PCI-MSI-edge      hda_intel
NMI:          0          0   Non-maskable interrupts
LOC:    2930357    3123027   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:          0          0   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:    2566888    4047704   Rescheduling interrupts
CAL:       1583       4423   Function call interrupts
TLB:       2616       2992   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:         52         51   Machine check polls
ERR:          0
MIS:          0

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 064e:a219 Suyin Corp. 1.3M WebCam (notebook 
emachines E730, Acer sub-brand)
Bus 002 Device 009: ID 0499:1503 Yamaha Corp.

3) USB bandwith issue?
...

At this point, the only thing I'm sure is the main problem is my 
ignorance ;(

Thanks again and Merry Christmas!

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux