WinCE mixer API questions - General Questions and Answers

Hello, I intend to write a program for Pocket PC that uses Windows wave API. One of the features is recording audio. The sources of audio recording would be build-in microphone, headset microphone, Bluetooth headset or input from phone module. In desktop PC Windows provide capability to choose recording sources and control gains through the standard mixer program sndvol32.exe which is implementation of mixer API. I suppose that use of mixer API is only way to choose between sources. WinCE also implements this API, but in my RoverPC G5 (Atom Exec) function mixerGetNumDevs() returns 0. Zero means than mixer part is not implemented in wave driver. In Platform Builder there are sources for MDD/PDD and uniform wave drivers in which mixer part is implemented and mixerGetNumDevs() returns 1. One is also returns in some emulator versions of WM. I have done several tests of what mixerGetNumDevs() returns on different versions of WM, and results are:
Device / OS / mixerGetNumDevs()
-------------------------------------------------------------------
Device Emulator / Pocket PC 2003 SE (4.21.1088) / 0
Device Emulator / WM 5.0 Pocket PC R2 (5.1.1700) / 1
Device Emulator / WM 6 Professional (5.2.1235) / 1
RoverPC G5 (Atom Exec) / WM 5.0 for Pocket PC Phone Edition (5.1.195) / 0
It would be interesting to know which device drivers implement mixer part. I propose to run simple test and collect information in this topic.
Please run this test View attachment mixtst.zip on your PDA or smartphone and post results.

Please redirect to this topic

Related

TekSoft: "the MS BT stack can not be hacked to enable flawless call recording"

