OSS4 for Android

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, kodachi, cesium

OSS4 for Android

Postby dimibyte » Wed Jan 23, 2013 8:56 am

Since I started using my android phone, I'm thinking about the real sound quality playback. But using ALSA I can't see solution to this problem.

I like to listen 24 bit audio with 96kHz sample rate, but still think, that these tracks are converted when played into 48kHz sample rate.

Are there porting or emulation solutions, which can show me true power of sound? :roll:

P.S. I am using Ice Cream Sandwich(4.0.4) (Linux kernel 3.0.8 ) on LG P936.
dimibyte
 
Posts: 7
Joined: Wed Jan 23, 2013 8:33 am

Re: OSS4 for Android

Postby igorzwx » Wed Jan 23, 2013 4:17 pm

dimibyte wrote:Since I started using my android phone, I'm thinking about the real sound quality playback. But using ALSA I can't see solution to this problem.

I like to listen 24 bit audio with 96kHz sample rate, but still think, that these tracks are converted when played into 48kHz sample rate.

Are there porting or emulation solutions, which can show me true power of sound? :roll:

P.S. I am using Ice Cream Sandwich(4.0.4) (Linux kernel 3.0.8 ) on LG P936.


It is not realistic to expect OSS4 for Android in the near future, because Android is a Linux fork for the semi-deaf.
In any case, such a project may involve a great deal of work:
1. OSS4 for Android,
2. OSS4 drivers,
3. sound applications, which support OSS4.

It might be possible to disable resamplers of ALSA though the help of secret esoteric knowledge. This may somehow improve sound quality, although, of course, ALSA is incapable of producing good quality sound. It is a kind of "very advanced open source crap"...
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby dimibyte » Sat Jan 26, 2013 11:08 am

igorzwx wrote:It is not realistic to expect OSS4 for Android in the near future, because Android is a Linux fork for the semi-deaf.
In any case, such a project may involve a great deal of work:
1. OSS4 for Android,
2. OSS4 drivers,
3. sound applications, which support OSS4.

It might be possible to disable resamplers of ALSA though the help of secret esoteric knowledge. This may somehow improve sound quality, although, of course, ALSA is incapable of producing good quality sound. It is a kind of "very advanced open source crap"...


Why it's not realistic?
I want to hear real, not converted sound with my android device and use it's maximum power.

I have started my work on learning OSS API to write, or take a try in driver writing.
Are there tricks to make ALSA to emulate OSS, or it is impossible to tell ALSA to use drivers for OSS? Or I can't do anything without digging Android code?..

I have thoughts about driver creation for Wolfson WM9093, but is it possible to make it using driver code for ALSA? Because WM9093 has driver for Linux:
http://opensource.wolfsonmicro.com/cont ... on-devices
However, I have a datasheet for it. But there is another problem: ALSA System on a Chip (ASoC) .

Even if I have disabled resamplers on my Android device, I'm still not sure about that. I don't know a good music player, which can show me, which device or/and mixer used. In Neutron Music Player resampler quality can be changed, BUT canNOT be disabled at all. Others, like GoneMAD, DeaDBeeF and jetAudio also don't tell you anything about device you're using. I feel some conspiracy here.
I've installed AlsaMixer application, which installs alsa_amixer, alsa_aplay, alsa_ctl into /system/xbin. Using Terminal IDE I tried to play CD quality wav file, but there was write error: I/O error.
So aplay can't write into pcm audio track. How can it be? I didn't block the device and there is nothing using it, how I think.
Also in /proc/asound/card0/pcm0p/sub0/hw_params:
Code: Select all
closed

In /proc/asound/card0/pcm0p/sub0/sw_params is written "closed".
In /proc/asound/cards
Code: Select all
0 [msmaudio       ]:  - msm-audio
                      msm-audio

Mysteriously...

P.S.: I can provide more information if needed. Also you can tell me that my idea of the driver is incompetent or just stupid.
dimibyte
 
Posts: 7
Joined: Wed Jan 23, 2013 8:33 am

Re: OSS4 for Android

Postby igorzwx » Sat Jan 26, 2013 5:04 pm

dimibyte wrote:I want to hear real, not converted sound with my android device and use it's maximum power.
I have started my work on learning OSS API to write, or take a try in driver writing.


Have you tried to contact OSS4 developers?

