Bug 7134

Summary: au600 bugs
Product: Drivers Reporter: Markus Rechberger (mrechberger)
Component: Sound(ALSA)Assignee: Markus Rechberger (mrechberger)
Status: CLOSED CODE_FIX    
Severity: normal CC: audetto, protasnb
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Wav recorded with arecord

Description Markus Rechberger 2006-09-09 14:19:03 UTC
Please report bugs regarding the au600 device here

http://alsa.opensrc.org/au600
Comment 1 Mario Rossi 2006-09-10 09:34:36 UTC
When recording via the AU600 the system freezes with a kernel panic

Fedora Code 5
Kernel (from sources) 2.6.17.13
au600 driver 10/09/06 17:20 GMT

Command

arecord -D plug:duplex dummy.wav

Using the file .asounrc in the website of the driver.

The system freezes.

I could only see the error message when I was not in X, and I copied come of the
information printed on the screen during the error

==============================================================================

Call Trace

usb_hcd_giveback_urb
usb_hcd_giveback_urb
uhci_irq
usb_hcd_irq
handle_IRQ_event
__do_IRQ
do_IRQ
common_interrupt
acpi_processor_idle
cpu_idle
start_kernel

Code 6c 24 20 8b 5d 54 f6 83 4c 01 00 00 01 0f 84 22 01 00 00 8b 1c 01 00 00 ....

EIP: au600_oisocirq+0x33/0x145

Kernel panic - not syncing: Fatal exception in interrupt

============================================================================= 

Unfortunately none of that is present in /var/log/messages after reboot.
Comment 2 Markus Rechberger 2006-09-10 10:00:30 UTC
do you have an smp kernel?
Comment 3 Mario Rossi 2006-09-10 11:11:44 UTC
No.
My system is a laptop, Centrino 1 CPU.
Comment 4 Mario Rossi 2006-09-10 11:41:45 UTC
# CONFIG_SMP is not set

in my .config
Comment 5 Markus Rechberger 2006-09-12 00:03:41 UTC
Ok I was able to reproduce this issue, but not at the first run...
I'll the kdb patch to my kernel .. looks like a logical problem there ... released resources used again
Comment 6 Mario Rossi 2006-09-19 11:13:28 UTC
I've seen that you have recently changed something in the source code of au600
so I tried again (yesterday, the 18-09-2006) with no difference, the oops stays
the same.
Comment 7 Markus Rechberger 2006-09-21 04:48:49 UTC
Hi,

had no time to look at it yet (neither have I changed something that might fix 
that issue).. maybe during the next few days

Markus
Comment 8 Markus Rechberger 2006-10-02 14:11:09 UTC
Hi,

I split off the project from the v4l-dvb project and fixed the nullpointer 
exception..

hg clone http://85.10.198.106/hg/~mrec/au600

please test and give me some feedback

thanks,
Markus
Comment 9 Mario Rossi 2006-10-05 11:28:46 UTC
Created attachment 9162 [details]
Wav recorded with arecord
Comment 10 Mario Rossi 2006-10-05 11:30:03 UTC
I've tried the new code and the kernel problem disappeared.
I can play using aplay, but I haven't yet found the way to record.

Here is what I do

arecord -D plug:duplex prova.xxx
or
arecord -D plug:duplex -f S16_LE -r 9600 prova.xxx

and then after a while I stop with Ctrl-C.

But the file is only long 44 bytes

Here is the output in dmesg

Oct  5 19:35:55 thinkpad kernel: snd_au600_pcm_open
Oct  5 19:35:55 thinkpad kernel: hwparmas format: 2
Oct  5 19:35:55 thinkpad kernel: snd_au600_hw_params
Oct  5 19:35:55 thinkpad kernel: snd_au600_prepare
Oct  5 19:35:55 thinkpad kernel: 4
Oct  5 19:35:55 thinkpad kernel: USERS: 1, ARG: 1, STATUS: 0
Oct  5 19:35:55 thinkpad kernel: 5
Oct  5 19:35:55 thinkpad kernel: au600.c: initiating IRQ
Oct  5 19:35:55 thinkpad kernel: 6
Oct  5 19:35:55 thinkpad kernel: 7
Oct  5 19:36:03 thinkpad kernel: snd_au600_hw_capture_free
Oct  5 19:36:03 thinkpad kernel: 4
Oct  5 19:36:03 thinkpad kernel: USERS: 0, ARG: 0, STATUS: 1
Oct  5 19:36:03 thinkpad kernel: 8
Oct  5 19:36:03 thinkpad kernel: 9
Oct  5 19:36:03 thinkpad kernel: au600.c: killing IRQ
Oct  5 19:36:03 thinkpad kernel: -ENOENT IRQ
Oct  5 19:36:03 thinkpad kernel: snd_au600_hw_capture_free
Oct  5 19:36:03 thinkpad kernel: snd_au600_pcm_close

and the output of arecord

[andrea@thinkpad audio]$ arecord -v -D plug:duplex -f S16_LE -r 9600 prova.xxx
Recording WAVE 'prova.xxx' : Signed 16 bit Little Endian, Rate 9600 Hz, Mono
Plug PCM: Rate conversion PCM (9600, sformat=S16_LE)
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 9600
  exact rate   : 9600 (9600/1)
  msbits       : 16
  buffer_size  : 5760
  period_size  : 1920
  period_time  : 200000
  tick_time    : 4000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1920
  xfer_align   : 1920
  start_threshold  : 1
  stop_threshold   : 5760
  silence_threshold: 0
  silence_size : 0
  boundary     : 1509949440
Slave: Hardware PCM card 2 'AU-600' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 9600
  exact rate   : 9600 (9600/1)
  msbits       : 16
  buffer_size  : 5760
  period_size  : 1920
  period_time  : 200000
  tick_time    : 4000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1920
  xfer_align   : 1920
  start_threshold  : 1
  stop_threshold   : 5760
  silence_threshold: 0
  silence_size : 0
  boundary     : 1509949440
Aborted by signal Interrupt...

I'm using Fedora Core 5, kernel from sources 2.6.18 (alsa driver 1.0.12rc1)
Alsa-lib from http://atrpms.net/dist/fc5/ (version 1.0.13)
Comment 11 Markus Rechberger 2006-10-06 10:19:27 UTC
you need to play a file for beeing able to record something.
This is a limitation of the device itself. Since VoIP is usually done in full 
duplex I think this shouldn't be a real problem.

Markus
Comment 12 Mario Rossi 2006-10-12 12:20:31 UTC
Indeed it works now.
The quality is better that I expected and it seems better ar recording that playing.

While recording, though, the are (sometimes) "klick" every 2 sec (but they are
very low in volume).

I will try to use it with some application ("Ekiga" for instance).

On the PSTN side, what is the status of receiving and making calls.

Thanks for your help.

Andrea
Comment 13 Mario Rossi 2006-10-12 12:25:49 UTC
this is the log of using the phone with Ekiga.

Everything worked fine.

What are the "underruns" that are reported? Are they serious warnings?


