Software sound cancelling (destructive interference) tools on Linux? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking at writing some software that will allow me to listen to music whilst talking with someone on skype. The problem is that if you do this with speakers the music also gets transferred to the other user, which is what I want to avoid.
So I was thinking about writing something that will, by listening to the output of my music application, cancel out those sounds from the microphone input sent to skype.
I have searched Google a bit, but maybe someone here can kickstart this project with some pointers/ideas/etc...
EDIT: has anybody used JACK before?

What you want to do is basically the same as Echo cancellation in telephony.
http://www.voip-info.org/wiki/view/Asterisk+echo+cancellation is simple introduction. Also have a look at the pages for the mark and mark2 echo canceller there and the mentioned TI application note.
Also this site:
http://www.embeddedstar.com/articles/2003/7/article20030720-1.html
explains the mechanics quite well.
You'll have to intercept both the music player's output and the microphone input, and then pass the samples via some sort of IPC into your DSP process. JACK actually does this, but setting things up (e.g. ALSA->JACK bridge, if your music player and/or Skype does not natively support JACK as sound interface) does require some skill.
I guess it could work fairly well, but it probably requires quite some CPU. Especially XRUNS (audio buffer under- or overrun) can be really bad for your echo canceller, i.e. you might need realtime linux kernel patches. Implementation is not trivial, either. Also having stereo sound from your music player will reduce your cancellation success.
HTH

Generally when it comes to noise cancellation, it is due to 2 things in precedence order:
Hardware - either a MIC/headphone with noise cancellation feature or the internal sound card MIC that already built in that feature.
Software - a good example is Skype, AFAIK SKype allow you to fine tuning audio quality but unfortunately the tuning part so far only existed in Windows platform. Where in Linux, you can choose the option of "Allow Skype To Automatcally Adjust My Mixer Levels" checkbox at Preference > Sound Devices.
My understanding is when it come to noise cancellation, you have to deal with the sound car driver programming, currently there is couple of noises noted into future Ubuntu software release that carry the said feature, there is here mentioned.

Related

