Click Here
home features news forums classifieds faqs links search
6155 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
22 crawler(s) on-line.
 95 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!

/  Forum Index
   /  Amiga Development
      /  Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Register To Post

PosterThread
Wanderer 
Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 9:29:36
#1 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

Hello All!

The ahi.device seems to have a (conceptual?) bug when you try to record audio data.
No program (except 2 of mine, see below) to my knowledge uses the ahi.device for recording, so no one ever realized this.
(please don't start to list programs were you _guess_ they use ahi.device, they all use the library interface which works fine).

I used the ahi.device to add recording to the Amiblitz3 Include-Runtime and wrote a tool called "ScreenCam" using it. Also "Samplemanager" uses it.

The bug is that there are drop outs from time to time (i.e. once in 5-10 secs), were the consecutive buffers do not seemlessly fit. Some audio inbetween is lost.
The best way to make this audible is to record a continuous whisteling for 10 secs. You will notice some clicks in between.

Is there anybody out there who has the interest, skills and spare time to fix this bug?

I can provide a demo app (source + 68k) that shows the bug, or you can use Samplemanagers' recording functions (yes, the GUI is not really cool, but the prog is quite old, so forgive me...)

Of course it is possible that I made a mistake, but I have tried it losts of times, variations etc. and compared it to the example found in ahidev SDK. Nothing helped, so even if it is my mistake, the Docu needs be updated.

I also wrote above "conceptual" bug, because if you read the docu, it doesn't make really sense. You should add a new I/O Request after the previous request has returned. No double buffering. So I wonder what happens with the audio between two buffers. Is there an internal buffer? But how can ahi know how much time I loose between two I/O Requests?

I hope this attempt to get this fixed has more impact than my last one...
This is the major show-stopper that prevents me from producing Tutorial Videos for Amiblitz3, HD-Rec and other programs.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Hypex 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 10:04:29
#2 ]
Elite Member
Joined: 6-May-2007
Posts: 11351
From: Greensborough, Australia

@Wanderer

Does this happen for all sorts of hardware? Or is it mostly noticable on an A1 and an SB5.1? Like mine.

Now you know what trouble I had, in reverse, programming The Maestrix! I kept getting drop outs, bug reports on drop outs and just gave up trying to fix it.

This could be due to the crappy A1 PCI interface not being able to communicate using proper DMA with the soundcard. Or the AHI hardware driver not using proper hardware acceleration, if any. Again. I'm assuming things here, because these are A1 problems. You did mention 68k!

 Status: Offline
Profile     Report this post  
Georg 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 10:48:23
#3 ]
Regular Member
Joined: 14-May-2003
Posts: 457
From: Unknown

@Wanderer

In AHI sources in AHI/Device/devcommands.c:

Check FeedReaders() and FillReadBuffer() functions in there. One suspicious thing is that FeedReaders() loops through the ReadList in a possibly unsafe way because the call to
FillReadBuffer() may remove/reply the current ioreq and then the next loop's ioreq (ln_Succ) may be bogus.

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 11:01:58
#4 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Hypex

I assume it happens on all HW.

In my case it is WinUAE with the 16bit AHI driver.
I assume so, because the library interface (which uses the actual driver code) works perfectly fine. I assume the device code uses the library code. So the bug must be in the device code, which is already abstracted from the HW.

If you look at the AHI docu and the recording example, it appears very questionable to me that this can potentially work at all in a clean way.

@Georg
Thanks for this information.
As I have already too many Amiga Projects going on, I hesitate to "dive" into the ahi code and make changes. That's why I am asking for direct help on coding-level.

Last edited by Wanderer on 13-Jul-2010 at 11:04 AM.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Georg 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 11:30:10
#5 ]
Regular Member
Joined: 14-May-2003
Posts: 457
From: Unknown

@Wanderer

Quote:
I hesitate to "dive" into the ahi code


The amount of code which handles recording seems very small (you would hit your head if you tried to dive):

http://svn.berlios.de/wsvn/arp2/ahi/ahisrc/branches/BRANCH_6/Device/devcommands.c

ReadCmd(), FeedReaders(), FillReadBuffer(). Not much else.

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 14:17:40
#6 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Georg

The "install-gcc-and-get-the-AHI-code-to-compile&link-into-a-working-AmigaOS-device" part of the "dive into" is what makes me hesitate.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Deniil715 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 14:55:42
#7 ]
Elite Member
Joined: 14-May-2003
Posts: 4248
From: Sweden

@Wanderer

I'm quite sure I use ahi.device for recording in one program. I remember it was strange to get it working right without clicks and gaps but I think I made it work. Can't remeber how now but IIRC the first buffer is somehow delayed and buffered in AHI or the soundcard itself which in reality creates a double-buffer even if it doesn't look like that in the code.

I'll have to check at home to be sure though...

And of course, it's all simplex - no recording and playing at the same time I solved that by recording on the built-in AC97 chip and playing on the PCI card I have.

Last edited by Deniil715 on 13-Jul-2010 at 02:57 PM.

_________________
- Don't get fooled by my avatar, I'm not like that (anymore, mostly... maybe only sometimes)
> Amiga Classic and OS4 developer for OnyxSoft.

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 15:04:24
#8 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Deniil715

The drop outs are not that obvious. But for serious use, this is not acceptable.
Any chance to try out your program on WinUAE? This way I could make sure that it is not my mistake, unless we both have made the same one, which is unlikely.

Is anyone able to see this bug using Samplemanager?

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Valiant 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 18:16:00
#9 ]
Super Member
Joined: 21-Oct-2003
Posts: 1117
From: West of Eden, VT USA

@Wanderer

I've never seen it in all the time I've used Samplemanager, but admittedly I haven't used it much recently.

_________________
--
-=#Val#=-
Valiant@Camelot


Amiga 1000; Amiga 2000; Amiga 3000T; CD-TV; CD32;
AmigaOne-XE 800Mhz G4;Sam400ep 666Mhz;
AmigaOne X-1000 1.8Ghz PA6T-1682M

 Status: Offline
Profile     Report this post  
Psycreator 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 19:04:49
#10 ]
Regular Member
Joined: 15-Nov-2007
Posts: 162
From: Unknown

@Wanderer
As far as I remember when I had the old Amiga 4000T with Midi running, the problem with recording and those drop outs became even worster when I hammered the Serial Bus with more Data, that'S why I sold the old 68k, not fast enough and timing was not so good even with lot's of cache inside AHIRecord.
Now I must say it became a little bit better with recording of Audio, together with Midi running I don't know course there is no software which works at the moment and USB Camd Drivers crash the system sometimes or more often...
There must be something inside that stops the other program to work correct. Only my thought about it now.


 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 13-Jul-2010 19:54:19
#11 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Psycreator

My concern here is the ahi.device in general, not a specific driver/HW, and not the library interface that is used by almost all programs (E.g. AHIRecord).

"So go and use the library interface then" you might say. I have done this in HD-Rec, so I know how to do it but for several reasons I want to use the ahi.device.

* it is there and relatively easy to use, a shame if it contains such obvious bugs (I assume all Platforms, AROS, MOS, OS3 and OS4 are affected)

* the device access is not exclusive, so other programs can use it too. Well, at least this is the idea of a device, I haven't tried it. I dont know how clean AHI is implemented. The way how you should pass the IORequest doesn't give a good impression.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 15-Jul-2010 14:28:22
#12 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

Bump!

Nobody here who feels responsible to fix the ahi.device?

Such an important OS4, OS3, MOS and AROS component and it is broken, hey!

This is how it sounds like.

And this is how it looks like (typical digital dropout, not an analog phenomenon):

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
itix 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 15-Jul-2010 16:41:08
#13 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

@Wanderer

I think nobody is using Amiga for recording. I dont even know if my Efika or Mac have HW support for recording.

I once thought about adding audio recording support to my Screen Recording utility but I think there are better methods...

You could try contacting Martin Blom. Maybe he still develops AHI.

_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 15-Jul-2010 20:50:13
#14 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@itix

Yes, I want to have it for my ScreenRecording Utility too.
It is pretty useless for tutorials if you cannot comment what you are doing...
If I record now, it is quite a pain to listen to the audio with all the drop outs. Sometimes a whole word is missing.
And because I want to record what audio is produced too, I need the device interface.

But someone mentioned that ahi.device does not support full duplex? How come?
The Library interface supports full duplex. The device part must be really crappy designed then.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Psycreator 
Re: Recording via ahi.device seems to be broken, anyone feels itchy to fix it?
Posted on 16-Jul-2010 0:35:52
#15 ]
Regular Member
Joined: 15-Nov-2007
Posts: 162
From: Unknown

@Wanderer

The same story I allso got many times like on that picture. Mostly when doing Midi stuff and record it on the same Hardware. Only recording without any other Audio apps running is ok. Perhabs there is an timer error somewhere when many apps share to the same internal clock, timer.device or whatever to syncronise and calculate the correct frequencies.
But the bug is inside AHI, that'S true course it has nothing to do with CPU Power, I rarly hit 10% CPU time even if I use 50+ Midi channels at once, time for an AHI Update I think ;)


 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle