Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  JavaSound on Linux  (Read 20625 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Reply #60 - Posted 2011-09-10 00:37:25 »

Quote
"I've never heard of a game or even any application that needs exclusive access to the soundcard, especially not in 2011."

My Finale 2007 and Sonar Home Studio 6 definitely don't get along. Both are well-established commercial applications.

And if I use them and go to YouTube, YouTube often sounds like chipmunks or vice versa.

I'm wishing they had more "intuitive" configuration panels, as it is very hard to tell what either one of them is exactly doing with the sound system.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline Socob

Senior Newbie





« Reply #61 - Posted 2011-09-10 10:20:34 »

@philfrei:
Well, I've never heard of either of those programs, so I guess my point still holds Wink
Either way, my first reaction now is that I probably wouldn't use those programs due to the issues they seem to have - which is obviously not the reaction I would want my own users to have.
Offline nsigma
« Reply #62 - Posted 2011-09-10 16:38:32 »

@philfrei:
Well, I've never heard of either of those programs, so I guess my point still holds Wink
Either way, my first reaction now is that I probably wouldn't use those programs due to the issues they seem to have - which is obviously not the reaction I would want my own users to have.

Well, Phil's examples aren't Linux applications, but you'll find the same sort of thing with many Linux applications that are aimed at a more pro-audio user base.  You'll find that sort of thing more and more as you head along the consumer-audio -> pro-audio continuum (I say continuum, because it's not an either / or thing).  JACK takes over the soundcard so you'll get the same scenario on Linux with any application that relies on JACK for example, and there are a lot of them.  Sorry, but saying you wouldn't use such program because it interferes with Flash is a daft statement if you don't know what the program is for or why it functions the way it does.  The reason these applications do this is because the performance is better, and depending on what you're trying to do sometimes performance is more important.

So, while I'd like to make sure the existing high-performance ALSA audio drivers remain in the JDK, I also agree with you that the consumer end of the market needs to be better accommodated by additional mixers that support the newer consumer orientated ALSA features.

Bear in mind though that these mixers are already in OpenJDK, and almost all distributions except Mint ship OpenJDK as the default, so I don't necessarily see it as big an issue in the Linux consumer space as you do at the moment!

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Socob

Senior Newbie





« Reply #63 - Posted 2011-09-11 13:45:58 »

Well, Phil's examples aren't Linux applications, but you'll find the same sort of thing with many Linux applications that are aimed at a more pro-audio user base.  You'll find that sort of thing more and more as you head along the consumer-audio -> pro-audio continuum (I say continuum, because it's not an either / or thing).  JACK takes over the soundcard so you'll get the same scenario on Linux with any application that relies on JACK for example, and there are a lot of them.  Sorry, but saying you wouldn't use such program because it interferes with Flash is a daft statement if you don't know what the program is for or why it functions the way it does.  The reason these applications do this is because the performance is better, and depending on what you're trying to do sometimes performance is more important.
Good, and now explain that to someone with no technical experience. They're just going to look at you in disbelief, because audio from multiple applications is ubiquitous. We're talking about video games here, not high-end commercial audio tools. Also, I didn't say "intereferes with Flash", but "needs exclusive access to the sound card". Unlike JavaSound (in its current state on the Oracle JVM), even Flash doesn't need exclusive access, it just tends to keep its lines open (which triggers ALSA/PulseAudio/whatever to keep a lock on the soundcard) longer than necessary.

Bear in mind though that these mixers are already in OpenJDK, and almost all distributions except Mint ship OpenJDK as the default, so I don't necessarily see it as big an issue in the Linux consumer space as you do at the moment!
The mixers are in OpenJDK, but they, too, have problems. As I've mentioned before, certain methods of Lines (like drain() or stop()) take ridiculous amounts of time to return, making things like repeating a short sound effect in quick succession very difficult. Also, Linux Mint does ship with OpenJDK, so I guess you're right when you say that it's not a huge problem - I just don't want to keep going knowing that something is broken.
Offline nsigma
« Reply #64 - Posted 2011-09-11 19:41:10 »

Well, Phil's examples aren't Linux applications, but you'll find the same sort of thing with many Linux applications that are aimed at a more pro-audio user base.  You'll find that sort of thing more and more as you head along the consumer-audio -> pro-audio continuum (I say continuum, because it's not an either / or thing).  JACK takes over the soundcard so you'll get the same scenario on Linux with any application that relies on JACK for example, and there are a lot of them.  Sorry, but saying you wouldn't use such program because it interferes with Flash is a daft statement if you don't know what the program is for or why it functions the way it does.  The reason these applications do this is because the performance is better, and depending on what you're trying to do sometimes performance is more important.
Good, and now explain that to someone with no technical experience. They're just going to look at you in disbelief, because audio from multiple applications is ubiquitous. We're talking about video games here, not high-end commercial audio tools.

Audio from multiple applications is not ubiquitous.  Phil and I have both given you examples where this is not the case, and I could give you more Linux ones.  It completely depends what the software is used for, and I'm not just talking high-end commercial audio tools (the commercial ones don't even exist on Linux!).  The only person who's ever "looked" at me in disbelief about this is you (and yes I do sometimes do workshops around this area).

From a video games / consumer desktop perspective, which is obviously the focus here, then yes it's needed and I'm not disputing that - I fail to see why you're disputing that sometimes it isn't!

Also, I didn't say "intereferes with Flash", but "needs exclusive access to the sound card". Unlike JavaSound (in its current state on the Oracle JVM), even Flash doesn't need exclusive access, it just tends to keep its lines open (which triggers ALSA/PulseAudio/whatever to keep a lock on the soundcard) longer than necessary.

Sorry, that was a flippant way of putting it, but it's only fairly recently that Flash has been fixed in this regard, and if you search the Mint forums you'll find people still sometimes having issue with Flash taking exclusive use of their soundcard.

I wonder if the long term lock from Flash (and from Java applets actually) is partly caused by caching in the browser too.  Epiphany didn't seem to have quite the same issue when I last tried it.

Bear in mind though that these mixers are already in OpenJDK, and almost all distributions except Mint ship OpenJDK as the default, so I don't necessarily see it as big an issue in the Linux consumer space as you do at the moment!
The mixers are in OpenJDK, but they, too, have problems. As I've mentioned before, certain methods of Lines (like drain() or stop()) take ridiculous amounts of time to return, making things like repeating a short sound effect in quick succession very difficult. Also, Linux Mint does ship with OpenJDK, so I guess you're right when you say that it's not a huge problem - I just don't want to keep going knowing that something is broken.

Both Riven and I have said in this thread, don't do this!  The drivers and hardware underlying the mixer implementation are not designed to have lines continually opening and closing.  Open a line and keep it open.  This may involve you using a 3rd-party audio library like one of the ones I suggested earlier, or waiting for Paul to finish his software mixing project.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Socob

Senior Newbie





« Reply #65 - Posted 2011-09-12 20:43:43 »

Audio from multiple applications is not ubiquitous.  Phil and I have both given you examples where this is not the case, and I could give you more Linux ones.  It completely depends what the software is used for, and I'm not just talking high-end commercial audio tools (the commercial ones don't even exist on Linux!).  The only person who's ever "looked" at me in disbelief about this is you (and yes I do sometimes do workshops around this area).
Well, this is, of course, a subjective issue (even if I didn't think you'd challenge my claim that "normal" users wouldn't accept single-application audio). My point was simply that it is extremely rare (I like to think of myself as advanced, technically, and even I hadn't experienced issues like this before) and a severe limitation for the user which requires a convincing legitimation.

From a video games / consumer desktop perspective, which is obviously the focus here, then yes it's needed and I'm not disputing that - I fail to see why you're disputing that sometimes it isn't!
I'm not disputing that! I already mentioned high-end audio tools as a legitimate example, and I'm perfectly willing to accept the cases where such limitations are sufficient - again, they're just rare.

Sorry, that was a flippant way of putting it, but it's only fairly recently that Flash has been fixed in this regard, and if you search the Mint forums you'll find people still sometimes having issue with Flash taking exclusive use of their soundcard.
Well, I didn't know that. But as I said in my opening post, Linux audio is still a mess, because there are too many ways to do it. I guess issues like that are just another facet of that (along with poor support from commercial developers in the case of Flash, of course).

Both Riven and I have said in this thread, don't do this!  The drivers and hardware underlying the mixer implementation are not designed to have lines continually opening and closing.  Open a line and keep it open.  This may involve you using a 3rd-party audio library like one of the ones I suggested earlier, or waiting for Paul to finish his software mixing project.
I didn't intend on actually doing it, namely because of all the problems that have been mentioned - it's just another thing I noticed while experimenting (also, it still feels weird to me to be told to just never use certain parts of the API). The concrete problem I was having is that with very short sound effects, even if I wrote the entire sound effect data to the line's buffer, it wouldn't play because the buffer was bigger than the data itself (at least I think that's what happened). Thus, I needed a way to flush the buffer, but as I mentioned, the methods related to that took ages, defeating the purpose. I think what I ended up doing was just writing more data to the buffer until it was full. So that's the story behind that Wink
Pages: 1 2 [3]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (12 views)
2014-07-24 01:59:36

Riven (10 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!