desktop video player with new codec [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to create a video player like pot player or vlc , that can play my personal codec ( like mp4 , mkv , ... ) for security reason
a player has a login page and the user has to sign in to play video in it
with out sign in the player doesn't work at all
for example
I have video name.mp4 and
I want this video convert to something like this :
name.xyz
this format (xyz) should only play in my player and only play in a person's computer who buy these videos
I need some info on how to create this player and this player Should not crack.
which language is perfect for this purpose?
I want a cross-platform app. ( support in Linux, Mac, Windows )
Please help me. I need this app very bad
just Need a small clue
It seems your goal is to achieve a situation where playback can only happen in players that you produce and trust. That way you can enforce only users who have paid will be able to access the video.
For that, you do not need custom codecs (also note that .mp4 or .mkv is not a codec, but is a container). What you need is DRM. What DRM does is encrypt the video, so that it can't be played without having the decryption keys. The player you then need would have to have some way to get those keys, and keep them secret on the device.
There are several commercial systems out there, that can be implemented at relatively low cost. For instance, Microsoft Azure has a solution for this: https://azure.microsoft.com/en-us/services/media-services/content-protection/
If you need offline playback though, things are a bit more complex. Another option could be https://castlabs.com/drmtoday/
If you want to support all the listed platforms, you will likely need to interact with 3 different major DRM systems. Microsoft PlayReady, Google Widevine and Apple FairPlay. Azure and DRMToday packages all those together, but you can also choose to implement them all yourself.
You most likely do not want to build your own DRM system. Not only, is it far to easy to make mistakes that render it unsecure in some manner, it's also a lot of engineering effort, and way more costly to do than just using the existing systems.
Ok, so practically it's impossible to achieve what you want, because anyone who have access to these videos can record them and share for free. Also, you can't just rename something from name.mp4 to name.xyz because the content it's still the same, even if the extension is changed.
However, if you have your own codec than it's ok for you, because the usual video players won't decrypt it because it's new. The part with the login page it's again a problem, you have to think if you create accounts. You create them based on what? Password? Then I can share my account with my buddy and we both watch and just one of us paid. Based on IP? Ok, but there are many dynamic IPs over there.

H.265/HEVC web browser support [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Are there any web browsers out there that can playback the H.265 / MPEG-4 HEVC codec in a html5 video element? On what platform or hardware?
I heard rumours about HEVC support in Edge when hardware decoding is available. With current GPUs and CPUs shipping with HEVC hardware decoding I wonder which other browser vendors are following. Firefox already works like this for H.264
No, no browser supports H.265. And wide support is not likely to be added in the near future.
EDIT:
I updated the question because there are reports of it working in Edge when hardware decoding is available.
This is a good point.
In this case, the browser still does not support it. It is offloading decoding to the OS (Windows), and the OS is offloading to the hardware. But the result is the same as having browser support. This becomes cheaper, because the license was paid for by the chip company.
Background:
H.265 licensing has historically been extremely expensive. In some cases orders of magnitude more expensive than H.264. MPEG-LA and HEVC Advance patent pools expected companies like apple and Microsoft to pay for it. But they got too greedy (specifically HEVC Advance) by eliminating price caps, so Microsoft would have had to pay hundreds of millions of dollars for H.265, where H.264 caps out in the low millions. HEVC Advance has changed the licensing policy, but it may be too late, as google Microsoft, Amazon, Netflix, Cisco, Mozilla and others are developing a royalty free alternative (under the name Alliance for Open Media) so online video can never be held hostage again.
It works in IE and Edge but only if there is hardware support. It's also reported to work in Android browser and Chrome for Android on some devices that have hardware support.
Source: https://caniuse.com/#feat=hevc
n.b. If you strive to use h.265 to embed better quality video in your web content you should also consider transcoding and including webm: http://caniuse.com/webm/embed/. Support is flaky as well, but will absolutely improve rapidly as chip manufacturers are increasingly including hardware acceleration for both standards (HEVC and VP9)
Chromium can support h.265 when compiled with the aforementioned codec enabled during compilation.
Check it out - https://github.com/henrypp/chromium/releases
Those are all 64 bit releases, so make sure you install them on 64 Bit Windows only.
Edge on Windows 10 supports HEVC if the appropriate app is installed from the Microsoft Store.
Paid:
https://www.microsoft.com/en-us/p/hevc-video-extensions/9nmzlz57r3t7?activetab=pivot:overviewtab
Free:
https://www.microsoft.com/en-us/p/hevc-video-extensions-from-device-manufacturer/9n4wgh0z6vhq?activetab=pivot:overviewtab

Best wireless protocol for IoT [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm developing an IoT application. There is a microcontroller which controls the sensors. Smartphones connect them and perform some actions. I want smartphones to connect multiple devices and control them and in the meantime I dont want internet access of the smartphones to disconnect. What I want to ask is which wireless protocol would be good for this job. Should I use WiFi, Bluetooth, Wifi-Direct or anything else ?
Actually, according to my searches, "WiFi-Direct" seems good option to me, but I wanted ask to you whether it is a good options or not. In addition, please state which specific module can be used such as "HC-06" "ESP8266" and why? while stating which protocol is good for me. Thanks in advance :)
It's a hard question. Answer is depends on many aspects:
What range do you want you sensors support (how far they should stay connected)?
How many sensors do you want to support?
How your sensors are powered up (power line or battery)?
What smartphones do you want to support?
How much data and how frequently they send?
And other...
Let me cover these topics a little more:
Range
This is the easiest one. Bluetooth (depending on class, usually it's II) have a range about 10m (30ft). Wi-Fi (and Wi-Fi Direct which is almost the same) have range about 30m (100ft). So if all your sensors located on a user's body (like wearables) or at the desk (like mice, keyboard) then Bluetooth is fine. If devices are spread over larger area (like temp-sensors in each room), then Wi-Fi based protocol is better.
Number of devices
This is also quite easy. Bluetooth is capable of connecting not more than 8 devices. One of them is master and up to 7 slave devices. Wi-Fi can handle theoretically up to 255 devices, but in practice it's less (due to interference). Usually if you have more then 20-25 devices you need another access point.
Power
If your devices are connected to a power-line (like smart wall sockets or smart light bulbs) then they easily be connected using Wi-Fi. But if it's a button-cell battery then it better be Bluetooth Low Energy (BLE) (a.k.a Bluetooth Smart or Bluetooth 4.0). However there are examples where TV remote control running on 2 AAA batteries uses Wi-Fi Direct.
Smartphones support
Android can do anything, but iPhone is a headache. It does not support Wi-Fi Direct, it does support Bluetooth, but only limited number of BT profiles. If you need to support other BT profiles you need to participate in Apple MFi program and got a license and certification from Apple. Another option is to use Bluetooth Smart technology (BLE). More information about Apple restrictions are here and in the FAQ.
I won't advice about concrete chip-sets, because there are so much choices on a market, also I don't know your budget. However you can try to look at well know brands like Broadcom, Texas Instruments, Marvell and etc. - they provide a chip-sets for any choice and gust.
If you need to support iPhone and all other requirements (range, amount of sensors, etc.) are OK with Bluetooth, I would recommend to use Bluetooth Smart (BLE) as a simplest choice.

How to start working with Bluetooth 4.0? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am interested in Bluetooth 4.0. Where to start adventure with it? If you have any materials, links, books I'll be very grateful. If you could share this knowledge. I would to use BT 4.0 to connect a PC (no matter what system) with a smart phone (eg. Windows Phone).
Right, I tried to quickly put together some relevant information that might help you. There is a big chance I have missed thing because this is a broad topic.
I am pretty sure you will find help here when you will have more specific questions.
Basically when it comes to Bluetooth (Smart, 4.0) devices and programming / connecting to them we can talk about two things:
Bluetooh Clients and Servers
Servers:
usually provide some data to clients. Think about a Heart rate monitor that captures someones heartrate and "stream" it so anyone who connects to the server will be able to read the data.
Clients:
On the other hand clients connect to servers (how obvious) to collect their data, or in some cases to write to them.
Bluetooth Profiles
Bluetooth devices (servers) have so called GATT (generic attribute) Profiles. These profiles describe a kind of unique set of Services. Each Service has different Characteristics. These characteristics hold the actual values.
Think about a Heart rate monitor (HRM). Thats a server. It measures heart rate so clients that connect to it can read / collect it's data. Heart rate monitors have a specific Heart rate monitor GATT profile which describes services and inside the services there are the heart rate specific characteristics like: heart rate measurement, body sensor location, etc.
When a client wants to read these values it has to connect to the HRM, discover it's services and characteristics, then read the values from the discovered characteristics.
Async
It might be obvious but Bluetooth programming (implementing server / client connection and data transfer) is async. It means the client sends something then waits till the server answers then can the it progress to the next step.
Your whole software has to be implemented keeping async programming design in mind.
Documentation
I have to say I found the iOS documentation and support very useful when I developed my first bluetooth app.Android was somewhat more difficult for me because of the lack of examples I found. Also general bluetooth 4.0 support only became available since Android 4.3. (different bluetooth chip manufacturers in different Android phones had different low level bluetooth stack so to use them one had to write native bluetooth code for each different chip with their own SDK - prior to Android 4.3)
Bluetooth.org
I would suggest to start with this:
https://developer.bluetooth.org/DevelopmentResources/Pages/Quick-Start-Kit.aspx
https://developer.bluetooth.org/TechnologyOverview/Pages/Technology-Overview.aspx
https://developer.bluetooth.org/DevelopmentResources/Pages/default.aspx
https://developer.bluetooth.org/gatt/Pages/default.aspx
iOS
It won't hurt if you read about Core-bluetooth framework, which is the iOS approach even if you don't plan to develop on iOS. Since it is well documented it might give you a better overall understanding:
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html
Android
Same for android:
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
Windows 8
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207007%28v=vs.105%29.aspx
I've found "Bluetooth Low Energy: The Developer's Handbook" by Robin Heydon very useful. It deals with all the little details so you can understand how things are working on the lower level.
As a reference, I've found the Bluetooth specification PDF very useful (though it's sometimes hard to find what you need). It looks like they just released a 4.1 version here: https://www.bluetooth.org/en-us/specification/adopted-specifications
EDIT: both references aren't specific to any particular implementation, so I'm not sure how much they'd help if you wanted to learn something specific like iOS BLE or Android BLE.

Bluetooth Low Energy (BLE) protocols other than GATT [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Are there any other methods or protocols other than GATT which can be used under BLE (single mode chips) which are better suited to higher-throughput tasks?
From what I understand the answer to my question is no, but I would like some validation and clarification.
I would like to implement services which involve more than simply manipulating (short) characteristics via BLE. Such services might include file transfer, audio streaming, and basically services which are standard in previous versions of bluetooth.
A convenient solution would be to use the File Transfer Profile (over GOEP) or similar for file transfer. For audio, A2DP seems suitable. However, these do not seem to be possible using BLE.
After reading the core spec v4 from bluetooth.org (specifically Vol. 3), it seems like the only applicable protocol which I can use and adapt (via profiles) for such purposes is GATT, which seems very awkward to use.
Also, according to Overview and Evaluation of Bluetooth Low Energy: An Emerging Low-Power Wireless Technology, it seems like the effective throughput is low:
Whereas the physical layer data rate is 1 Mbps, the maximum application layer throughput
is equal to 236.7 kbps.
However (when measuring real-world performance using TI CC254x via GATT):
... In the described conditions, the maximum application layer throughput we have measured is 58.48 kbps. This
low result can be explained by the following two facts: (i) whereas, in theory, up to eleven such
notifications can be transmitted within a connection event of 7.5 ms, only four notifications are
allowed per connection event, as aforementioned; and (ii) we have observed that less than four
notifications are actually transmitted in most connection events during the experiment (however, the
same phenomenon occurs less frequently for connection intervals greater than 7.5 ms). These
observations show that high throughput has not been a primary goal in the design of the BLE
implementation used in the evaluation.
I realize the above text is specific to the implementation on the TI chip, but such limitations could also apply to other implementations above GATT as well.
If you are writing your own profiles, then you can do whatever you want by opening an L2CAP channel and sending data in any format, without implementing GATT. L2CAP would let you get the max throughput, and be suitable for streaming data as opposed to reading characteristics.
Please see what we have been doing for a long time: IPv6 over BTLE, which is still one IETF draft in the 6LoWPAN WG, and the proposal has been approved in Bleutooth SIG. Here is the news in BLuetooth Technical Updates: 19 Feb, 2013.
IPv6 Over Low Energy New Work Proposal Approved
The IPv6 Over LE New Work Proposal (NWP) submitted by Bluetooth SIG
members is approved. This NWP proposes that permitting IPv6 over the
Low Energy transport will enable new use cases (in home and industrial
automation as well as smart metering) not covered by GATT profiles.
The proposed work meets the requirements defined by the Internet
Engineering Task Force (IETF) as well as complements the work done in
the IP for Smart Objects (IPSO) alliance. The Internet Working Group
will develop a Functional Requirements Document (FRD) based on the
approved NWP. If you are an Adopter member and want to participate in
the FRD development process, please contact the Internet Working Group
Chair.
There is stuff coming up, if you're a member of the SIG look up the Tech Specs section of bluetooth.org

Resources