Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#117238 - 21/09/2002 09:01 Disable serial port in config.ini
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Could we get an option in config.ini to stop the player from hogging the serial port? I might finally get my GPS compass written then!
_________________________
Cheers,

Andy M

Top
#117239 - 21/09/2002 12:50 Re: Disable serial port in config.ini [Re: andym]
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
supress_notify=1?

Top
#117240 - 21/09/2002 14:35 Re: Disable serial port in config.ini [Re: image]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
I think he means to prevent the Player app from having exclusive control over the serial port while it's running (which prevents a third-party app from making use of the serial port without first terminating the player app).

Wasn't there already a way to work around this? I thought Kim's project already handled this situation.
_________________________
Tony Fabris

Top
#117241 - 21/09/2002 15:36 Re: Disable serial port in config.ini [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Doesn't starting the player with the `-s-' option do that? I think other folks talked about that here before, but it's not listed in the ``Player Command Line Arguments'' section of the Player App section of Developer Info on riocar.org.

If so, then moving the player app to a different file and replacing the original filename with a script like:
#!/bin/sh

player.new -s- "$@"
should do the trick, I think (read the postscript below).

Edit: It's "-s-", not "-s" (fixed it above), and, apparently, my idea doesn't work. Check out this thread.


Edited by wfaulk (21/09/2002 15:45)
_________________________
Bitt Faulk

Top
#117242 - 21/09/2002 15:43 Re: Disable serial port in config.ini [Re: wfaulk]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
Looking in the programming forum, the switch might actually be -s-.

/Michael
_________________________
/Michael

Top
#117243 - 22/09/2002 03:48 Re: Disable serial port in config.ini [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
I think a config.ini option is the best way to get it working, is there an official wish list this can get added to? I doubt it's a serious mod anyway.
_________________________
Cheers,

Andy M

Top
#117244 - 22/09/2002 11:17 Re: Disable serial port in config.ini [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I don't mean to be a naysayer, but you're going to have to modify the init (or something) in order to get your GPS compass to work anyway, right?

At the same time, I doubt that it would be a significant modification, but that doesn't necessarily mean that they'll do it. It's their baby, after all.
_________________________
Bitt Faulk

Top
#117245 - 22/09/2002 13:16 Re: Disable serial port in config.ini [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
I'm not really a Linux-head so I'm limited by my knowledge. All I do know is the renaming of the player and using a shell script to launch the player screws hijack up. So really it's either needs to be a mod in the player app or Mark needs to see why the renaming of the player binary stops Hijack from being able to read the config.ini file. Unless someone knows of another way..... anyone? anyone? bueller?
_________________________
Cheers,

Andy M

Top
#117246 - 22/09/2002 13:37 Re: Disable serial port in config.ini [Re: andym]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
The reason HiJack isn't able to read the config.ini when the player is renamed is that it check's for the name of the process that tries to read config.ini and only reads it itself if that name is the name of the player binary.
Solution: Don't rename the player binary, but move it to a different directory. After that, your script needs to chdir to that directory and start the player from there.
Other solution: Rename/replace the init script instead of the player app. The script doesn't do very complicated things anyway, just mounts the partitions, starts the player app in a loop. In that loop, it also starts a shell of the player exits with a certain return/exit level. (See the developer section on riocar.org for more details).

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#117247 - 22/09/2002 13:54 Re: Disable serial port in config.ini [Re: smu]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Thanks Sven! I'll give that a go tomorrow. GPS here I come!!!
_________________________
Cheers,

Andy M

Top
#117248 - 22/09/2002 19:48 Re: Disable serial port in config.ini [Re: andym]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
I did this in the thread that Bitt linked to earlier and had no success though. I will definitely be interested in a solution though.

Now that I have sourced an empeg tuner, I have to get my Alpine CD changer software/hardware interface to work properly, which requires talking to the serial port. Also have that GPS... hmmm I'm out of serial ports .
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#117249 - 23/09/2002 08:05 Re: Disable serial port in config.ini [Re: Shonky]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Along with the gps app I wrote there is a tiny little program (hack_init) that succesfully hacks the init binary to start a wrapper instead of the real player app. It adds the -s- flag to the arguments when it notices that the player is booted in the car. It works for me, otherwise I wouldn't have been able to
get the GPS output in the first place.
_________________________
40GB - serial #40104051 gpsapp