Oct 12 20:34:12 thinkpad kernel: ************************ OPEN
**********************
Oct 12 20:34:12 thinkpad kernel: snd_au600_playback_open
Oct 12 20:34:12 thinkpad kernel: hwparmas format: 2
Oct 12 20:34:12 thinkpad kernel: snd_au600_hw_playback_params
Oct 12 20:34:12 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:12 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:12 thinkpad kernel: 1
Oct 12 20:34:12 thinkpad kernel: 2
Oct 12 20:34:12 thinkpad kernel: 4
Oct 12 20:34:12 thinkpad kernel: USERS: 1, ARG: 1, STATUS: 0
Oct 12 20:34:12 thinkpad kernel: 5
Oct 12 20:34:12 thinkpad kernel: au600.c: initiating IRQ
Oct 12 20:34:12 thinkpad kernel: 6
Oct 12 20:34:12 thinkpad kernel: 7
Oct 12 20:34:12 thinkpad kernel: 3
Oct 12 20:34:12 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:12 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:12 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:12 thinkpad kernel: 1
Oct 12 20:34:12 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:12 thinkpad kernel: IGNORING it
Oct 12 20:34:13 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:13 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:13 thinkpad kernel: USERS: 1
Oct 12 20:34:13 thinkpad kernel: 1
Oct 12 20:34:13 thinkpad kernel: SWITCHING OFF STREAM!
Oct 12 20:34:13 thinkpad kernel: 4
Oct 12 20:34:13 thinkpad kernel: USERS: 0, ARG: 0, STATUS: 1
Oct 12 20:34:13 thinkpad kernel: 8
Oct 12 20:34:13 thinkpad kernel: 9
Oct 12 20:34:13 thinkpad kernel: au600.c: killing IRQ
Oct 12 20:34:13 thinkpad kernel: -ENOENT IRQ
Oct 12 20:34:13 thinkpad kernel: SWITCHED OFF STREAM!
Oct 12 20:34:13 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:13 thinkpad kernel: USERS: 0
Oct 12 20:34:13 thinkpad kernel: snd_au600_pcm_close
Oct 12 20:34:14 thinkpad kernel: snd_au600_pcm_open
Oct 12 20:34:14 thinkpad kernel: ************************ OPEN
**********************
Oct 12 20:34:14 thinkpad kernel: snd_au600_playback_open
Oct 12 20:34:14 thinkpad kernel: hwparmas format: 2
Oct 12 20:34:14 thinkpad kernel: snd_au600_hw_params
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: 4
Oct 12 20:34:14 thinkpad kernel: USERS: 1, ARG: 1, STATUS: 0
Oct 12 20:34:14 thinkpad kernel: 5
Oct 12 20:34:14 thinkpad kernel: au600.c: initiating IRQ
Oct 12 20:34:14 thinkpad kernel: 6
Oct 12 20:34:14 thinkpad kernel: 7
Oct 12 20:34:14 thinkpad kernel: hwparmas format: 2
Oct 12 20:34:14 thinkpad kernel: snd_au600_hw_playback_params
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: 2
Oct 12 20:34:14 thinkpad kernel: 4
Oct 12 20:34:14 thinkpad kernel: USERS: 2, ARG: 1, STATUS: 1
Oct 12 20:34:14 thinkpad kernel: 3
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:14 thinkpad kernel: IGNORING it
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:14 thinkpad kernel: IGNORING it
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:14 thinkpad kernel: IGNORING it
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:14 thinkpad kernel: IGNORING it
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:14 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:14 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:14 thinkpad kernel: 1
Oct 12 20:34:14 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:14 thinkpad kernel: IGNORING it
Oct 12 20:34:36 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:36 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:36 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:36 thinkpad kernel: 1
Oct 12 20:34:36 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:36 thinkpad kernel: IGNORING it
Oct 12 20:34:49 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:49 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:49 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:49 thinkpad kernel: 1
Oct 12 20:34:49 thinkpad kernel: An underrun occured very likely...
Oct 12 20:34:49 thinkpad kernel: IGNORING it
Oct 12 20:34:53 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:53 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:53 thinkpad kernel: USERS: 2
Oct 12 20:34:53 thinkpad kernel: 1
Oct 12 20:34:53 thinkpad kernel: SWITCHING OFF STREAM!
Oct 12 20:34:56 thinkpad kernel: 4
Oct 12 20:34:56 thinkpad kernel: USERS: 1, ARG: 0, STATUS: 1
Oct 12 20:34:56 thinkpad kernel: SWITCHED OFF STREAM!
Oct 12 20:34:56 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:56 thinkpad kernel: USERS: 1
Oct 12 20:34:56 thinkpad kernel: snd_au600_pcm_close
Oct 12 20:34:56 thinkpad kernel: snd_au600_hw_capture_free
Oct 12 20:34:56 thinkpad kernel: 4
Oct 12 20:34:56 thinkpad kernel: USERS: 0, ARG: 0, STATUS: 1
Oct 12 20:34:56 thinkpad kernel: 8
Oct 12 20:34:56 thinkpad kernel: 9
Oct 12 20:34:56 thinkpad kernel: au600.c: killing IRQ
Oct 12 20:34:56 thinkpad kernel: -ENOENT IRQ
Oct 12 20:34:56 thinkpad kernel: snd_au600_hw_capture_free
Oct 12 20:34:56 thinkpad kernel: snd_au600_pcm_close
Oct 12 20:34:56 thinkpad kernel: ************************ OPEN
**********************
Oct 12 20:34:56 thinkpad kernel: snd_au600_playback_open
Oct 12 20:34:56 thinkpad kernel: hwparmas format: 2
Oct 12 20:34:56 thinkpad kernel: snd_au600_hw_playback_params
Oct 12 20:34:56 thinkpad kernel: snd_au600_prepare
Oct 12 20:34:56 thinkpad kernel: PCM PLAYBACK TRIGGER START!
Oct 12 20:34:56 thinkpad kernel: 1
Oct 12 20:34:56 thinkpad kernel: 2
Oct 12 20:34:56 thinkpad kernel: 4
Oct 12 20:34:56 thinkpad kernel: USERS: 1, ARG: 1, STATUS: 0
Oct 12 20:34:56 thinkpad kernel: 5
Oct 12 20:34:56 thinkpad kernel: au600.c: initiating IRQ
Oct 12 20:34:56 thinkpad kernel: 6
Oct 12 20:34:56 thinkpad kernel: 7
Oct 12 20:34:56 thinkpad kernel: 3
Oct 12 20:34:59 thinkpad kernel: PCM PLAYBACK TRIGGER STOP!
Oct 12 20:34:59 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:59 thinkpad kernel: USERS: 1
Oct 12 20:34:59 thinkpad kernel: 1
Oct 12 20:34:59 thinkpad kernel: SWITCHING OFF STREAM!
Oct 12 20:34:59 thinkpad kernel: 4
Oct 12 20:34:59 thinkpad kernel: USERS: 0, ARG: 0, STATUS: 1
Oct 12 20:34:59 thinkpad kernel: 8
Oct 12 20:34:59 thinkpad kernel: 9
Oct 12 20:34:59 thinkpad kernel: au600.c: killing IRQ
Oct 12 20:34:59 thinkpad kernel: -ENOENT IRQ
Oct 12 20:34:59 thinkpad kernel: SWITCHED OFF STREAM!
Oct 12 20:34:59 thinkpad kernel: snd_au600_hw_playback_free
Oct 12 20:34:59 thinkpad kernel: USERS: 0
Oct 12 20:34:59 thinkpad kernel: snd_au600_pcm_close
Comment 14 Markus Rechberger 2006-10-12 16:11:22 UTC
underrun is caused if the transfer buffer didn't get filled successfully for 
any reason. The Alsa framework is really bad at some points, the messages in 
the log indicate problems yes but they're harmful in the end.
It tries to reinitialize the data transfer, in my case I simply ignore that 
since it just causes problems with the USB framework (as far as I remember it's 
also in interrupt context so that wouldn't allow to clean up the USB transfer)

I haven't fully implemented the ringbuffer, I did some calculation that I get 
around that issue most of the time I'll have a closer look at it when I have 
some more time left again.

Regarding dialing out. it's already possible if you use DTMF tones, incoming 
call detection isn't implemented yet it also requires some more work (which I 
already started actually) As example you could use the DTMF tones of your 
mobile phone and hold it close to the microphone.

Markus
Comment 15 Natalie Protasevich 2008-03-29 23:19:24 UTC
It looks like the bug been resolved, so it can closed.
Was the fix incorporated in the kernel by now?
Thanks.