flat assembler
Message board for the users of flat assembler.

Index > Linux > Manipulating internal speaker

Author
Thread Post new topic Reply to topic
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
DarkLight 21 Feb 2009, 16:19
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: 215
Location: Budapest, Hungary
Endre 22 Feb 2009, 12:46
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
DarkLight 23 Feb 2009, 14:57
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: 215
Location: Budapest, Hungary
Endre 24 Feb 2009, 09:59
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
Dex4u 24 Feb 2009, 17:38
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
Coddy41 24 Feb 2009, 23:17
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
DarkLight 25 Feb 2009, 09:59
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: 215
Location: Budapest, Hungary
Endre 27 Feb 2009, 10:01
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
DarkLight 28 Feb 2009, 09:13
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
DJ Mauretto 28 Feb 2009, 14:38
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: 215
Location: Budapest, Hungary
Endre 28 Feb 2009, 20:44
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: 711 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
DarkLight 01 Mar 2009, 18:21
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.