dimibyte wrote:Are there tricks to make ALSA to emulate OSS, or it is impossible to tell ALSA to use drivers for OSS?


I do not think that a sort of "emulation" may solve the problem. It is a wasting time, nothing more.

dimibyte wrote:Even if I have disabled resamplers on my Android device, I'm still not sure about that.


This is exactly the case. With ALSA, you never know what is really going on. ALSA is so designed that the users (and, perhaps, developers themselves) would not be able to understand how it works. It seems to be a sort of "calculated deception" (gezielte Täuschung).

Imagine that ALSA developers would publish a comprehensive manual on how to disable ALSA resamplers together with a clear-cut method of verification. The ALSA users would try to disable resamplers, but the sound would still be crappy. This would rise questions about the quality of ALSA drivers.

Notice, that there is not any official manual on how to disable resampling with OSS4 (and other sort of lossy conversions, "redirection to virtual devices", etc.) and how to verify this.

Nevertheless, OSS4 is said to be well-documented. This may seem true, if you compare it with ALSA, or other sort of "very advance open source crap". However, it might be rather difficult, even for an advanced Linux user, to understand how to disable lossy conversions with OSS4. In any case, it is extremely time-consuming. The absence of clear documentation makes users busy with "solving problems". You have to participate in the "stupid business" of the sort, if you still believe in "open-source".

Is there any "open-source" player which allows to play HiRes FLACs with OSS4 without lossy conversions, "redirection to virtual devices", or other sort of unwanted crap? Such players do not exist.

The only practical solution is DeadBeef player with Petrov's plugin. This plugin is "closed source", but it is free.

Notice, that the only component of Petrov's plugin, which might be difficult to reproduce, is his magic resampler. It should not be difficult to create a plugin for DeadBeef without resamplers. It should support "exclusive mode", surround playback, and allow to disable/enable format conversion. It may have a format converter inside which can be disabled. The "exclusive mode" is already supported by the "open-source" OSS4 plugin for Audacious (git version), but Audacious itself performs lossy format conversions which cannot be disabled.

Now imagine, that you have HD video files with HiRes audio tracks. To play them without lossy conversions, you may need a special OSS4 plugin for MPlayer. Such plugins do not exist.

Do not forget about your buggy video driver and crappy Linux kernel. Otherwise, experiments with playing HD videos on Linux may destroy your processor. It might be overheated and melted.

There seems to be a lot of Linux developers. They continue to develop problems: PulseAudio, systemd, GNOME3 and so on. They seem to believe that "open-source" users are semi-deaf, semi-blind, and semi-stupid.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby dimibyte » Sat Jan 26, 2013 10:44 pm

igorzwx wrote:Have you tried to contact OSS4 developers?

Not yet. Are you talking about tech-support(support@opensound.com)?
dimibyte wrote:Is there any "open-source" player which allows to play HiRes FLACs with OSS4 without lossy conversions, "redirection to virtual devices", or other sort of unwanted crap? Such players do not exist.

I thought Audacious can play HiRes FLACs with sample rate up to 192kHz. And how difficult is to build simple player, which decode FLAC into /dev/dsp in real-time? Just ridiculous.
igorzwx wrote:The only practical solution is DeadBeef player with Petrov's plugin.

Please explain more detailed, why this is a solution.
dimibyte wrote:The "exclusive mode" is already supported by the "open-source" OSS4 plugin for Audacious (git version), but Audacious itself performs lossy format conversions which cannot be disabled.

Can you provide proof on this?
dimibyte wrote:Do not forget about your buggy video driver and crappy Linux kernel. Otherwise, experiments with playing HD videos on Linux may destroy your processor. It might be overheated and melted.

If I fully understand what I am doing, I don't think that I will destroy something unnoticed.
dimibyte wrote:They seem to believe that "open-source" users are semi-deaf, semi-blind, and semi-stupid.

Maybe semi-stupid people really don't care about their health, but still Linux is better than Windows or Mac OS X, in my opinion. This is question of choice.

Open-source is good chance to change something or add something needed for you. Maybe, if OSS wasn't opened, this ideas like OSS for Android would never existed.
I really don't understand, why in the whole world of featured music players for android none can provide full technical information to Standard User and doesn't have full control option to decoding process or/and to musical conveyor?
So how about using a command "cat *.wav > /dev/dsp"? "Lossy format conversions" here exists or this method isn't under player use?