TekSoft: "the MS BT stack can not be hacked to enable flawless call recording"
TekSoft, one of the most excellent newcomers to the Windows Mobile developer scene but already being Bluetooth experts (see for example their excellent BlueMouse and BlueMusic applications), have just announced in THIS thread that it's, unfortunately, not possible to "hack" the Microsoft Bluetooth implementation of Windows Mobile to "capture" speech packets and record them:
"We had another attempt of making PhoneREC possible - by intercepting the voice flowing through the BT driver when a Bluetooth headset is connected:
1) when a call is established, the software would have enabled voice routing to Bluetooth headset
2) if a headset was not present, it would have been emulated (to be able to use the device without headsets with phonerec too)
3) voice data over Bluetooth would have been in the form of SCO packets
4) our software would have intercepted the SCO packets, extract the voice data, record it to a file, and play it on the device's speaker (so no need of using the headset to hear the other party in the call)
Unfortunately this failed too, as the SCO packets are handled in the hardware, so we found no way of capturing those from a software program.
The only remaining option is to use a custom made wired headset with PhoneREC. This works and assures high fidelity sound for both parties, but the phoneREC user can only record the phone call by using the special wired headset."
This is certainly very bad news for anyone not having a call recording-capable model.
For the time being, you have only few choices if you want to record your phone conversations. These are as follows:
If you want to stay with Pocket PC's, go for either the Gigabyte gSmart. According to the user comments HERE, the O2 Atom Exec and, HERE, the Asus P525 and P535 are also call recording-enabled. Unfortunately, the availability of (some of) these models can be restricted (for example, it's pretty hard to get the gSmart in the non-Asian / Australian region and when it's available at all - through, for example, ordering via Expansys -, it is pretty expensive.)
If you prefer MS Smartphones (in the Windows Mobile 6 parlance, WM6 Standard devices) or, are ready for returning to the two-device approach (one for phone calls and basic stuff like, say, playing emulated games via SmartGear / MasterAll's emulators or quickly browsing the Web via Opera Mobile or Opera Mini, another for anything other requiring a decent Pocket PC or Smartphone), with the HTC Oxygen (HTC s310). I'm absolutely sure it DOES support call recording - it makes excellent recordings, even when a BT headset is used. Note that I have an Orange rebranded Oxygen localized to Central-Eastern Europe (I've bought mine from a Slovakian guy to keep the costs down and it has Polish / Slovakian / Hungarian localization), SPV C100. However, I don't think the original HTC Oxygen wouldn't support call recording and it's just because the given countries' allowing for call recording that my Oxygen supports it. (To make sure HTC supports it in the "basic", non-localized models, I couldn't reflash it to a generic HTC ROM discussed HERE because there are no CID unlocking solutions for the model.)
Note that some? many? other Smartphone models do NOT support call recording. One of them, unfortunately, is the HTC Vox (s710), which is by far the best Smartphone available today. It does not, I repeat, NOT support recording the other party and yes, I've tested this VERY thoroughly.
If you don't want to get the above-listed PPC / Smartphone models but is ready to keep a non-Windows Mobile phone with you, you may want to read for example THIS article on the Symbian alternatives and what call recorder applications the platform has. Note that UIQ-based Sony-Ericsson phones, according to this thread, aren't capable of recording calls, only Nokia models. Also note that it's not with ALL Nokia models that you can get rid of the constant beeping.
If Symbian isn't your favorite, you may want to stick to "dumb" phones like the (Sony-)Ericsson t610/t618 (and, probably, later models). If you assign the call recording functionality to be started by quickly pushing the joystick to the left, you can easily emulate the (missing) auto-recording functionality. Unfortunately, the t610 doesn't support saving the other party's number / name along with the recording, unlike the call recording-capable predecessors of the t610. An example of the latter are the t68(i) and the, now, seven-year-old r520m. Note that the latter only supports recording one party and the former, while it stores both the timestamp and the other party's identity, doesn't let for transferring these recordings to anything via a cabled / IR / BT connection - that is, the recordings must be played back on the t68(i). Furthermore, on the t68(i), it takes slightly more button presses to start recording (there are no auto-recording capabilities either), unlike on the successor, the t610.
Siemens' old "dumb" models (for example, the SL-45) are also stated to be able to make flawless recordings. I don't know whether it's easy to make them automatic, whether the recordings are correctly timestamped or whether the other party's number / name is also stored along with the recording.
Finally, if always switching your phone to speakerphone mode is OK with you (and your environment: co-workers / family members etc.) and you never use wired / Bluetooth headsets (which would make recordings entirely impossible), make sure you always do so. It'll deliver definitely worse recording quality than recording with a phone that does support recording, but is still better than in the non-speakerphone mode. Note that if you need automatic speakerphone activation (as opposed to the manual one), you'll want to take a closer look at VITO AudioNotes - currently, it's the only audio / call recorder application to support auto speakerphone activation (and is, in general, an excellent call recorder for both the Pocket PC and the Smartphone).
Please DO read my related articles for more information on all these questions; they may answer all your questions.
Windows Mobile device manufacturers & Microsoft, we DO need phone recording capabilities!
Review: decent phone call (!) / note / MP3 recorder VITO AudioNotes 1.3 out!
How can I record phone conversations on my Pocket PC Phone Edition device?

[Q] USB sound card on Android?

I have a Android pad running 2.1 and it has 2 x USB ports and a lousy audio out (3.5 Jack).
I was wondering if USB soundcards work on Android? I am under the impression it is plug&play in linux, and that android uses the same audio driver? (just not via USB).
Beeing able to use a USB soundcard with propper sound would greatly improve sound quality (I want to use my pad in my car) :/
+1
I also want to know about USB sound cards support under Android. I have SB Live 24 (USB) and it works with my ARM-based Asus Wi-Fi router, but what about Android 2.2 and MIDs with USB-host port? ;-)
Anyone tried it?
It could be possible
Any update on this thread, would like to get this for my asus transformer if anyone can confirm it works. http://www.asus.com/Multimedia/Audio_Cards/Xonar_U3/#overview
It could be possible!
I tray it on acer iconia tab a500 and noting happend.
It not working.
It maybe need a driver but i don't see any driver anywere
:-(
USB audio in Android progress
Just for note, it works! I recently added self-compiled snd-usb-audio modules to allwinner based tablet. Found corresponding /dev/snd/* devices. Hard part is to add switch to USB audio to java, if there are no full alsa support in ROM. If alsa used, I need only edit /etc/asound.conf ;-)
tsynik said:
Just for note, it works! I recently added self-compiled snd-usb-audio modules to allwinner based tablet. Found corresponding /dev/snd/* devices. Hard part is to add switch to USB audio to java, if there are no full alsa support in ROM. If alsa used, I need only edit /etc/asound.conf ;-)
Click to expand...
Click to collapse
could you give some more details on how this was done?
USB OTG gets mouse/keyboard/mass storage working, but USB soundcard doesn't get sound through it (though the card is receiving power) and I cant see a way to check if it can see the device.
the USB soundcard I'm using was seen by my linux pc (kernel 3.0.0-15) straight away no drivers or config needed.
Here is a what I found on USB AUDIO output with Android (maybe it makes sense to put and update this table to the first topic)
NOTE: as of now SOME (not all!) USB AUDIO Android support implementations stream data through Android MUX that disturbs the original PCM stream for changing volume which means re-sampling original media, but also limited to 44.1kHz(some 48) 16 bit, so for SOME Android:
1) max all your volume controls while using external DAC
2) there is no reason to have / use DAC with higher rates then 44.1/16
3) there is no reason to have / use files of more then 44.1/16 quality. Trying to play 96kHz 24bit file will result in forcing Android to re-sample it on the fly with limited resources and not perfect algorithms leading to degrading output quality lower then proper done in studio or desktop 44.1/16!
There might be a way bypassing the Android layer and going right to ALSA you can do 24 bit.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
*there is way around it in linux ALSA http://blog.agdunn.net/?p=434 but i have not seen such for Android
Supporting Devices
---------
Galaxy S III $700 Android phone
ARCHOS G9 $250+ Android tablet (looks like the key is OMAP chipset kernel drivers)
Squeezebox Touch $250 - propriatary logitech linux box
Ainol Novo 7/8 Advance 8gb 100$ Android tablet or Allwinner with a modded Android kernel
Nook Touch with custom rom
any A10 Android tablet http://www.slatedroid.com/topic/33373-rom-cm9-nightlies/
* Hyundai A7HD tablet with Cm9
* Mediacom 907c, Momo11 Bird, JXD S9000, Eken A90
* Visture V3
* Mediacom 910i, Teclast A10t
* ICOO D90W
* CEMA10N7 "unknown" device
* Bmorn V99
* Mediacom 711i, Momo9
* Protab2XXL
* Sanei N83
* Hyundai A7HD
* MOMO9 needs
http://forum.xda-developers.com/showthread.php?p=22280857#post22280857
http://www.slatedroid.com/topic/29289-usb-audio-cards-support-drivers-and-libs/
. B&N Nook Colour with a modded Android kernel
http://forum.xda-developers.com/showthread.php?t=1459892
. WitsTech A81G with a slightly modded Android kernel
http://android.modaco.com/topic/343858-external-usb-devices/page__st__20
Suported DACs:
for Galaxy S III
List of USB DACs with known USB controller that interwork with Samsung Galaxy S III for the time being:
+ AMB Labs Gamma2 with USB controller TI Burr-Brown PCM2707
+ FiiO E7 with USB controller TI Burr-Brown PCM2706
+ HifiMan Express with USB controller TI Burr-Brown PCM2702
+ Topping TP30 with USB controller TI Burr-Brown PCM2704
+ ODAC Tenor TE7022
List of USB DACs with known USB controller that don't interworking with Samsung Galaxy S III for the time being:
. FiiO E17 with USB controller Tenor TE7022
. iBasso D6 with USB controller TI TAS1020B
. Grant Fidelity TubeDAC-11 with USB controller Tenor TE7022
Hegel HD20 with USB controller Tenor TE7022 has also some issue
Audiotrak Prodigy Cube with USB controller Tenor TE7022
for Archos G9
+FiiO E17
+BEHRINGER UCA222
- E10 not supported
for Ainol Novo 7/8 Advance
+FiiO E7
+Burr-Brown PCM2704 USB DAC
+Creative
for Squeezebox Touch
+ Red Wine Audio Isabellina and an
+ HRT Music Streamer II+.
B&N Nook Colour
+Logitech DAC A-5572A |
+Beresford TC-7520SE Caiman |
+FiiO E7
B&N Nook Touch
+C-Media $5 USB adaptor
+Lexicon Alpha 24 bit adaptor
please reply here if you find more info on DAC/devices suppot so i'll keep this post up to date.
I use either a C-Media $5 USB adaptor or a Lexicon Alpha 24 bit adaptor on my Nook Touch.
By bypassing the Android layer and going right to ALSA I can do 24 bit field recording.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
Renate NST said:
I use either a C-Media $5 USB adaptor or a Lexicon Alpha 24 bit adaptor on my Nook Touch.
By bypassing the Android layer and going right to ALSA I can do 24 bit field recording.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
Click to expand...
Click to collapse
why you are sure that it is 24 bit coming out of Nook Touch tablet?
what ROM / kernel you are using?
where you specify a hardware device? this should be done editing config file or there is a menu items in settings interface?
I'm sure that it's 24 bit because I can look at the file and see that all the bits are exercised.
Moreover, since the microphone only hits about -30dBFS, I have to crank the gain.
Compared to a 16 bit recording (which is effectively 11 bits when using 30 dB gain), the 24 bits (effectively 19 bits) sounds much better.
The Nook doesn't have any builtin audio, except for Dummy which is hw:0
My application uses hw:1
There's really no need to select the audio adapter because there is usually just the one.
Renate NST said:
The Nook doesn't have any builtin audio, except for Dummy which is hw:0
My application uses hw:1
There's really no need to select the audio adapter because there is usually just the one.
Click to expand...
Click to collapse
I am a bit confused.
can you explain step by step how to archive it on stock NOOK touch?
1)install custom ROM with kernel and USB host support?
2)install specific media player? which one do you use?
3)plug in USB DAC, player will use it as output by default so no hw:0 tweaking needed?
The whole USB host mode on Nook Touch is covered here.
You will need a modified kernel.
The stock mediaplayer works but there is an unresolved bug that you need a little utility app to get over.
You need to put in an asound.conf
Renate NST said:
The stock mediaplayer works but there is an unresolved bug that you need a little utility app to get over.
You need to put in an asound.conf
Click to expand...
Click to collapse
So putting asound.conf from the thread you'd mention will solve it and it will be transparent output 24bit 96khz?
can I use other media player such as Astro or PoweAMP?
The Android layer only supports 16 bits.
The MediaPlayer can not play 24 bit files.
To do anything 24 bit you need an external USB adaptor that supports it and an application that directly uses ALSA.
I believe that there are other 24 bit apps on the market.
24 bit is really only useful for recording when there is a large dynamic range.
Renate NST said:
The Android layer only supports 16 bits.
The MediaPlayer can not play 24 bit files.
To do anything 24 bit you need an external USB adaptor that supports it and an application that directly uses ALSA.
I believe that there are other 24 bit apps on the market.
24 bit is really only useful for recording when there is a large dynamic range.
Click to expand...
Click to collapse
I think we are talking about different use-cases.
My question was on plugging external 24bit/96kHz capable DAC (not ADC) to Android device and playing high quality 16bit/44.1 and higher .flac files using one of android players through that external DAC.
As i understand you've done it at least for 16bit DAC? and even mentioned that there is a way to bypass Android layer to get up to24 bit transparently out to the DAC and can highlight the steps for Nook Thouch to archive it.
Can you share your experience, settings and apps you've used?
Most USB adapters you will find are 16 bit.
To get 24 bit, you have to go to a "pro" interface, M-Audio, Lexicon, whatever.
ALSA supports 24 & 32 bits, but does not directly support MP3 or FLAC.
The Android layer supports MP3 (maybe FLAC?) playback, but not record.
You can get 24 bit playback just by using the ALSA utility aplay on PCM files only.
I do not know what there is on the market for 24 bit record/play.
You'd need an app with a JNI interface to the ALSA library.
I wrote a recording application for the Nook Touch that does that.
I cited it in the thread mentioned.
Renate NST said:
Most USB adapters you will find are 16 bit.
Click to expand...
Click to collapse
Just got stock Nook Simple Touch. Can you guide what steps to do to let it play music to external DAC?

Know More About Linuk Operating System

Linux:
Android's kernel is based on the Linux kernel and has further architecture changes by Google outside the typical Linux kernel development cycle.[56] Android does not have a native X Window System nor does it support the full set of standard GNU libraries, and this makes it difficult to port existing Linux applications or libraries to Android.[57]
Certain features that Google contributed back to the Linux kernel, notably a power management feature called wakelocks, were rejected by mainline kernel developers, partly because kernel maintainers felt that Google did not show any intent to maintain their own code.[58][59][60] Even though Google announced in April 2010 that they would hire two employees to work with the Linux kernel community,[61] Greg Kroah-Hartman, the current Linux kernel maintainer for the -stable branch, said in December 2010 that he was concerned that Google was no longer trying to get their code changes included in mainstream Linux.[59] Some Google Android developers hinted that "the Android team was getting fed up with the process", because they were a small team and had more urgent work to do on Android.[62]
However, in September 2010, Linux kernel developer Rafael J. Wysocki added a patch that improved the mainline Linux wakeup events framework. He said that Android device drivers that use wakelocks can now be easily merged into mainline Linux, but that Android's opportunistic suspend features should not be included in the mainline kernel.[63][64] In 2011 Linus Torvalds said that "eventually Android and Linux would come back to a common kernel, but it will probably not be for four to five years".[65]
In December 2011, Greg Kroah-Hartman announced the start of the Android Mainlining Project, which aims to put some Android drivers, patches and features back into the Linux kernel, starting in Linux 3.3.[66] further integration being expected for Linux Kernel 3.4.[67]
Features:
Current features and specifications:[68][69][70]
Handset layouts
The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 2.0 specifications, and traditional smartphone layouts.
Storage
SQLite, a lightweight relational database, is used for data storage purposes.
Connectivity
Android supports connectivity technologies including GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX.
Messaging
SMS and MMS are available forms of messaging, including threaded text messaging and now Android Cloud To Device Messaging (C2DM) is also a part of Android Push Messaging service.
Multiple language support
Android supports multiple languages.[42]
Web browser
The web browser available in Android is based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine. The browser scores 100/100 on the Acid3 test on Android 4.0.
Java support
While most Android applications are written in Java, there is no Java Virtual Machine in the platform and Java byte code is not executed. Java classes are compiled into Dalvik executables and run on Dalvik, a specialized virtual machine designed specifically for Android and optimized for battery-powered mobile devices with limited memory and CPU. J2ME support can be provided via third-party applications.
Media support
Android supports the following audio/video/still media formats: WebM, H.263, H.264 (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF, BMP, WebP.[70]
Streaming media support
RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive download (HTML5 <video> tag). Adobe Flash Streaming (RTMP) and HTTP Dynamic Streaming are supported by the Flash plugin.[71] Apple HTTP Live Streaming is supported by RealPlayer for Android,[72] and by the operating system in Android 3.0 (Honeycomb).[45]
Additional hardware support
Android can use video/still cameras, touchscreens, GPS, accelerometers, gyroscopes, barometers, magnetometers, dedicated gaming controls, proximity and pressure sensors, thermometers, accelerated 2D bit blits (with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics.
Multi-touch
Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero. The feature was originally disabled at the kernel level (possibly to avoid infringing Apple's patents on touch-screen technology at the time).[73] Google has since released an update for the Nexus One and the Motorola Droid which enables multi-touch natively.[74]
Bluetooth
Supports A2DP, AVRCP, sending files (OPP), accessing the phone book (PBAP), voice dialing and sending contacts between phones. Keyboard, mouse and joystick (HID) support is available in Android 3.1+, and in earlier versions through manufacturer customizations and third-party applications.[75]
Video calling
Android does not support native video calling, but some handsets have a customized version of the operating system that supports it, either via the UMTS network (like the Samsung Galaxy S) or over IP. Video calling through Google Talk is available in Android 2.3.4 and later. Gingerbread allows Nexus S to place Internet calls with a SIP account. This allows for enhanced VoIP dialing to other SIP accounts and even phone numbers. Skype 2.1 offers video calling in Android 2.3, including front camera support.
Multitasking
Multitasking of applications is available.[76]
Voice based features
Google search through voice has been available since initial release.[77] Voice actions for calling, texting, navigation, etc. are supported on Android 2.2 onwards.[78]
Tethering
Android supports tethering, which allows a phone to be used as a wireless/wired Wi-Fi hotspot. Before Android 2.2 this was supported by third-party applications or manufacturer customizations.[79]
Screen capture
Android supports capturing a screenshot by pressing the power and volume-down buttons at the same time.[80] Prior to Android 4.0, the only methods of capturing a screenshot were through manufacturer and third-party customizations or otherwise by using a PC connection (DDMS developer's tool). These alternative methods are still available with the latest Android.
External storage
Most Android devices include microSD slot and can read microSD cards formatted with FAT32, Ext3fs or Ext4fs file system. To allow use of high-capacity storage media such as USB flash drives and USB HDDs, many Android tablets also include USB 'A' receptacle. Storage formatted with FAT32 is handled by Linux Kernel VFAT driver, while 3rd party solutions are required to handle other popular file systems such as NTFS, HFS Plus and exFAT...
Press Thanks Button If I help U in increasing ur memory about linuk operating system
It's Linux not Linuk...
Copied word to word from Wikipedia?

[Q] Win CE Chinese all in one in-dash GPS

I have bought a Chinese 7in unit to fit in the dash of my Pajero. I have identified it as a Roadrover. Link not allowed
The specs are as follows.
Image not allowed.
* CPU : SiRF Prima 600Mhz CPU, Advanced ARM 11 architecture
300M Hz DSP, Support 3D Hardware Acceleration: High resolution 3D graphics for real 3D map
* DDR RAM: 128MB DDR-400MHz RAM fast multifuntional operation speed
* Built-in Memory: 128 MB Nand Flash(standard), up to 4GB (optional), Transfer songs,
photos ,videos among SD card, Built-in Nand Flash& USB Flash
* USB Prot : 2 Port available, support USB Mobile Hard Drive (exFAT,no capacity limit),
High-Speed USB 2.0: 480Mbps High Speed USB 2.0 Interface
* Storage Card:4GB SD card(standard), up to 32GB(Optional)
I have downloaded a Windows CE emulator and have ground my way up the learning curve. (I am a Mac person!)
I have managed to install and run MioPocket and ceFFM, in the emulator and on the actual unit, but after reading some negative comments I am reluctant to continue with MioPocket on the unit.
The navigation software is NavNGo Igo8 and I am happy with that. I only made one alteration, to get it to switch to map view at start up.
The in dash unit works well in the modes I have played with. The radio is good in country NSW (Australia). The CD/DVD player works. The bluetooth syncs with my Samsung Android phone and I have loaded the unit with my address book.
My only complaint is the in the iPod interface.
It connects to the iPod well and the interface allows you to select by Genre/Track/Artist etc. The only problem is that the pop-up screen listing the Tracks/Playlist does not stay on screen for long enough.
I have found the software that runs the iPod .... called iPod.exe.
I can not find any way of changing the settings.
Has anyone got any ideas?
Windows CE Emulator
I used an emulator to get on the learning curve with WIN CE.
It is at google code.
Here is the address. Being a nooby I can not directly quote the address.
Roadrover
Reverse engineering of RoadRover software and new tool creation
URL: code dot google dot com / p / roadrover
The emulator comes in two versions. One with a fake GPS unit interface with non-functioning buttons (skin). The other is plain cooking variety Windows CE. In English too. Unlike the Russian ones floating around.

Hi-Fi playback on Android (developers/testers only)

Each and every app on Google Play makes use of Android audio system to play music files (excluding my old andLess and the "USB Audio Recorder PRO" for external usb). The trouble with such playback is that you get a perfect 16/48000 or (44100) stream no matter the source file which is first downsampled then (digitally) clipped to the requested volume. Just try running this while playing _any_ file ("pcm15p" is for Qualcomm-based devices only, "15" needs be replaced with a different number for other ones):
Code:
adb shell cat /proc/asound/card0/pcm15p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 240
buffer_size: 480
As the time goes by and new devices receive better hardware, you'd expect this to change. No such luck with Android yet.
So I wrote a test app that plays lossless FLAC files directly through the ALSA driver.
The disgrace is:
1) It's targeted to recent msm8974 or apq8084 based devices and has no built-in support for other ones. If you've got an unsupported device, you have to modify the cards.xml file settings before anything, and this may be tricky (see below).
2) Root access is a must. A Permissive selinux setup may also be required (adb shell; setenforce Permissive).
3) No formats other than 16/24-bit FLAC or 16-bit APE are supported. There's a curious bug with 24-bit APE (won't be fixed);
-- All files not recognised for playback will be routed to Android;
-- If a particular sample rate (e.g., 176400) is not supported by hardware, it will be silently downsampled to its base rate (88200 or 44100 in this example);
-- If a particular format (i.e. a compressed stream, or 24-bit pcm or even 16-bit on some usb devices) is not supported, an error will be shown
4) In ALSA mode, volume controls work only when the app is in foreground (to be fixed);
5) Switching to/fro the Compr device may reboot your phone (kernel bug; workaround will be included later);
The settings file is called "/sdcard/.alsaplayer/cards.xml" and it's well commented. If you have a device missing there, all settings go in this file. A simple tip is checking the output of a mixer program like tinymixer and adding the diff when the device is playing and when it's not. These ALSA contrtols will be executed each time before the device is opened/closed/volume managed. The periods size/number to be added later.
This app also tries to play on "compressed" (a.k.a. "offload") Qualcomm devices, but you'll not be able to play FLAC files ulesss your kernel is patched; all newer msm8974/apq8084 devices support the hardware FLAC decoding, please ask your kernel developer to add the code like https://github.com/CyanogenMod/andr...mmit/f961d70994fe5f097b90e2cb5cfd87e90302c456 (I'm not providing a patch intentionally as (1) it's straightforward for an experienced developer (2) the codeaurora interface is really broken). For me, an offload FLAC playback sounds +worse+ than the direct pcm one (and I don't know the reasons why) -- I'm testing with the sennheiser IE-80 & audiotechnica ath 1000D headphones.
The program is opensource https://github.com/avs333/alsaplayer
The kudos go to skvalex who wrote almost all java part!
If change name flac to wav, it work.
Dear @avs333,
So.. this alsaplayer is great.
I can config cards.xml to make it work with my Lenovo Vibe X3(that havs built-in Sarbe DAC es9018c2m). So It can work with 24 bits FLAC file in direct PCM mode( that can not work with other, even with Poweramp alpha in HI-RES Mode).
I just need to ask you for support.
+ Can you add support for WAV file?( I mean in alsa PCM mode)
+In offload mode, I know in my device it will use PCM divices number 9, with Control - MultiMedia 4. But it's hidden, I can config it in cards.xml but it il not show in devices list. Of course the pcm device 9 does not show when I tried to list it "alsa_aplay -L".
Thank you
Hi @ctheanh!
Thank you for the comments!
Playing WAVs is currently supported in offload mode only, due to some obscure bug with Java I'm failing to find. A good news is that @skvalex (who is much more experienced in Java) has recently decided to join the project, so it'd be fixed soon I believe. He's planning to make a decent interface for this app, which is very rudimentary for the time being (and I'm really sorry for that!).
As to the offload playback, the devices have to be called "/dev/snd/comprCXDY" to be detectable (you need to make a link to such names if they're called otherwise by your specific driver). alsa_play won't show them as they're not pcms.
Hi @avs333
If you need tester, of course I am willing to join.
I am still optimize something with cards.xml to let it works smoothly. Still got some problem with volume( breaking my ear when changing from 24 bits to 16 bit). And the music will stop when receiving notification.
And, stupid question. How can I config to show offload device in device list?
ctheanh said:
Hi @avs333
If you need tester, of course I am willing to join.
I am still optimize something with cards.xml to let it works smoothly. Still got some problem with volume( breaking my ear when changing from 24 bits to 16 bit). And the music will stop when receiving notification.
And, stupid question. How can I config to show offload device in device list?
Click to expand...
Click to collapse
You have to specify different volume ranges for 24-bit and for 16-bit/offload playback in cards.xml as the standard QC controls are a bit strange, to say the least. For digital controls, I'm using 0-84 for 16-bit pcms (or *any* offloads) and 40-124 for 24-bit pcms with reasonable defaults (please see the original cards.xml), but using analog controls looks more promising.
To avoid the conflicts with notifications, select a device that is not used for them as they may stop the device even if they fail opening it.
The devices (including offload ones) shown in the "Settings->Device name" list are those specified in "cards.xml" if it is present (to filter out irrelevant playback ones) , or +all+ playback devices otherwise. You can "cat /proc/asound/pcm" to find their ids (and names). E.g., use <device id="17" offload="1"> if you see "00-17: (Compress2) : : playback 1". Please let me know if this doesn't work for some reason.
Is development dead? This is an awesome player! I'm asking my friends if they wanna contribute into this project, or we can team up, to push android audio further (you can see our team work with my sig picture link)
This seems very interesting.. I've been trying to get this working for AGES and have only successfully played 24 bit over Android O. ALSA is luckily very useful and I believe that card config can also be systemically implemented (as done in AINUR SAURON).
I'll happily join this project if you wish.
It seems to be a very good player
However I cannot play the file in external SD.
Hi everyone,
Looks like someone has forked this project on GitHub and made several commits to it:
https://github.com/cerg2010cerg2010/alsaplayer/graphs/commit-activity
Can anyone build the APK with the newest commits?
m00nlighter said:
Hi everyone,
Looks like someone has forked this project on GitHub and made several commits to it:
https://github.com/cerg2010cerg2010/alsaplayer/graphs/commit-activity
Can anyone build the APK with the newest commits?
Click to expand...
Click to collapse
Other methods exist for HiFi such as OpenSL ES HD and aaudio but this still send interesting so I'll take a look.
LazerL0rd said:
Other methods exist for HiFi such as OpenSL ES HD and aaudio but this still send interesting so I'll take a look.
Click to expand...
Click to collapse
Any news?
Lotoss said:
Any news?
Click to expand...
Click to collapse
On modern Android devices, I don't see why this is needed anymore. On older devices, if the kernel is set up correctly, this would work in theory as most devices allowed 24-bit PCM playback. Nowadays you got OpenSL ES HD, HiRes APIs from certain OEMs, HiRes paths for other OEMs, and probably stuff I missed out. In a post-Oreo world, I don't see why OEMs would have an excuse not to (or even custom ROM/kernel devs) unless the hardware has a limitation (unlikely).
LazerL0rd said:
On modern Android devices, I don't see why this is needed anymore. On older devices, if the kernel is set up correctly, this would work in theory as most devices allowed 24-bit PCM playback. Nowadays you got OpenSL ES HD, HiRes APIs from certain OEMs, HiRes paths for other OEMs, and probably stuff I missed out. In a post-Oreo world, I don't see why OEMs would have an excuse not to (or even custom ROM/kernel devs) unless the hardware has a limitation (unlikely).
Click to expand...
Click to collapse
I agreed that the OEMS should have no excuses to set up the path correctly nowadays. However the fact is that, they DO NOT
I have lost the OpenSL ES HD since I updated my Samsung Galaxy S7 Edge to Oreo:silly:
tidusdacapo said:
I agreed that the OEMS should have no excuses to set up the path correctly nowadays. However the fact is that, they DO NOT
I have lost the OpenSL ES HD since I updated my Samsung Galaxy S7 Edge to Oreo:silly:
Click to expand...
Click to collapse
Via modding mixers and audio routes you *may* be able to get it back.
LazerL0rd said:
Via modding mixers and audio routes you *may* be able to get it back.
Click to expand...
Click to collapse
Is there any clues for letting me to modify the audio path? Thx for the reply:good:
tidusdacapo said:
Is there any clues for letting me to modify the audio path? Thx for the reply:good:
Click to expand...
Click to collapse
Comparing is about it. There's no necessity for OEMs to implement a normal naming scheme there such as "hifi" but it's worth a shot to look for that.
AWESOME PLAYER!!!
Thank you very much!

Categories

Resources