flat assembler
Message board for the users of flat assembler.

flat assembler > Linux > Manipulating internal speaker

Author
Thread Post new topic Reply to topic
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
How to manipulate(turn on/off) the internal speaker of PC in the Linux?
Post 21 Feb 2009, 16:19
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 212
Location: Budapest, Hungary
For programming internal speaker see e.g. this document.
Post 22 Feb 2009, 12:46
View user's profile Send private message Reply with quote
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
Sorry. But that document is not for assembler.
Post 23 Feb 2009, 14:57
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 212
Location: Budapest, Hungary
Excuse me I just thought you're a bit more adept. Can you tell us how far you got in assembly programming on Linux? Dependent upon your knowledge we may provide you hints on different levels.
Post 24 Feb 2009, 09:59
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Maybe not what you want, but you could just as easy use the sound driver
http://asm.sourceforge.net/articles/audio.html
Post 24 Feb 2009, 17:38
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
That does look good... I'm going to print it, and read when the power goes out Smile
Post 24 Feb 2009, 23:17
View user's profile Send private message Visit poster's website Reply with quote
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
I am new in assembler(consequently also in Linux assembler Smile). I decided to learn assembler two weeks ago(do not laugh Smile) and because I like GNU/Linux I also want to learn it for Linux... But all books those I have found written for MS DOS and Windows(mostly for DOS with TASM or MASM syntax). In order to don't lose expensive time I decided to learn assembler simultaneously both for DOS(Windows) and for Linux. I have chosen one good book for me and started to port all examples from DOS(with TASM syntax) to Linux(with FASM syntax)... But one example shows how to manipulate internal speaker in MS DOS and I don't found any article that shows it for Linux. So I decided to get help from one of the bigest forums in the internet...
About article given by Dex4u: I think that it is good article(unfortunately not for ALSA) and may be I use it in the future. Thank you.
Post 25 Feb 2009, 09:59
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 212
Location: Budapest, Hungary
What system do you have? I mean, 32-bit or 64-bit?
Post 27 Feb 2009, 10:01
View user's profile Send private message Reply with quote
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
intel p4 32bit
opensuse 11.0 Linux kernel updated to 2.6.28
Post 28 Feb 2009, 09:13
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
Hello,
you can try with functin 101 ( SYS_IOPERM) to set Input/Output
permission,then use standard internal speaker port (Low Level),
i don't know if there are prepackage system function for that.

_________________
Nil Volentibus Arduum Razz
Post 28 Feb 2009, 14:38
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 212
Location: Budapest, Hungary
DarkLight, I created a little code which demonstrates you how to drive internal speaker on linux. Since fasm's preprocessing capabilities are rather inconvenient for this task I wrote everything for gnu assembler (don't be afraid in intel syntax). I hope it does not disturb you despite the fact that we're just here on the fasm forum. Of course you can translate the code into fasm syntax if you wish, but in this case you have to look up each constant in the header files and to define them manually in your fasm source. Theorethically you can even debug this snippet if you compile it with '-g' as stated in the comment. You must run the program with root privilegies, otherwise you will get an error message about your missing rights.


Description:
Download
Filename: speaker.tar.bz2
Filesize: 1.2 KB
Downloaded: 117 Time(s)

Post 28 Feb 2009, 20:44
View user's profile Send private message Reply with quote
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
Thank you very much !
I never forget your goodness to me.
Post 01 Mar 2009, 18:21
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.