EDIT:
ASoC CODEC for WM9090/WM9093:
http://opensource.wolfsonmicro.com/cgi- ... fdb;hb=dev
http://opensource.wolfsonmicro.com/cgi- ... 05f;hb=dev
Last edited by dimibyte on Sun Jan 27, 2013 12:08 am, edited 1 time in total.
dimibyte
 
Posts: 7
Joined: Wed Jan 23, 2013 8:33 am

Re: OSS4 for Android

Postby igorzwx » Sat Jan 26, 2013 11:57 pm

dimibyte wrote:
dimibyte wrote:The "exclusive mode" is already supported by the "open-source" OSS4 plugin for Audacious (git version), but Audacious itself performs lossy format conversions which cannot be disabled.

Can you provide proof on this?


There is a source code of Audacious. You may try to study it.
In short, Audacious has inside a buggy format converter, which converts your audio file to 32bit float format. Then it is converted to the output format, which is selected in the preferences. So that, if you are playing 16bit to 16bit with Audacious, your audio file is converted at least two times: 16bit → "32bit float" → 16bit. Taking into account, that these are lossy conversions, and the crappy converter is buggy...
If you need more information, you may ask Michal viewtopic.php?f=3&t=3834&p=15221#p15221
He has already fixed some bugs in that crappy converter.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby Michal » Sun Jan 27, 2013 10:35 am

That is not true. Conversions 16bit -> 32bit float and 24bit -> 32bit float are lossless. So if you're not doing any processing (like resampling) you'll get exactly same bits on the output. I was working on Audacious' format converter a while ago:
https://github.com/audacious-media-player/audacious/commit/3f427be328f316b6147edea8b623092ff8c8720e
Gentoo ~AMD64 | Audacious
Michal
 
Posts: 16
Joined: Sat Sep 22, 2007 1:29 pm
Location: Lublin, POL

Re: OSS4 for Android

Postby igorzwx » Sun Jan 27, 2013 12:56 pm

Michal wrote:That is not true. Conversions 16bit -> 32bit float and 24bit -> 32bit float are lossless. So if you're not doing any processing (like resampling) you'll get exactly same bits on the output. I was working on Audacious' format converter a while ago:
https://github.com/audacious-media-player/audacious/commit/3f427be328f316b6147edea8b623092ff8c8720e


Format conversion is as "lossless" as resampling.

Format conversion 16bit → 32bit float is, in a sense, similar to upsampling.
As you might have noticed, the quality of upsampling depends on the quality of resampler. That is why Petrov's resampler sounds better than other resamplers. The same is true for format conversion 16bit → 32bit float.

Is it possible to disable that "lossless" format converter in Audacious?
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby Michal » Sun Jan 27, 2013 1:19 pm

igorzwx wrote:
Format conversion is as "lossless" as resampling.

Format conversion 16bit → 32bit float is, in a sense, similar to upsampling.
As you might have noticed, the quality of upsampling depends on the quality of resampler. That is why Petrov's resampler sounds better than other resamplers. The same is true for format conversion 16bit → 32bit float.

Is it possible to disable that "lossless" format converter in Audacious?


I mean, that you'll get a bit perfect output with 16bit, 24bit and 32bit float files. So really, there's no need to disable Audacious' internal conversions.

AFAIR Petrov's using similar format converter. His resampler operates on 64bit floats.
Gentoo ~AMD64 | Audacious
Michal
 
Posts: 16
Joined: Sat Sep 22, 2007 1:29 pm
Location: Lublin, POL

Re: OSS4 for Android

Postby igorzwx » Sun Jan 27, 2013 1:28 pm

Michal wrote:I mean, that you'll get a bit perfect output with 16bit, 24bit and 32bit float files. So really, there's no need to disable Audacious' internal conversions.

AFAIR Petrov's using similar format converter. His resampler operates on 64bit floats.


It does not matter how Petrov's resampler operates, if you can disable it.

Is it possible to disable that "lossless" format converter in Audacious, or not?
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby Michal » Sun Jan 27, 2013 1:31 pm

No, you can't. 16bit → Audacious → 16bit, 24bit → Audacious → 24bit and 32bit float → Audacious → 32bit float conversions are bit perfect. It was tested.
Gentoo ~AMD64 | Audacious
Michal
 
