Author Topic: TiMidity++ AE  (Read 22945 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3473
  • Developer
    • View Profile
    • PaulsCode.Com
Re: TiMidity++ AE
« Reply #15 on: February 10, 2012, 03:27:20 PM »
Oops, my bad.  That JNI_PlaySong method should start like this instead:

Code: [Select]
JNIEXPORT void JNICALL Java_com_xperia64_timidityae_MyActivity_JNI_Play_Song( JNIEnv* env, jclass cls, jstring jFilename )
{
...etc
« Last Edit: February 10, 2012, 07:15:48 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #16 on: February 10, 2012, 07:04:19 PM »
I have decided it will be easier to add the "400 pound gorilla" to my project than to figure out how the stand alone timidity lib works. However, this will allow me to support 32 formats!

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #17 on: February 11, 2012, 03:57:42 PM »
check this makefile if you could. thanks

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #18 on: February 19, 2012, 01:54:53 PM »
Version 0.5a is out. Next step is to (finally) get the native components hooked up.  :)

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #19 on: March 05, 2012, 07:13:18 PM »
Log.

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #20 on: March 07, 2012, 06:13:36 PM »
Status Update: SDL is hooked up, now i just need to figure out how to prevent it from hanging on SDL_Android_Init()

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #21 on: March 10, 2012, 11:23:20 AM »
Update: Audio!  Ogg, wav, flac, and midi files work with it.
So far mp3 doens't want to work but its a start :D
« Last Edit: March 10, 2012, 02:18:40 PM by xperia64 »

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #22 on: March 10, 2012, 06:03:16 PM »
Current Music format compatibility list:
Code: [Select]
Completely working:
*.mid
*.wav
*.669
*.amf
*.dsm
*.far
*.gdm
*.imf
*.it
*.m15
*.med
*.mod
*.mtm
*.okt
*.s3m
*.stm
*.stx
*.ult
*.uni
*.umx
*.psm
*.mt2
*.xm
Partially working:
*.mp3
*.flac
*.ogg
*.aif
All require the audio rate to be set perfectly
Not working:
*.raw
*.pcm
Unknown:
*.spx
*.shn
*.mpg
*.mpeg
*.voc
I plan on writing the frontend and including the formats that work perfectly so i can release it. After release, i will try to write a sample rate reader that will automatically choose the right sample rate
« Last Edit: March 18, 2012, 12:25:26 PM by xperia64 »

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #23 on: March 18, 2012, 12:30:27 PM »

Offline Tom.K

  • Green Team
  • long
  • *
  • Posts: 130
    • View Profile
Re: TiMidity++ AE
« Reply #24 on: March 24, 2012, 05:54:03 AM »
Any chance to use this as an Icon?


Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #25 on: March 24, 2012, 09:30:37 AM »
ill think about it

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #26 on: August 15, 2013, 09:14:36 PM »
For quite a while now I've been wanting to completely redo timidity actually using TiMidity++. However, I can't get it to even compile&output a wav file let alone stream audio to the speakers. If anyone would be willing to help get timidity running let me know.. Once it actually works, it will be fully open source to comply with the license, but I will still charge $0.99.
What needs to be done (that I can't figure out):
Compile timidity as a dynamic or static library.
Write an interface that either uses opensles or preferably write bytes/shorts using android.media.AudioTrack for API<9 compatibility.
Avoid SDL at all costs.

Here are some possible resources I've found so far:
First, obviously the official TiMidity++ library (preferably compile this): http://sourceforge.net/projects/timidity/files/TiMidity%2B%2B/TiMidity%2B%2B-2.14.0/
The original devs usually show up once a year or less so they probably wont be much help. I got it to compile as a dynamic lib but it always crashed in resample.c, even if I tried to force it to not resample.
Second, someone managed to compile timidity as a static lib for the iphone: https://github.com/yoyofr/modizer/tree/master/libtim
Can't find what/where the equivalent of a makefile for xcode is. I asked the dev how he managed to compile it and am waiting for a response.
Third and least preferable option: ftp://ling.lll.hawaii.edu/pub/greg/gt-0.4.tar.gz
Contains an older/simplified version of timidity, designed mainly as a binary file with interfaces missing that existed in TiMidity and full TiMidity++

This has been driving me insane for ages.
Other random notes:
Fluidsynth works and has been incorporated into another app as well, but is a huge processor hog and doesn't support certain soundfonts properly (nails on a blackboard).
The TiMidity++ binary compiled on my pandora will run once all of the libs are copied to the right place and can successfully output wav files. ALSA!=TinyAlsa. Once I get my nexus 7 back, I may be able to pipe the wav file to the tinyplay binary (only available on some devices) for dynamic playback instead of actually saving the file.
« Last Edit: August 15, 2013, 09:18:36 PM by xperia64 »

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #27 on: October 27, 2013, 07:15:28 PM »
Given up on TiMidity++ again for now, but I've encountered a terribly annoying issue with the internal android media player in general:
Code: [Select]
10-27 20:01:57.990: E/MP3Extractor(1805): Unable to resync. Signalling end of stream.It calls setOnCompletitionListener rather than setOnErrorListener making the app think it just played the file properly and should now skip to the next one. Seem to have it mostly under control with a lot of redundancy and Thread.sleep's. I also apparently have to keep the FileInputStream open forever. If anyone has any ideas on how I could fix this, please let me know. My current set up is load file->call proper playback method for that file->change values of variables accordingly->start a thread to constantly check if the player isn't currently loading, was playing, isn't paused, and check the player type (ndk or android mediaplayer) and whether that method is still playing->Change to next song if that is true. For the ndk method I poll whether it is currently playing or not and for the android mediaplayer method I set an onCompletitionListener. For some reason the file skipping occasionally happens with the ndk method too.

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3473
  • Developer
    • View Profile
    • PaulsCode.Com
Re: TiMidity++ AE
« Reply #28 on: October 28, 2013, 08:33:15 AM »
Do you know the cause of the "Unable to resync" error?  I would track that one down first if it is getting your app into a loop where it is skipping track after track and not playing anything (I gathered that was the behavior you were experiencing, correct me if I'm wrong).

As for the process logic, it seems like it should work on a high-level.  That said, personally I would try to hook into callback methods and do the state checks there if at all possible, rather than setting up a thread to poll the states constantly in a loop (it would make the code easier to follow, and you wouldn't have to worry about thread management or a zombie process draining the user's battery when it isn't needed).  I'd have to look at the actual code though, since I am not very familiar with the APIs involved.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline xperia64

  • Developer
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: TiMidity++ AE
« Reply #29 on: October 28, 2013, 02:00:34 PM »
MP3Extractor Unable to resync is just a weird bug with the system android mediaplayer. I'll try to log more.