Top
#117250 - 23/09/2002 12:38 Re: Disable serial port in config.ini [Re: jaharkes]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
That sounds cool, does Hijack still work after this mod has been done?
_________________________
Cheers,

Andy M

Top
#117251 - 23/09/2002 15:28 Re: Disable serial port in config.ini [Re: andym]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Ehh, it should. The player is exec'd with the full name that hijack expects /empeg/bin/player. I need hijack anyway to display the graphics, but I'm not using any of the @AC or whatever modifiers in config.ini.
_________________________
40GB - serial #40104051 gpsapp

Top
#117252 - 23/09/2002 15:56 Re: Disable serial port in config.ini [Re: jaharkes]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Brilliant! That's what I'll use then. Thanks ever so!
_________________________
Cheers,

Andy M

Top
#117253 - 24/09/2002 04:13 Re: Disable serial port in config.ini [Re: smu]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
In reply to:

Solution: Don't rename the player binary, but move it to a different directory. After that, your script needs to chdir to that directory and start the player from there.




Could someone tell me how to write this in a script? when I type chdir it says command not found.
_________________________
Cheers,

Andy M

Top
#117254 - 24/09/2002 06:03 Re: Disable serial port in config.ini [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
The command is ``cd''. Let us know what other help you might need.
_________________________
Bitt Faulk

Top
#117255 - 24/09/2002 07:19 Re: Disable serial port in config.ini [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Okay, I've copied the chmodded the player app into a directory called 'noserial' inside /empeg/bin. Currently my script looks like this:

#!/bin/bash
cd /empeg/bin/noserial/
player -s-


The player says it can't find the file called 'player'
_________________________
Cheers,

Andy M

Top
#117256 - 24/09/2002 08:15 Re: Disable serial port in config.ini [Re: andym]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
./player -s-

Current directory isn't normally part of $PATH
Also make sure it's executable.

/Michael
_________________________
/Michael

Top
#117257 - 24/09/2002 09:32 Re: Disable serial port in config.ini [Re: mtempsch]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
it still doesn't work. Once I run the player script I get a load of this...

[hijack] ERROR: : "no memory"
/empeg/bin/player: /empeg/bin/noserial/: is a directory
kmalloc: Size (262873) too large
hijack: no memory for parsing config.ini; skipped

[hijack] ERROR: : "no memory"
/empeg/bin/player: /empeg/bin/noserial/: is a directory
kmalloc: Size (262873) too large
hijack: no memory for parsing config.ini; skipped

[hijack] ERROR: : "no memory"
VM: killing process player
buffermem : 331776
page_cache_size : 81
nr_free_pages : 90
num_physpages : 4096
/empeg/bin/player: line 2: 177 Killed /empeg/bin/noserial/
VM: killing process player
buffermem : 331776
page_cache_size : 81
nr_free_pages : 91
num_physpages : 4096
/empeg/bin/player: line 3: 178 Killed player -s-

What am I doing wrong?
_________________________
Cheers,

Andy M

Top
#117258 - 24/09/2002 11:54 Re: Disable serial port in config.ini [Re: andym]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
That won't work, believe me I tried that at first as well.
First of all, as others reported earlier on the BBS /bin/init cannot exec shell scripts, only binaries. So whatever it starts it better be a compiled program.
Second, hijack explicitly matches on /empeg/bin/player, that is the only executable on the system that will see a modified config.ini file.
That's why I wrote hack_init for my gps application.
_________________________
40GB - serial #40104051 gpsapp

Top
#117259 - 24/09/2002 14:04 Re: Disable serial port in config.ini [Re: jaharkes]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Thanks Yan, I'll download your stuff and use hack_init.
_________________________
Cheers,

Andy M

Top
#117260 - 25/09/2002 19:57 Re: Disable serial port in config.ini [Re: jaharkes]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Shouldn't need to hack init: Hijack looks for /sbin/hijack before init during startup..


Top