Posts: 16
Joined: Sat Sep 22, 2007 1:29 pm
Location: Lublin, POL

Re: OSS4 for Android

Postby igorzwx » Sun Jan 27, 2013 1:41 pm

Michal wrote:No you can't. 16bit → Audacious → 16bit, 24bit → Audacious → 24bit and 32bit float → Audacious → 32bit float conversions are bit perfect. It was tested.


Let us summarize:
1. The internal format converter of Audacious cannot be disabled.
2. Therefore, it is said to be "lossless" and "bit perfect".
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: OSS4 for Android

Postby Michal » Sun Jan 27, 2013 2:04 pm

Well, go ahead and test it yourself. Audacious has filewriter output plugin. You can use various tools to compare input and output files (Be aware, that headers may differ), like Foobar's bit compare utility. What's said above - Audacious has bit perfect playback for some file formats. Believe what you want, I don't really care.

As an addition, a 16bit file played with Audacious:
Code: Select all
a5c80f0b2e81c725634eb025e888a418  input.wav
a5c80f0b2e81c725634eb025e888a418  output.wav
Gentoo ~AMD64 | Audacious
Michal
 
Posts: 16
Joined: Sat Sep 22, 2007 1:29 pm
Location: Lublin, POL

Re: OSS4 for Android

Postby dimibyte » Sun Jan 27, 2013 3:25 pm

How about porting Audacious to Android?
In Audacious you can choose playback device and control quality much better than any of existed players, including "audiophile" Neutron Music Player.

After complete reading of OSS API, maybe, I try to write down the driver/CODEC. Now I have some comparison between ASoC drivers/interfaces and OSS drivers/interfaces. ALSA was born with OSS, so as I see, they are similar.
But I have a question:
Open Sound System supports I2C devices or not?

P.S.: I don't know any realizations of OSS in android. Nobody runs it on Android...
dimibyte
 
Posts: 7
Joined: Wed Jan 23, 2013 8:33 am

Re: OSS4 for Android

Postby igorzwx » Sun Jan 27, 2013 3:34 pm

Michal wrote:Well, go ahead and test it yourself. Audacious has filewriter output plugin. You can use various tools to compare input and output files (Be aware, that headers may differ), like Foobar's bit compare utility. What's said above - Audacious has bit perfect playback for some file formats. Believe what you want, I don't really care.

As an addition, a 16bit file played with Audacious:
Code: Select all
a5c80f0b2e81c725634eb025e888a418  input.wav
a5c80f0b2e81c725634eb025e888a418  output.wav


O.K. Let us put it in this way:

1. The internal format converter of Audacious cannot be disabled.
2. It is said to be "lossless" and "bit perfect".
3. Everyone is allowed to believe what he (she) wants.

To be fair, I am not a specialist in beliefs and religion. I do not have the gift of faith, and, therefore, I do not believe that format conversion can be "lossless" and "bit perfect". In any case, it is not a theological forum.

You would not claim that your "lossless" format converter is perfect in an absolute sense, and, therefore, it cannot be improved. Right?

As you remember, I have already tested all these things many times. For some strange reason, DeadBeef with Petrov's plugin sounds much better than Audacious, even if resampling is disabled. This is, of course, my subjective opinion. There might be many other sources of distortions: bugs in Audacious, hardware effects, etc.

There is a belief that "the human ear functions much like a Fourier transform, wherein it hears individual frequencies (for details see Mathematics of hearing). The ear is therefore very sensitive to distortion, or additional frequency content that "colors" the sound differently, but far less sensitive to random noise at all frequencies" http://en.wikipedia.org/wiki/Dither This may explain why Petrov's resampler is a sort of Fast Fourier transform (FFT).

In a word, human ear is much more sensitive to distortion than your methods of measuring "bit perfectness". The ear is very exact in this sense. Although, of course, semi-deaf Linux users may not notice any distortions.

The point is, that there is not any "open-source" player for OSS4, which allows to play HiRes flacs 24bit 192kHz without lossy conversions, without vmix, PulseAudio, "redirection to virtual devices" and other unwanted crap.

It might be a very simple player, simple enough to minimize the problem of bugs and unwanted hardware effects.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Next

Return to Linux

Who is online

Users browsing this forum: No registered users and 2 guests

cron