LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-13-2005, 07:44 AM   #1
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
alsa with libsdl


So i want to get everything working with alsa so i can listen to music while playing supertux or stuff like that. I've got alsa working great, i've already set all the programs that support alsa to use alsa (xmms, vlc...). Now i want to get sdl support with alsa. So i have downloaded libsdl1.2debian-alsa and have it set up but when i try using:
Code:
export SDL_AUDIODRIVER=alsa
export AUDIODEV=default
#export SDL_PATH_DSP=/dev/dsp0
export SDL_DSP_NOSELECT=0
when starting up an app (nwn, supertux...) i just get the same effect as if it were oss. Blocks my sound card or no sound at all if i'm using xmms (i just pause it to test it). How am i supposed to get sdl with alsa? Where have i gone wrong?
I've been testing and if i start up with libsdl1.2debian-alsa and the code above i get no error message and no sound (supertux), but if i use libsdl1.2debian-all i get the following error:
Code:
Warning: I could not set up audio for 44100 Hz 16-bit stero.
The Simple DirectMedia error that occured was:
No available audio device
My ~/.asoundrc is currently:
Code:
pcm.ossmix {
    type dmix
    ipc_key 1024          # must be unique!
    slave {
        pcm "hw:0,0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 1024  # must be power of 2
        buffer_size 8192  # dito. It
        #format "S32_LE"
        #periods 128      # dito.
        #rate 8000        # with rate 8000 you *will* hear, 
                          # if ossmix is used :)
    }

# bindings are cool. This says, that only the first
# two channels are to be used by dmix, which is enough for
# (most) oss apps and also lets multichannel chios work 
# much faster:

    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
pcm.dsp0 {
    type plug
    slave.pcm "ossmix"     # use our new PCM here
}
# mixer0 like above
ctl.mixer0 {
    type hw
    card 0
}
and it works great using 2 alsa sources. I've set the permissions on it to 666. Anyone know what could be wrong or what i am doing wrong? Thanks.
 
Old 04-11-2005, 10:35 AM   #2
t3gah
Member
 
Registered: Dec 2004
Distribution: SuSE, RedHat, ubuntu, Debian
Posts: 734

Rep: Reputation: 30
Re: alsa with libsdl

Quote:
Originally posted by bobbens
So i want to get everything working with alsa so i can listen to music while playing supertux or stuff like that. I've got alsa working great, i've already set all the programs that support alsa to use alsa (xmms, vlc...). Now i want to get sdl support with alsa. So i have downloaded libsdl1.2debian-alsa and have it set up but when i try using:
Code:
export SDL_AUDIODRIVER=alsa
export AUDIODEV=default
#export SDL_PATH_DSP=/dev/dsp0
export SDL_DSP_NOSELECT=0
when starting up an app (nwn, supertux...) i just get the same effect as if it were oss. Blocks my sound card or no sound at all if i'm using xmms (i just pause it to test it). How am i supposed to get sdl with alsa? Where have i gone wrong?

I've been testing and if i start up with libsdl1.2debian-alsa and the code above i get no error message and no sound (supertux), but if i use libsdl1.2debian-all i get the following error:
Code:
Warning: I could not set up audio for 44100 Hz 16-bit stereo.
The Simple DirectMedia error that occured was:
No available audio device
My ~/.asoundrc is currently:
Code:
pcm.ossmix {
    type dmix
    ipc_key 1024          # must be unique!
    slave {
        pcm "hw:0,0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 1024  # must be power of 2
        buffer_size 8192  # dito. It
        #format "S32_LE"
        #periods 128      # dito.
        #rate 8000        # with rate 8000 you *will* hear, 
                          # if ossmix is used :)
    }

# bindings are cool. This says, that only the first
# two channels are to be used by dmix, which is enough for
# (most) oss apps and also lets multichannel chios work 
# much faster:

    bindings {
        0 0   # from 0 => to 0
        1 1   # from 1 => to 1
    }
}
pcm.dsp0 {
    type plug
    slave.pcm "ossmix"     # use our new PCM here
}
# mixer0 like above
ctl.mixer0 {
    type hw
    card 0
}
and it works great using 2 alsa sources. I've set the permissions on it to 666. Anyone know what could be wrong or what i am doing wrong? Thanks.
Did you get this to work finally?
 
Old 04-14-2005, 02:22 AM   #3
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Re: Re: alsa with libsdl

Quote:
Originally posted by t3gah
Did you get this to work finally?
No, i was trying for a while and just decided to give it a rest and try to get other things working and then getting back to this. I'm thinking the problem is in the export lines, because my dmix works fine with 2 natural alsa programs, but i cant get it to work with any oss program, not even using aoss. I'll try to get back to this though. If anyone else gets it working before me just post here :P.
 
Old 04-14-2005, 12:26 PM   #4
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
I've been having some problems with sdl-alsa as well. Sometimes when I run the game I'm working on in my sig, audio will refuse to play. It prints out a warning but I can't remember exactly what it says (I'll post details when I get home later tonight if I remember). But in my case I don't think it's something particular to sdl-alsa. I think my whole audio system is borked. Doom3 has really scratchy sound which makes the game barely audible, enemy territory won't play sound at all, mplayer says it can't open a sound library that I have installed correctly, some small problems with xine and xmms as well....it's a mess that I haven't gotten around to fixing. But yeah, if I find any useful information when I get home tonight I'll let you know.
 
Old 04-14-2005, 03:01 PM   #5
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by R00ts
I've been having some problems with sdl-alsa as well. Sometimes when I run the game I'm working on in my sig, audio will refuse to play. It prints out a warning but I can't remember exactly what it says (I'll post details when I get home later tonight if I remember). But in my case I don't think it's something particular to sdl-alsa. I think my whole audio system is borked. Doom3 has really scratchy sound which makes the game barely audible, enemy territory won't play sound at all, mplayer says it can't open a sound library that I have installed correctly, some small problems with xine and xmms as well....it's a mess that I haven't gotten around to fixing. But yeah, if I find any useful information when I get home tonight I'll let you know.
that's wierd. I remember having problems when using libsdl1.2debian-alsa but with libsdl1.2debian-all it works fine. I've also had to remove everything remotely resembling arts to get it working fine, but i cant get sdl to work with alsa and programs like skype to work with alsa-oss (aoss). Not horrible, but it's really annoying. Let's see if we can figure this out :P.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is libSDL-1.2.so.0? ccerino Linux - Hardware 1 07-29-2005 01:46 PM
libSDL.so.0 t3gah Linux - Software 5 03-16-2005 06:19 AM
libsdl vs libsdl-devel Micro420 Linux - Software 3 01-13-2005 12:19 PM
libSDL Ryan450 Linux - Software 10 08-30-2004 07:48 PM
Where to find libSDL-1.3.so.0?? Caluka Linux - Games 4 07-28-2004 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration