Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: fml2 on August 16, 2006, 02:30:06 AM

Title: H100: Initialization of the FM radio
Post by: fml2 on August 16, 2006, 02:30:06 AM
Hello,

I asked this yesterday in IRC but got no reply. Maybe here more eyes will see it.

Does the FM radio need a special initialization? I tried to set up FM screen after startup by calling radio_screen() in tree.c (where auto resume is checked). The FM screen shows up but there's no sound. I use iriver H1xx.

I saw that in the menu, the radio is also activated by calling radio_screen(). But that doesn't work right after start up. Any ideas?

Thanks!
Title: Re: Initialization of the FM radio
Post by: LinusN on August 16, 2006, 03:02:50 AM
Could it be that the audio setup is deferred nowadays, and you call radio_screen() before the audio init is done?
Title: Re: Initialization of the FM radio
Post by: fml2 on August 16, 2006, 03:09:14 AM
Could it be that the audio setup is deferred nowadays, and you call radio_screen() before the audio init is done?

Yes, that's what I think. But I wasn't sure since I don't know RockBox well. Do you mean that after switching on some activities (audio setup) are completed in the background by a special thread? Or is a check ('has audio been initialized') made just before activating playback? Because auto resume is called without anything special being done before.
Title: Re: Initialization of the FM radio
Post by: petur on August 16, 2006, 07:15:08 AM
Yes, some init stuff is being done in the background. Don't know the details, sorry...
Title: Re: Initialization of the FM radio
Post by: fml2 on August 16, 2006, 07:50:53 AM
Yes, some init stuff is being done in the background. Don't know the details, sorry...

Thanks for the confirmation. I'll try to dig into it then. Maybe a sleep for a second or two will help thus allowing the background thread to finish its work. He-he... Poor man's solution :-)
Title: Re: Initialization of the FM radio
Post by: fml2 on August 16, 2006, 02:47:31 PM
Maybe a sleep for a second or two will help

Hey, that did indeed help!