Welcome, Guest. Please login or register.

Author Topic: MP3@64 stuttering and skipping  (Read 5500 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AmigaNut08Topic starter

  • Jr. Member
  • **
  • Join Date: Jul 2008
  • Posts: 57
    • Show only replies by AmigaNut08
Re: MP3@64 stuttering and skipping
« Reply #14 on: June 10, 2009, 10:17:06 AM »
Quote from: Daedalus;510329
Thanks for that! Yeah, it's the stuttering I'm worried about - I was thinking it could be a factor of DMA timing or something which affects certain A1200 motherboards. The MAS Player uses the same decoding chip as the MP3@64, but like I said in my previous post, just takes a little bit of CPU power to do a serialisation of the data before sending it out the parallel port. It's a shame there's nobody living nearby I could borrow one from to test it :(

DMA timing is what i am thinking also. Remember the timing issues A1200's had when faster cpu cards came out for it. A mod had to be performed on the mobo because of timing issues. I was also unable to get my ethernet adapter to work through the credit card slot as i was told my mobo also needed a mod done because the port would not reset with the given software. I was unable to connect to my router so i ended up selling the ethernet card. Not all A1200's suffer from these above mentioned issues (thank god the Apollo1240 worked as i believe this mobo was modded before i bought it) but knowing my luck i am probably in the minority of people that have had issues like this.

PS: Anyone out there using the MP3@64 in an A1200??
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show only replies by Daedalus
    • http://www.robthenerd.com
Re: MP3@64 stuttering and skipping
« Reply #15 on: June 10, 2009, 11:49:19 AM »
Yeah, there are known issues - and sometimes they only show up for other hardware, so it's possible that the machine is unmodified and works fine without anything on the clock port, but putting something there upsets it. Since I'm running an 030 it may well be better.

BTW, the network card issue is known and there's a software fix for it, should you want to try it again. Worst case scenario, it can be hot unplugged and plugged back in to reset it manually...
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline almasis

  • Newbie
  • *
  • Join Date: Jan 2009
  • Posts: 1
    • Show only replies by almasis
Re: MP3@64 stuttering and skipping
« Reply #16 on: June 10, 2009, 08:44:44 PM »
Hello,

I also use the MP3@64 device on the internal clockport of my A1200, rev1D4, with Apollo 1240/40. I also experience some sound skip when playing back, but only on MP3 with bitrate 192+. Below this bitrate, there is no sound interruption at all. The sound quality is very good. Typical load on CPU during playback is 25-35% with Amplifier.
Regards
Alma
Almasis
---
A1200-1D4, Apollo1240/40 + 32MB RAM, MP3@64, IDEFix Express, Micronik Ext Scandoubler, HD2.5GB, OS3.1
 

Offline espenbo

  • Jr. Member
  • **
  • Join Date: Jun 2009
  • Posts: 70
    • Show only replies by espenbo
Re: MP3@64 stuttering and skipping
« Reply #17 on: June 10, 2009, 10:01:36 PM »
Hello
Do any of you have a picture of how you have installed the mp3@64.
I have bougth the mp3@64 card but I havet def. accellerator card... So i'm waithing for a card from softhut.... Hope it comes soon...

Espen
 

Offline skipp604

  • Newbie
  • *
  • Join Date: Feb 2002
  • Posts: 35
    • Show only replies by skipp604
Re: MP3@64 stuttering and skipping
« Reply #18 on: June 10, 2009, 11:10:47 PM »
Hi,

first thing I would do is to launch Scout, then the player, and check what causes the heavy CPU load.

Hope it helps
 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3645
    • Show only replies by alexh
    • http://thalion.atari.org
Re: MP3@64 stuttering and skipping
« Reply #19 on: June 10, 2009, 11:57:13 PM »
Quote from: Daedalus;510326
all the data has to be converted in software to serial for the I2C bus that the MAS chip requires.
MP3's down a 1-bit serial interface? I'm not sure what the Amiga parallel port is capable of, but I would imagine you could pre-process your MP3's into I2C files you can DMA.

For a fixed rate MP3 that could be 192Kbaud, what is the maximum rate of the Amiga parallel port?
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show only replies by Daedalus
    • http://www.robthenerd.com
Re: MP3@64 stuttering and skipping
« Reply #20 on: June 11, 2009, 12:18:08 AM »
Yeah, you probably could pre-process them, but that low level of stuff is kinda beyond me - once you start that you can't use the MHI driver and have to do all the timing and interrupts yourself, and I wanted it to be able to accept standard MP3 files from CF cards etc.

The parallel port itself is able to do it speed-wise for 192kbps files anyway, I don't have any trouble with that here. Possibly something to do with the clever trick the player does in clocking data on the leading and falling edge of the signal, thus saving half the number of pulses...
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline platon42

  • Hero Member
  • *****
  • Join Date: Jul 2002
  • Posts: 573
    • Show only replies by platon42
    • http://www.platon42.de/
Re: MP3@64 stuttering and skipping
« Reply #21 on: June 11, 2009, 09:37:59 AM »
Quote from: AmigaNut08;510176

- Sometimes the sound is interrupted for a short period. Seems to be a  bug
  in  the  timer.device  that  sometimes causes interrupts to be delayed. I
  tried very small intervals, but it still remained, so I guess it's either
  a bug in timer, or the system interrupt load causes high latencies.


I might elaborate more on these problems. The original MAS Player by Dirk Conrad uses the parallel port to both send I2C commands and serially clocked mp3 data to the MAS-Chip (bitwise!). The first, old version even required two bits to send out one bit of MP3 data. Due to the internal parallel port being custom chipset register space, it is rather slow to access this space (like chipram).

The MAS Chip itself has a buffer of about 1 KB, if I remember it correctly. It has a pin that will report when the buffer is getting full and the sender should stop transmitting data, I think I may send up to ~250 bytes after this pin has changed. Unfortunately, the MAS Player design is a bit flawed in the sense that the change of the buffer full line is not connected to the _ACK pin that would allow interrupt driven data transfer. Instead, I have to constantly track the signal level of this pin before sending more data (I do this every ~250 bytes).

Due to VBR and the internals of this chip, it makes it hard to estimate the rate at which the buffer full line needs to be checked to avoid buffer underflows. I really tried a lot of different techniques, but in the end, I just had to make sure that the line is checked often enough and the current implementation uses a sliding interval that automatically adapts to the rate of the MP3. But this means that the driver causes many interrupts per second, thus requiring some CPU time (that you're unable to measure with Scout and such).

Now, let's look at the MP3@64. This device was designed to be operated in the C64 with Jens' custom build clockport there. Unlike the MAS Player, I can send the serial data bytewise, not bitwise, which would actually be much better, if not... well, the MP3@64 streams the bytewise data to the MAS Chip serially, *just like the MAS Player* and it uses a timing that the C64 is slow enough to write one byte after another without disturbing the serial transfer that is done by the logic in the background.

The Amiga however, is much faster. So while I had to write out the data bitwise to the parallel port on the MAS Player, I can write a full byte in one go, *but then I have to wait for a while* before I can send the next byte. Of course this wait is so short that it doesn't make sense to release the CPU to do something else. Hence, the MP3@64 needs more or less the same CPU time as the MAS Player.

And finally, the MP3@64 also doesn't connect the buffer full line to the interrupt 6 pin of the clockport, hence the polling of the overflow line is also the same there with the same problems described above.

Hence, you will need some CPU time to operate the MP3@64 or MAS Player, and the stutter will be less if you've got a faster CPU. You probably shouldn't be using high frequency interrupt sources like the internal serial port at the same time.

The stutter probably will be gone if somebody rewrites the interrupt code not to use the timer.device (more system conform), but the CIA chips directly. Jens has the code of the device, if I remember it correctly.
--
Regards, Chris Hodges )-> http://www.platon42.de <-(
hackerkey://v4sw7CJS$hw6/7ln6pr7+8AOP$ck0ma8u2LMw1/4Xm5l3i5TJCOTextPad/e7t2BDMNb7GHLen5a34s5IMr1g3/5ACM
 

Offline platon42

  • Hero Member
  • *****
  • Join Date: Jul 2002
  • Posts: 573
    • Show only replies by platon42
    • http://www.platon42.de/
Re: MP3@64 stuttering and skipping
« Reply #22 on: June 11, 2009, 09:44:55 AM »
Quote from: alexh;510486
MP3's down a 1-bit serial interface? I'm not sure what the Amiga parallel port is capable of, but I would imagine you could pre-process your MP3's into I2C files you can DMA.

For a fixed rate MP3 that could be 192Kbaud, what is the maximum rate of the Amiga parallel port?


There's no DMA to the parallel port or serial port. Check your hardware documentation ;) The only DMA you could try would be audio (which is rather useless, as it's analogue) or disk (which might work, but then again, the data rate is pretty low here).

Moreover, the mp3 data is not sent via I2C. Only the control commands are send via I2C (such as volume control).

On the other hand, something probably hardly anybody knows: One CIA is used for barrel-shifting serial data from the keyboard. The second CIA also has this barrel-shifter (bidirectional) and it is connected to some lines on the parallelport. I'm fairly confident that this parallel to serial converter could have been used in the MAS Player design to speed up things, but unfortunately, it wasn't.
--
Regards, Chris Hodges )-> http://www.platon42.de <-(
hackerkey://v4sw7CJS$hw6/7ln6pr7+8AOP$ck0ma8u2LMw1/4Xm5l3i5TJCOTextPad/e7t2BDMNb7GHLen5a34s5IMr1g3/5ACM
 

Offline platon42

  • Hero Member
  • *****
  • Join Date: Jul 2002
  • Posts: 573
    • Show only replies by platon42
    • http://www.platon42.de/
Re: MP3@64 stuttering and skipping
« Reply #23 on: June 11, 2009, 09:46:04 AM »
Quote from: Daedalus;510491
The parallel port itself is able to do it speed-wise for 192kbps files anyway, I don't have any trouble with that here. Possibly something to do with the clever trick the player does in clocking data on the leading and falling edge of the signal, thus saving half the number of pulses...


The trick with the rising and falling edge is exactly the difference between the normal and the later, Pro version of the MAS Player.
--
Regards, Chris Hodges )-> http://www.platon42.de <-(
hackerkey://v4sw7CJS$hw6/7ln6pr7+8AOP$ck0ma8u2LMw1/4Xm5l3i5TJCOTextPad/e7t2BDMNb7GHLen5a34s5IMr1g3/5ACM
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show only replies by Daedalus
    • http://www.robthenerd.com
Re: MP3@64 stuttering and skipping
« Reply #24 on: June 11, 2009, 09:53:01 AM »
Thank you Chris for that good, concise explanation. It seems that there wouldn't be much benefit for me to switch to the MP3@64. Do you know why the interrupt isn't used? Or if it might be possible to modify the MP3@64 or the MAS player to use it? I guess then it would also need a new MHI library...

I am hoping to be able to use the internal serial port with my project, but it can be run at low speed (9.6k should be enough) as it's only used to update an LCD display and maybe receive IR remote codes in the future, so I don't think the interrupt load will be too high. If it is, do you think that could be improved by switching to the MP3@64?
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3645
    • Show only replies by alexh
    • http://thalion.atari.org
Re: MP3@64 stuttering and skipping
« Reply #25 on: June 11, 2009, 07:41:07 PM »
Interesting stuff... didnt know there was no DMA to parallel port. Damn that's a bit of an oversight. I am sure there must be a technological reason why not.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: MP3@64 stuttering and skipping
« Reply #26 on: June 11, 2009, 08:34:45 PM »
Quote from: alexh;510652
Interesting stuff... didnt know there was no DMA to parallel port. Damn that's a bit of an oversight. I am sure there must be a technological reason why not.

A floppy port interface should at least be support DMA transfers from chip memory to whatever was dangling off the end of it. Not sure how easily it could be implemented though as the hardware will use MFM encoding.

-edit-

I see Chris beat me to it :)
int p; // A
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MP3@64 stuttering and skipping
« Reply #27 on: June 11, 2009, 08:39:33 PM »
Quote from: Karlos;510661
A floppy port interface should at least be support DMA transfers from chip memory to whatever was dangling off the end of it. Not sure how easily it could be implemented though as the hardware will use MFM encoding.

-edit-

I see Chris beat me to it :)


The Amiga did no MFM encoding in hardware! IIRC that was all done by the trackdisk.device (Some one really should write a trackdisk.device with 8b/10b encoding):)

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: MP3@64 stuttering and skipping
« Reply #28 on: June 11, 2009, 08:51:14 PM »
Quote from: bloodline;510663
The Amiga did no MFM encoding in hardware! IIRC that was all done by the trackdisk.device (Some one really should write a trackdisk.device with 8b/10b encoding):)


Hmm, I thought there was something in Paula that did it. It's been a long time since I looked at this stuff :)

Assuming there is no hardware MFM, then even better. One less thing to worry about on the device end. You've got a DMA driven serial port that should be able to shift data at a high enough bitrate for a lot of mp3s...
int p; // A
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: MP3@64 stuttering and skipping
« Reply #29 from previous page: June 11, 2009, 08:59:35 PM »
Quote from: Karlos;510667
Hmm, I thought there was something in Paula that did it. It's been a long time since I looked at this stuff :)

Assuming there is no hardware MFM, then even better. One less thing to worry about on the device end. You've got a DMA driven serial port that should be able to shift data at a high enough bitrate for a lot of mp3s...


Without meaning to disparage the old lady (25years isn't old!!!), she was a simple little beast... but that is why she was so flexible... I think the amiga could even read the weird Mac disk encoding schemes, with the right software... Näturlich...